Respect LSP completion triggers when copilot suggestion is on (#11401)
This commit is contained in:
parent
89039f6f34
commit
9ec0927701
4 changed files with 137 additions and 13 deletions
|
@ -2695,15 +2695,9 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
|
||||
if had_active_inline_completion {
|
||||
this.refresh_inline_completion(true, cx);
|
||||
if !this.has_active_inline_completion(cx) {
|
||||
this.trigger_completion_on_input(&text, cx);
|
||||
}
|
||||
} else {
|
||||
this.trigger_completion_on_input(&text, cx);
|
||||
this.refresh_inline_completion(true, cx);
|
||||
}
|
||||
let trigger_in_words = !had_active_inline_completion;
|
||||
this.trigger_completion_on_input(&text, trigger_in_words, cx);
|
||||
this.refresh_inline_completion(true, cx);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3056,7 +3050,12 @@ impl Editor {
|
|||
});
|
||||
}
|
||||
|
||||
fn trigger_completion_on_input(&mut self, text: &str, cx: &mut ViewContext<Self>) {
|
||||
fn trigger_completion_on_input(
|
||||
&mut self,
|
||||
text: &str,
|
||||
trigger_in_words: bool,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
if !EditorSettings::get_global(cx).show_completions_on_input {
|
||||
return;
|
||||
}
|
||||
|
@ -3065,7 +3064,7 @@ impl Editor {
|
|||
if self
|
||||
.buffer
|
||||
.read(cx)
|
||||
.is_completion_trigger(selection.head(), text, cx)
|
||||
.is_completion_trigger(selection.head(), text, trigger_in_words, cx)
|
||||
{
|
||||
self.show_completions(&ShowCompletions, cx);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue