From 216dc856c5b48de7d9cdbe6259b2d0cd3c4e5042 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 11 Feb 2021 19:52:33 +0100 Subject: Wrap `BuiltinType` in code model --- crates/ide/src/doc_links.rs | 5 ++--- crates/ide/src/hover.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ide/src') 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; use hir::{ db::{DefDatabase, HirDatabase}, - Adt, AsAssocItem, AsName, AssocItem, AssocItemContainer, Crate, Field, HasAttrs, ItemInNs, - ModuleDef, + Adt, AsAssocItem, AssocItem, AssocItemContainer, Crate, Field, HasAttrs, ItemInNs, ModuleDef, }; use ide_db::{ defs::{Definition, NameClass, NameRefClass}, @@ -429,7 +428,7 @@ fn get_symbol_filename(db: &dyn HirDatabase, definition: &ModuleDef) -> Option "index.html".to_string(), ModuleDef::Trait(t) => format!("trait.{}.html", t.name(db)), ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)), - ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.as_name()), + ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.name()), ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)), ModuleDef::Variant(ev) => { 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 { ModuleDef::Static(it) => from_def_source(db, it, mod_path), ModuleDef::Trait(it) => from_def_source(db, it, mod_path), ModuleDef::TypeAlias(it) => from_def_source(db, it, mod_path), - ModuleDef::BuiltinType(it) => Some(Markup::fenced_block(&it)), + ModuleDef::BuiltinType(it) => Some(Markup::fenced_block(&it.name())), }, Definition::Local(it) => Some(Markup::fenced_block(&it.ty(db).display(db))), Definition::SelfType(impl_def) => { -- cgit v1.2.3