diff options
author | Aleksey Kladov <[email protected]> | 2019-10-31 15:45:10 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-03 15:04:06 +0000 |
commit | ba2efca2bbe5f4434f9a2522b2b94df873f3563b (patch) | |
tree | 786ede7a7c94793becb90a4ca735ecbc7d798d2f /crates/ra_ide_api/src | |
parent | f9f1effd011b906903891c09f1cb6b2a42f73e95 (diff) |
Move CrateDefMap to hir_def
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs index 9ac9768af..09ca40179 100644 --- a/crates/ra_ide_api/src/completion/complete_path.rs +++ b/crates/ra_ide_api/src/completion/complete_path.rs | |||
@@ -18,15 +18,15 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
18 | match def { | 18 | match def { |
19 | hir::ModuleDef::Module(module) => { | 19 | hir::ModuleDef::Module(module) => { |
20 | let module_scope = module.scope(ctx.db); | 20 | let module_scope = module.scope(ctx.db); |
21 | for (name, res) in module_scope.entries() { | 21 | for (name, def, import) in module_scope { |
22 | if let Some(hir::ModuleDef::BuiltinType(..)) = res.def.take_types() { | 22 | if let hir::ScopeDef::ModuleDef(hir::ModuleDef::BuiltinType(..)) = def { |
23 | if ctx.use_item_syntax.is_some() { | 23 | if ctx.use_item_syntax.is_some() { |
24 | tested_by!(dont_complete_primitive_in_use); | 24 | tested_by!(dont_complete_primitive_in_use); |
25 | continue; | 25 | continue; |
26 | } | 26 | } |
27 | } | 27 | } |
28 | if Some(module) == ctx.module { | 28 | if Some(module) == ctx.module { |
29 | if let Some(import) = res.import { | 29 | if let Some(import) = import { |
30 | if let Either::A(use_tree) = module.import_source(ctx.db, import) { | 30 | if let Either::A(use_tree) = module.import_source(ctx.db, import) { |
31 | if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { | 31 | if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { |
32 | // for `use self::foo<|>`, don't suggest `foo` as a completion | 32 | // for `use self::foo<|>`, don't suggest `foo` as a completion |
@@ -36,7 +36,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | } | 38 | } |
39 | acc.add_resolution(ctx, name.to_string(), &res.def.into()); | 39 | acc.add_resolution(ctx, name.to_string(), &def); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { | 42 | hir::ModuleDef::Adt(_) | hir::ModuleDef::TypeAlias(_) => { |