diff options
Diffstat (limited to 'crates/ra_ide/src/references/classify.rs')
-rw-r--r-- | crates/ra_ide/src/references/classify.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_ide/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs index e837ca8a3..571236fdc 100644 --- a/crates/ra_ide/src/references/classify.rs +++ b/crates/ra_ide/src/references/classify.rs | |||
@@ -7,8 +7,6 @@ use ra_prof::profile; | |||
7 | use ra_syntax::{ast, AstNode}; | 7 | use ra_syntax::{ast, AstNode}; |
8 | use test_utils::tested_by; | 8 | use test_utils::tested_by; |
9 | 9 | ||
10 | pub use ra_ide_db::defs::{from_module_def, from_struct_field}; | ||
11 | |||
12 | pub enum NameRefClass { | 10 | pub enum NameRefClass { |
13 | NameDefinition(NameDefinition), | 11 | NameDefinition(NameDefinition), |
14 | FieldShorthand { local: Local, field: NameDefinition }, | 12 | FieldShorthand { local: Local, field: NameDefinition }, |
@@ -68,14 +66,14 @@ pub(crate) fn classify_name_ref( | |||
68 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; | 66 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; |
69 | let resolved = sema.resolve_path(&path)?; | 67 | let resolved = sema.resolve_path(&path)?; |
70 | let res = match resolved { | 68 | let res = match resolved { |
71 | PathResolution::Def(def) => from_module_def(def), | 69 | PathResolution::Def(def) => NameDefinition::ModuleDef(def), |
72 | PathResolution::AssocItem(item) => { | 70 | PathResolution::AssocItem(item) => { |
73 | let def = match item { | 71 | let def = match item { |
74 | hir::AssocItem::Function(it) => it.into(), | 72 | hir::AssocItem::Function(it) => it.into(), |
75 | hir::AssocItem::Const(it) => it.into(), | 73 | hir::AssocItem::Const(it) => it.into(), |
76 | hir::AssocItem::TypeAlias(it) => it.into(), | 74 | hir::AssocItem::TypeAlias(it) => it.into(), |
77 | }; | 75 | }; |
78 | from_module_def(def) | 76 | NameDefinition::ModuleDef(def) |
79 | } | 77 | } |
80 | PathResolution::Local(local) => NameDefinition::Local(local), | 78 | PathResolution::Local(local) => NameDefinition::Local(local), |
81 | PathResolution::TypeParam(par) => NameDefinition::TypeParam(par), | 79 | PathResolution::TypeParam(par) => NameDefinition::TypeParam(par), |