From d49a4d1863c30e2dc6e744bf1f1dc92411912bb5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 3 Mar 2020 18:36:39 +0100 Subject: Rename NameDefinition -> Definition --- crates/ra_ide/src/hover.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide/src/hover.rs') diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index b31956626..26c8996bc 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs @@ -2,7 +2,7 @@ use hir::{Adt, HasSource, HirDisplay, Semantics}; use ra_ide_db::{ - defs::{classify_name, NameDefinition}, + defs::{classify_name, Definition}, RootDatabase, }; use ra_syntax::{ @@ -92,20 +92,20 @@ fn hover_text(docs: Option, desc: Option) -> Option { } } -fn hover_text_from_name_kind(db: &RootDatabase, def: NameDefinition) -> Option { +fn hover_text_from_name_kind(db: &RootDatabase, def: Definition) -> Option { return match def { - NameDefinition::Macro(it) => { + Definition::Macro(it) => { let src = it.source(db); hover_text(src.value.doc_comment_text(), Some(macro_label(&src.value))) } - NameDefinition::StructField(it) => { + Definition::StructField(it) => { let src = it.source(db); match src.value { hir::FieldSource::Named(it) => hover_text(it.doc_comment_text(), it.short_label()), _ => None, } } - NameDefinition::ModuleDef(it) => match it { + Definition::ModuleDef(it) => match it { hir::ModuleDef::Module(it) => match it.definition_source(db).value { hir::ModuleSource::Module(it) => { hover_text(it.doc_comment_text(), it.short_label()) @@ -123,10 +123,10 @@ fn hover_text_from_name_kind(db: &RootDatabase, def: NameDefinition) -> Option from_def_source(db, it), hir::ModuleDef::BuiltinType(it) => Some(it.to_string()), }, - NameDefinition::Local(it) => { + Definition::Local(it) => { Some(rust_code_markup(it.ty(db).display_truncated(db, None).to_string())) } - NameDefinition::TypeParam(_) | NameDefinition::SelfType(_) => { + Definition::TypeParam(_) | Definition::SelfType(_) => { // FIXME: Hover for generic param None } -- cgit v1.2.3