aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 20:44:21 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 20:44:21 +0000
commit9bee2937b4289315714b778ba38ab0e7c2a623fe (patch)
treeec9a223b23f7675a8e0eb1d12c454adc9551baf2 /crates/ra_ide_api/src/completion
parentdc2a8d5acc53054c86ad17260b69d4bf4f14dbc6 (diff)
parenta6590ce2318676210b6b5a197b76b5861a3407c9 (diff)
Merge #463
463: Use name resolution for goto definition r=matklad a=flodiebold This tries proper name resolution before falling back on the index. @matklad There was currently no way of getting the location of a `DefId` from outside `ra_hir`. I added something, but it's probably not the best API, maybe you have a better idea? Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index 4860db629..a25ad3f13 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -15,11 +15,11 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) -> C
15 match def_id.resolve(ctx.db)? { 15 match def_id.resolve(ctx.db)? {
16 hir::Def::Module(module) => { 16 hir::Def::Module(module) => {
17 let module_scope = module.scope(ctx.db)?; 17 let module_scope = module.scope(ctx.db)?;
18 module_scope.entries().for_each(|(name, res)| { 18 for (name, res) in module_scope.entries() {
19 CompletionItem::new(CompletionKind::Reference, name.to_string()) 19 CompletionItem::new(CompletionKind::Reference, name.to_string())
20 .from_resolution(ctx, res) 20 .from_resolution(ctx, res)
21 .add_to(acc) 21 .add_to(acc);
22 }); 22 }
23 } 23 }
24 hir::Def::Enum(e) => { 24 hir::Def::Enum(e) => {
25 e.variants(ctx.db)? 25 e.variants(ctx.db)?