aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs13
1 files changed, 8 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 122dd7bdd..e54fe7b7e 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -19,11 +19,14 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) {
19 for (name, res) in module_scope.entries() { 19 for (name, res) in module_scope.entries() {
20 if Some(module) == ctx.module { 20 if Some(module) == ctx.module {
21 if let Some(import) = res.import { 21 if let Some(import) = res.import {
22 let path = module.import_source(ctx.db, import); 22 if let hir::ImportSource::UseTree(tree) =
23 if path.syntax().range().contains_inclusive(ctx.offset) { 23 module.import_source(ctx.db, import)
24 // for `use self::foo<|>`, don't suggest `foo` as a completion 24 {
25 tested_by!(dont_complete_current_use); 25 if tree.syntax().range().contains_inclusive(ctx.offset) {
26 continue; 26 // for `use self::foo<|>`, don't suggest `foo` as a completion
27 tested_by!(dont_complete_current_use);
28 continue;
29 }
27 } 30 }
28 } 31 }
29 } 32 }