aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index b33ddcde5..9e61c0212 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -7,13 +7,13 @@ use crate::{
7use hir::Docs; 7use hir::Docs;
8 8
9pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { 9pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
10 let (path, module) = match (&ctx.path_prefix, &ctx.module) { 10 let path = match &ctx.path_prefix {
11 (Some(path), Some(module)) => (path.clone(), module), 11 Some(path) => path.clone(),
12 _ => return, 12 _ => return,
13 }; 13 };
14 let def_id = match module.resolve_path(ctx.db, &path).take_types() { 14 let def = match ctx.resolver.resolve_path(ctx.db, &path).take_types() {
15 Some(it) => it, 15 Some(Resolution::Def { def }) => def,
16 None => return, 16 _ => return,
17 }; 17 };
18 match def_id { 18 match def_id {
19 hir::ModuleDef::Module(module) => { 19 hir::ModuleDef::Module(module) => {
@@ -24,7 +24,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
24 ctx.source_range(), 24 ctx.source_range(),
25 name.to_string(), 25 name.to_string(),
26 ) 26 )
27 .from_resolution(ctx, res) 27 .from_resolution(ctx, &res.def.map(|def| hir::Resolution::Def { def }))
28 .add_to(acc); 28 .add_to(acc);
29 } 29 }
30 } 30 }