mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
Always issue a new completions request when typing a trigger character
We'll interpolate the anchor range of original request, but it's still a good idea to be up-to-date in case the language server is influenced by the content preceding the location. This doesn't *seem* to be the case with rust-analyzer so far, but it's how VS Code works so let's do it this way.
This commit is contained in:
parent
ae0237c21b
commit
327ddbe2b4
@ -1390,15 +1390,13 @@ impl Editor {
|
||||
}
|
||||
|
||||
fn trigger_completion_on_input(&mut self, text: &str, cx: &mut ViewContext<Self>) {
|
||||
if self.completion_state.is_none() {
|
||||
if let Some(selection) = self.newest_anchor_selection() {
|
||||
if self
|
||||
.buffer
|
||||
.read(cx)
|
||||
.is_completion_trigger(selection.head(), text, cx)
|
||||
{
|
||||
self.show_completions(&ShowCompletions, cx);
|
||||
}
|
||||
if let Some(selection) = self.newest_anchor_selection() {
|
||||
if self
|
||||
.buffer
|
||||
.read(cx)
|
||||
.is_completion_trigger(selection.head(), text, cx)
|
||||
{
|
||||
self.show_completions(&ShowCompletions, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user