mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
workaround for trigger character
This commit is contained in:
parent
2a43638052
commit
ecc5a2e3df
1 changed files with 5 additions and 1 deletions
|
@ -69,7 +69,11 @@ impl<'a> CompletionContext<'a> {
|
||||||
// This is purely advisory and can be used, for example, to highlight this range in the editor.
|
// This is purely advisory and can be used, for example, to highlight this range in the editor.
|
||||||
// Clients are expected to ignore this field.
|
// Clients are expected to ignore this field.
|
||||||
pub(crate) fn source_range(&self) -> TextRange {
|
pub(crate) fn source_range(&self) -> TextRange {
|
||||||
self.leaf.range()
|
match self.leaf.kind() {
|
||||||
|
// workaroud when completion is triggered by trigger characters.
|
||||||
|
DOT | COLONCOLON => TextRange::from_to(self.offset, self.offset),
|
||||||
|
_ => self.leaf.range()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) {
|
fn fill(&mut self, original_file: &'a SourceFile, offset: TextUnit) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue