Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Filter language server completions even when `is_incomplete: true` (#32491)
Michael Sloan4f5433a1804b
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 2da1d34161f..89fcfc44aaa 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -5139,10 +5139,13 @@ impl Editor {.as_ref().map_or(true, |provider| provider.filter_completions());- // When `is_incomplete` is false, can filter completions instead of re-querying when the- // current query is a suffix of the initial query.if let Some(CodeContextMenu::Completions(menu)) = self.context_menu.borrow_mut().as_mut() {- if !menu.is_incomplete && filter_completions {+ if filter_completions {+ menu.filter(query.clone(), provider.clone(), window, cx);+ }+ // When `is_incomplete` is false, no need to re-query completions when the current query+ // is a suffix of the initial query.+ if !menu.is_incomplete {// If the new query is a suffix of the old query (typing more characters) and// the previous result was complete, the existing completions can be filtered.//@@ -5160,7 +5163,6 @@ impl Editor {menu.initial_position.to_offset(&snapshot) == position.to_offset(&snapshot)};if position_matches {- menu.filter(query.clone(), provider.clone(), window, cx);return;}}