diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 4d3414f33..5ee2864dc 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use hir::{Adt, Either, Resolution}; | 1 | use hir::{Adt, Either, PathResolution}; |
2 | use ra_syntax::AstNode; | 2 | use ra_syntax::AstNode; |
3 | use test_utils::tested_by; | 3 | use test_utils::tested_by; |
4 | 4 | ||
@@ -9,15 +9,15 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
9 | Some(path) => path.clone(), | 9 | Some(path) => path.clone(), |
10 | _ => return, | 10 | _ => return, |
11 | }; | 11 | }; |
12 | let def = match ctx.analyzer.resolve_hir_path(ctx.db, &path).take_types() { | 12 | let def = match dbg!(ctx.analyzer.resolve_hir_path(ctx.db, &path)) { |
13 | Some(Resolution::Def(def)) => def, | 13 | Some(PathResolution::Def(def)) => def, |
14 | _ => return, | 14 | _ => return, |
15 | }; | 15 | }; |
16 | match def { | 16 | match def { |
17 | hir::ModuleDef::Module(module) => { | 17 | hir::ModuleDef::Module(module) => { |
18 | let module_scope = module.scope(ctx.db); | 18 | let module_scope = module.scope(ctx.db); |
19 | for (name, res) in module_scope.entries() { | 19 | for (name, res) in module_scope.entries() { |
20 | if let Some(hir::ModuleDef::BuiltinType(..)) = res.def.as_ref().take_types() { | 20 | if let Some(hir::ModuleDef::BuiltinType(..)) = res.def.take_types() { |
21 | if ctx.use_item_syntax.is_some() { | 21 | if ctx.use_item_syntax.is_some() { |
22 | tested_by!(dont_complete_primitive_in_use); | 22 | tested_by!(dont_complete_primitive_in_use); |
23 | continue; | 23 | continue; |
@@ -34,7 +34,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | } | 36 | } |
37 | acc.add_resolution(ctx, name.to_string(), &res.def.map(hir::Resolution::Def)); | 37 | acc.add_resolution(ctx, name.to_string(), &res.def.into()); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { | 40 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { |