mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-31 21:36:26 +00:00
Avoid making LSP requests when moving cursor due to following
This commit is contained in:
parent
29892ce5d7
commit
f7e7d58f49
1 changed files with 29 additions and 26 deletions
|
@ -5066,6 +5066,7 @@ impl Editor {
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if local {
|
||||||
let completion_menu = match self.context_menu.as_mut() {
|
let completion_menu = match self.context_menu.as_mut() {
|
||||||
Some(ContextMenu::Completions(menu)) => Some(menu),
|
Some(ContextMenu::Completions(menu)) => Some(menu),
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -5078,7 +5079,8 @@ impl Editor {
|
||||||
let cursor_position = new_cursor_position.to_offset(&buffer);
|
let cursor_position = new_cursor_position.to_offset(&buffer);
|
||||||
let (word_range, kind) =
|
let (word_range, kind) =
|
||||||
buffer.surrounding_word(completion_menu.initial_position.clone());
|
buffer.surrounding_word(completion_menu.initial_position.clone());
|
||||||
if kind == Some(CharKind::Word) && word_range.to_inclusive().contains(&cursor_position)
|
if kind == Some(CharKind::Word)
|
||||||
|
&& word_range.to_inclusive().contains(&cursor_position)
|
||||||
{
|
{
|
||||||
let query = Self::completion_query(&buffer, cursor_position);
|
let query = Self::completion_query(&buffer, cursor_position);
|
||||||
cx.background()
|
cx.background()
|
||||||
|
@ -5096,6 +5098,7 @@ impl Editor {
|
||||||
}
|
}
|
||||||
self.refresh_code_actions(cx);
|
self.refresh_code_actions(cx);
|
||||||
self.refresh_document_highlights(cx);
|
self.refresh_document_highlights(cx);
|
||||||
|
}
|
||||||
|
|
||||||
self.pause_cursor_blinking(cx);
|
self.pause_cursor_blinking(cx);
|
||||||
cx.emit(Event::SelectionsChanged { local });
|
cx.emit(Event::SelectionsChanged { local });
|
||||||
|
|
Loading…
Reference in a new issue