aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/completion')
-rw-r--r--crates/ra_analysis/src/completion/reference_completion.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/completion/reference_completion.rs b/crates/ra_analysis/src/completion/reference_completion.rs
index d301a3c02..1faa70a18 100644
--- a/crates/ra_analysis/src/completion/reference_completion.rs
+++ b/crates/ra_analysis/src/completion/reference_completion.rs
@@ -46,9 +46,12 @@ pub(super) fn completions(
46 .iter() 46 .iter()
47 .filter(|(_name, res)| { 47 .filter(|(_name, res)| {
48 // Don't expose this item 48 // Don't expose this item
49 match res.import_name { 49 match res.import {
50 None => true, 50 None => true,
51 Some(ptr) => !ptr.range().is_subrange(&name_ref.syntax().range()), 51 Some(import) => {
52 let range = import.range(db, module.source().file_id());
53 !range.is_subrange(&name_ref.syntax().range())
54 }
52 } 55 }
53 }) 56 })
54 .map(|(name, _res)| CompletionItem { 57 .map(|(name, _res)| CompletionItem {