lsp: Disable usage of follow-up completion invokes (#21755)
Some of our users ran into a peculiar bug: autoimports with vtsls were
leaving behind an extra curly brace. I think we were slightly incorrect
in always requesting a follow-up completion without regard for last
result of completion request (whether it was incomplete or not).
Specifically, we're falling into this branch in current form:
037c2b615b/packages/service/src/service/completion.ts (L121)
which then leads to incorrect edits being returned from vtsls.
Release Notes:
- Fixed an edge case with appliance of autocompletions in VTSLS that
could result in incorrect edits being applied.
This commit is contained in:
parent
7bd69130f8
commit
b7edf31170
1 changed files with 6 additions and 7 deletions
|
@ -4461,16 +4461,15 @@ impl Editor {
|
|||
};
|
||||
|
||||
let query = Self::completion_query(&self.buffer.read(cx).read(cx), position);
|
||||
let (is_followup_invoke, aside_was_displayed) = match self.context_menu.read().deref() {
|
||||
Some(ContextMenu::Completions(menu)) => (true, menu.aside_was_displayed.get()),
|
||||
_ => (false, false),
|
||||
|
||||
let aside_was_displayed = match self.context_menu.read().deref() {
|
||||
Some(ContextMenu::Completions(menu)) => menu.aside_was_displayed.get(),
|
||||
_ => false,
|
||||
};
|
||||
let trigger_kind = match (&options.trigger, is_followup_invoke) {
|
||||
(_, true) => CompletionTriggerKind::TRIGGER_FOR_INCOMPLETE_COMPLETIONS,
|
||||
(Some(trigger), _) if buffer.read(cx).completion_triggers().contains(trigger) => {
|
||||
let trigger_kind = match &options.trigger {
|
||||
Some(trigger) if buffer.read(cx).completion_triggers().contains(trigger) => {
|
||||
CompletionTriggerKind::TRIGGER_CHARACTER
|
||||
}
|
||||
|
||||
_ => CompletionTriggerKind::INVOKED,
|
||||
};
|
||||
let completion_context = CompletionContext {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue