diff options
author | Aleksey Kladov <[email protected]> | 2019-11-15 18:28:00 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-15 18:35:03 +0000 |
commit | b21829f7edd71fb14911fc6ba47fe715757e415f (patch) | |
tree | b92568825de2a5cb2950295d35fac8e3bd9fac15 /crates/ra_ide_api/src/references/classify.rs | |
parent | ea3540c1a8efb3b9c56847f831b08abb3be2d978 (diff) |
Remove old impls infrastructure
Diffstat (limited to 'crates/ra_ide_api/src/references/classify.rs')
-rw-r--r-- | crates/ra_ide_api/src/references/classify.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crates/ra_ide_api/src/references/classify.rs b/crates/ra_ide_api/src/references/classify.rs index 217f9951e..00690e449 100644 --- a/crates/ra_ide_api/src/references/classify.rs +++ b/crates/ra_ide_api/src/references/classify.rs | |||
@@ -114,8 +114,6 @@ pub(crate) fn classify_name_ref( | |||
114 | file_id: FileId, | 114 | file_id: FileId, |
115 | name_ref: &ast::NameRef, | 115 | name_ref: &ast::NameRef, |
116 | ) -> Option<NameDefinition> { | 116 | ) -> Option<NameDefinition> { |
117 | use PathResolution::*; | ||
118 | |||
119 | let _p = profile("classify_name_ref"); | 117 | let _p = profile("classify_name_ref"); |
120 | 118 | ||
121 | let parent = name_ref.syntax().parent()?; | 119 | let parent = name_ref.syntax().parent()?; |
@@ -163,26 +161,26 @@ pub(crate) fn classify_name_ref( | |||
163 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; | 161 | let path = name_ref.syntax().ancestors().find_map(ast::Path::cast)?; |
164 | let resolved = analyzer.resolve_path(db, &path)?; | 162 | let resolved = analyzer.resolve_path(db, &path)?; |
165 | match resolved { | 163 | match resolved { |
166 | Def(def) => Some(from_module_def(db, def, Some(container))), | 164 | PathResolution::Def(def) => Some(from_module_def(db, def, Some(container))), |
167 | AssocItem(item) => Some(from_assoc_item(db, item)), | 165 | PathResolution::AssocItem(item) => Some(from_assoc_item(db, item)), |
168 | Local(local) => { | 166 | PathResolution::Local(local) => { |
169 | let container = local.module(db); | 167 | let container = local.module(db); |
170 | let kind = NameKind::Local(local); | 168 | let kind = NameKind::Local(local); |
171 | Some(NameDefinition { kind, container, visibility: None }) | 169 | Some(NameDefinition { kind, container, visibility: None }) |
172 | } | 170 | } |
173 | GenericParam(par) => { | 171 | PathResolution::GenericParam(par) => { |
174 | // FIXME: get generic param def | 172 | // FIXME: get generic param def |
175 | let kind = NameKind::GenericParam(par); | 173 | let kind = NameKind::GenericParam(par); |
176 | Some(NameDefinition { kind, container, visibility }) | 174 | Some(NameDefinition { kind, container, visibility }) |
177 | } | 175 | } |
178 | Macro(def) => { | 176 | PathResolution::Macro(def) => { |
179 | let kind = NameKind::Macro(def); | 177 | let kind = NameKind::Macro(def); |
180 | Some(NameDefinition { kind, container, visibility }) | 178 | Some(NameDefinition { kind, container, visibility }) |
181 | } | 179 | } |
182 | SelfType(impl_block) => { | 180 | PathResolution::SelfType(impl_block) => { |
183 | let ty = impl_block.target_ty(db); | 181 | let ty = impl_block.target_ty(db); |
184 | let kind = NameKind::SelfType(ty); | 182 | let kind = NameKind::SelfType(ty); |
185 | let container = impl_block.module(); | 183 | let container = impl_block.module(db); |
186 | Some(NameDefinition { kind, container, visibility }) | 184 | Some(NameDefinition { kind, container, visibility }) |
187 | } | 185 | } |
188 | } | 186 | } |