aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/change.rs4
-rw-r--r--crates/ra_ide_api/src/references/classify.rs16
2 files changed, 8 insertions, 12 deletions
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs
index 010b45141..5c9dec13e 100644
--- a/crates/ra_ide_api/src/change.rs
+++ b/crates/ra_ide_api/src/change.rs
@@ -271,7 +271,6 @@ impl RootDatabase {
271 self.query(hir::db::AstIdMapQuery).sweep(sweep); 271 self.query(hir::db::AstIdMapQuery).sweep(sweep);
272 272
273 self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); 273 self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep);
274 self.query(hir::db::ImplsInModuleWithSourceMapQuery).sweep(sweep);
275 self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); 274 self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep);
276 275
277 self.query(hir::db::ExprScopesQuery).sweep(sweep); 276 self.query(hir::db::ExprScopesQuery).sweep(sweep);
@@ -314,8 +313,6 @@ impl RootDatabase {
314 hir::db::RawItemsWithSourceMapQuery 313 hir::db::RawItemsWithSourceMapQuery
315 hir::db::RawItemsQuery 314 hir::db::RawItemsQuery
316 hir::db::CrateDefMapQuery 315 hir::db::CrateDefMapQuery
317 hir::db::ImplsInModuleWithSourceMapQuery
318 hir::db::ImplsInModuleQuery
319 hir::db::GenericParamsQuery 316 hir::db::GenericParamsQuery
320 hir::db::FnDataQuery 317 hir::db::FnDataQuery
321 hir::db::TypeAliasDataQuery 318 hir::db::TypeAliasDataQuery
@@ -340,6 +337,7 @@ impl RootDatabase {
340 hir::db::TraitDatumQuery 337 hir::db::TraitDatumQuery
341 hir::db::StructDatumQuery 338 hir::db::StructDatumQuery
342 hir::db::ImplDatumQuery 339 hir::db::ImplDatumQuery
340 hir::db::ImplDataQuery
343 hir::db::TraitSolveQuery 341 hir::db::TraitSolveQuery
344 ]; 342 ];
345 acc.sort_by_key(|it| std::cmp::Reverse(it.1)); 343 acc.sort_by_key(|it| std::cmp::Reverse(it.1));
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 }