aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion')
-rw-r--r--crates/ra_ide_api/src/completion/completion_context.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/completion/completion_context.rs b/crates/ra_ide_api/src/completion/completion_context.rs
index fd4cfc944..7bc2def14 100644
--- a/crates/ra_ide_api/src/completion/completion_context.rs
+++ b/crates/ra_ide_api/src/completion/completion_context.rs
@@ -69,7 +69,11 @@ impl<'a> CompletionContext<'a> {
69 // This is purely advisory and can be used, for example, to highlight this range in the editor. 69 // This is purely advisory and can be used, for example, to highlight this range in the editor.
70 // Clients are expected to ignore this field. 70 // Clients are expected to ignore this field.
71 pub(crate) fn source_range(&self) -> TextRange { 71 pub(crate) fn source_range(&self) -> TextRange {
72 self.leaf.range() 72 match self.leaf.kind() {
73 // workaroud when completion is triggered by trigger characters.
74 DOT | COLONCOLON => TextRange::from_to(self.offset, self.offset),
75 _ => self.leaf.range()
76 }
73 } 77 }
74 78
75 fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) { 79 fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) {