diff options
Diffstat (limited to 'crates/ide_completion/src/completions/qualified_path.rs')
-rw-r--r-- | crates/ide_completion/src/completions/qualified_path.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ide_completion/src/completions/qualified_path.rs b/crates/ide_completion/src/completions/qualified_path.rs index eedb44873..ed48f61af 100644 --- a/crates/ide_completion/src/completions/qualified_path.rs +++ b/crates/ide_completion/src/completions/qualified_path.rs | |||
@@ -7,21 +7,19 @@ use syntax::AstNode; | |||
7 | use crate::{CompletionContext, Completions}; | 7 | use crate::{CompletionContext, Completions}; |
8 | 8 | ||
9 | pub(crate) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionContext) { | 9 | pub(crate) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionContext) { |
10 | if ctx.is_path_disallowed() { | ||
11 | return; | ||
12 | } | ||
10 | let path = match &ctx.path_qual { | 13 | let path = match &ctx.path_qual { |
11 | Some(path) => path.clone(), | 14 | Some(path) => path.clone(), |
12 | None => return, | 15 | None => return, |
13 | }; | 16 | }; |
14 | 17 | ||
15 | if ctx.attribute_under_caret.is_some() || ctx.mod_declaration_under_caret.is_some() { | ||
16 | return; | ||
17 | } | ||
18 | |||
19 | let context_module = ctx.scope.module(); | ||
20 | |||
21 | let resolution = match ctx.sema.resolve_path(&path) { | 18 | let resolution = match ctx.sema.resolve_path(&path) { |
22 | Some(res) => res, | 19 | Some(res) => res, |
23 | None => return, | 20 | None => return, |
24 | }; | 21 | }; |
22 | let context_module = ctx.scope.module(); | ||
25 | 23 | ||
26 | // Add associated types on type parameters and `Self`. | 24 | // Add associated types on type parameters and `Self`. |
27 | resolution.assoc_type_shorthand_candidates(ctx.db, |_, alias| { | 25 | resolution.assoc_type_shorthand_candidates(ctx.db, |_, alias| { |