From aacc8941342d9b04fe65164018c07c994ff981b7 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 9 Jun 2019 23:59:59 +0800 Subject: Add display::Description --- crates/ra_ide_api/src/goto_definition.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'crates/ra_ide_api/src/goto_definition.rs') diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index fbd881bfe..359fc2da1 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -13,6 +13,7 @@ use crate::{ db::RootDatabase, RangeInfo, name_ref_kind::{NameRefKind::*, classify_name_ref}, + display::Description, }; pub(crate) fn goto_definition( @@ -72,7 +73,7 @@ pub(crate) fn reference_definition( } } Some(Pat(pat)) => return Exact(NavigationTarget::from_pat(db, file_id, pat)), - Some(SelfParam(par)) => return Exact(NavigationTarget::from_self_param(db, file_id, par)), + Some(SelfParam(par)) => return Exact(NavigationTarget::from_self_param(file_id, par)), Some(GenericParam(_)) => { // FIXME: go to the generic param def } @@ -115,37 +116,37 @@ pub(crate) fn name_definition( fn named_target(file_id: FileId, node: &SyntaxNode) -> Option { visitor() .visit(|node: &ast::StructDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::EnumDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::EnumVariant| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::FnDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::TypeAliasDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::ConstDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::StaticDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::TraitDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::NamedFieldDef| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::Module| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), node.description()) }) .visit(|node: &ast::MacroCall| { - NavigationTarget::from_named(file_id, node, node.doc_comment_text()) + NavigationTarget::from_named(file_id, node, node.doc_comment_text(), None) }) .accept(node) } -- cgit v1.2.3