diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-19 13:57:03 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-19 13:57:03 +0000 |
commit | 27587f3501168c0522e62bf14923aedbdc08a960 (patch) | |
tree | f323973f087ef0f47ef7015a930b09fefdf723a6 /crates/ra_ide/src/goto_definition.rs | |
parent | ff415582960dbd91a18a092271c0848d6c90b0ec (diff) | |
parent | 372439dec88f8ce3350f29aa56801c8f30e59abe (diff) |
Merge #3236
3236: Merge NameDefinition and NameKind r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
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 |