diff options
author | Jonas Schievink <[email protected]> | 2021-02-11 18:52:33 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-02-11 18:52:33 +0000 |
commit | 216dc856c5b48de7d9cdbe6259b2d0cd3c4e5042 (patch) | |
tree | f488d4f3d44e60ea6c3ff98b5fb8c8f2a209f907 /crates/ide | |
parent | b0f20a795d6b1f8d36d1cbe294e54ac592b98f5e (diff) |
Wrap `BuiltinType` in code model
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/doc_links.rs | 5 | ||||
-rw-r--r-- | crates/ide/src/hover.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs index 730e0dd0a..f94adec9b 100644 --- a/crates/ide/src/doc_links.rs +++ b/crates/ide/src/doc_links.rs | |||
@@ -9,8 +9,7 @@ use url::Url; | |||
9 | 9 | ||
10 | use hir::{ | 10 | use hir::{ |
11 | db::{DefDatabase, HirDatabase}, | 11 | db::{DefDatabase, HirDatabase}, |
12 | Adt, AsAssocItem, AsName, AssocItem, AssocItemContainer, Crate, Field, HasAttrs, ItemInNs, | 12 | Adt, AsAssocItem, AssocItem, AssocItemContainer, Crate, Field, HasAttrs, ItemInNs, ModuleDef, |
13 | ModuleDef, | ||
14 | }; | 13 | }; |
15 | use ide_db::{ | 14 | use ide_db::{ |
16 | defs::{Definition, NameClass, NameRefClass}, | 15 | defs::{Definition, NameClass, NameRefClass}, |
@@ -429,7 +428,7 @@ fn get_symbol_filename(db: &dyn HirDatabase, definition: &ModuleDef) -> Option<S | |||
429 | ModuleDef::Module(_) => "index.html".to_string(), | 428 | ModuleDef::Module(_) => "index.html".to_string(), |
430 | ModuleDef::Trait(t) => format!("trait.{}.html", t.name(db)), | 429 | ModuleDef::Trait(t) => format!("trait.{}.html", t.name(db)), |
431 | ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)), | 430 | ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)), |
432 | ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.as_name()), | 431 | ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.name()), |
433 | ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)), | 432 | ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)), |
434 | ModuleDef::Variant(ev) => { | 433 | ModuleDef::Variant(ev) => { |
435 | format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db)) | 434 | format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db)) |
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 5d2d072b1..00745238a 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -334,7 +334,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
334 | ModuleDef::Static(it) => from_def_source(db, it, mod_path), | 334 | ModuleDef::Static(it) => from_def_source(db, it, mod_path), |
335 | ModuleDef::Trait(it) => from_def_source(db, it, mod_path), | 335 | ModuleDef::Trait(it) => from_def_source(db, it, mod_path), |
336 | ModuleDef::TypeAlias(it) => from_def_source(db, it, mod_path), | 336 | ModuleDef::TypeAlias(it) => from_def_source(db, it, mod_path), |
337 | ModuleDef::BuiltinType(it) => Some(Markup::fenced_block(&it)), | 337 | ModuleDef::BuiltinType(it) => Some(Markup::fenced_block(&it.name())), |
338 | }, | 338 | }, |
339 | Definition::Local(it) => Some(Markup::fenced_block(&it.ty(db).display(db))), | 339 | Definition::Local(it) => Some(Markup::fenced_block(&it.ty(db).display(db))), |
340 | Definition::SelfType(impl_def) => { | 340 | Definition::SelfType(impl_def) => { |