diff options
Diffstat (limited to 'crates/ra_ide/src/goto_definition.rs')
-rw-r--r-- | crates/ra_ide/src/goto_definition.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs index de5551a4c..cce539e56 100644 --- a/crates/ra_ide/src/goto_definition.rs +++ b/crates/ra_ide/src/goto_definition.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | use hir::{db::AstDatabase, InFile, SourceBinder}; | 3 | use hir::{db::AstDatabase, InFile, SourceBinder}; |
4 | use ra_ide_db::{symbol_index, RootDatabase}; | 4 | use ra_ide_db::{defs::NameDefinition, symbol_index, RootDatabase}; |
5 | use ra_syntax::{ | 5 | use ra_syntax::{ |
6 | ast::{self, DocCommentsOwner}, | 6 | ast::{self, DocCommentsOwner}, |
7 | match_ast, AstNode, | 7 | match_ast, AstNode, |
@@ -12,7 +12,7 @@ use ra_syntax::{ | |||
12 | use crate::{ | 12 | use crate::{ |
13 | display::{ShortLabel, ToNav}, | 13 | display::{ShortLabel, ToNav}, |
14 | expand::descend_into_macros, | 14 | expand::descend_into_macros, |
15 | references::{classify_name_ref, NameKind::*}, | 15 | references::classify_name_ref, |
16 | FilePosition, NavigationTarget, RangeInfo, | 16 | FilePosition, NavigationTarget, RangeInfo, |
17 | }; | 17 | }; |
18 | 18 | ||
@@ -73,17 +73,17 @@ pub(crate) fn reference_definition( | |||
73 | ) -> ReferenceResult { | 73 | ) -> ReferenceResult { |
74 | use self::ReferenceResult::*; | 74 | use self::ReferenceResult::*; |
75 | 75 | ||
76 | let name_kind = classify_name_ref(sb, name_ref).map(|d| d.kind); | 76 | let name_kind = classify_name_ref(sb, name_ref); |
77 | match name_kind { | 77 | match name_kind { |
78 | Some(Macro(it)) => return Exact(it.to_nav(sb.db)), | 78 | Some(NameDefinition::Macro(it)) => return Exact(it.to_nav(sb.db)), |
79 | Some(StructField(it)) => return Exact(it.to_nav(sb.db)), | 79 | Some(NameDefinition::StructField(it)) => return Exact(it.to_nav(sb.db)), |
80 | Some(TypeParam(it)) => return Exact(it.to_nav(sb.db)), | 80 | Some(NameDefinition::TypeParam(it)) => return Exact(it.to_nav(sb.db)), |
81 | Some(Local(it)) => return Exact(it.to_nav(sb.db)), | 81 | Some(NameDefinition::Local(it)) => return Exact(it.to_nav(sb.db)), |
82 | Some(ModuleDef(def)) => match NavigationTarget::from_def(sb.db, def) { | 82 | Some(NameDefinition::ModuleDef(def)) => match NavigationTarget::from_def(sb.db, def) { |
83 | Some(nav) => return Exact(nav), | 83 | Some(nav) => return Exact(nav), |
84 | None => return Approximate(vec![]), | 84 | None => return Approximate(vec![]), |
85 | }, | 85 | }, |
86 | Some(SelfType(imp)) => { | 86 | Some(NameDefinition::SelfType(imp)) => { |
87 | // FIXME: ideally, this should point to the type in the impl, and | 87 | // FIXME: ideally, this should point to the type in the impl, and |
88 | // not at the whole impl. And goto **type** definition should bring | 88 | // not at the whole impl. And goto **type** definition should bring |
89 | // us to the actual type | 89 | // us to the actual type |