Refine word completions (#26779)

Follow-up of https://github.com/zed-industries/zed/pull/26410

* Extract word completions into their own, `editor::ShowWordCompletions`
action so those could be triggered independently of completions
* Assign `ctrl-shift-space` binding to this new action
* Still keep words returned along the completions as in the original PR,
but:
* Tone down regular completions' fallback logic, skip words when the
language server responds with empty list of completions, but keep on
adding words if nothing or an error were returned instead
    * Adjust the defaults to wait for LSP completions infinitely
* Skip "words" with digits such as `0_usize` or `2.f32` from completion
items, unless a completion query has digits in it

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov authored and GitHub committed 2025-03-14 15:18:55 +00:00
1 parent 21057e3af7
commit 566c5f91a7
18 files changed
+431 -251

No files matched your search

-8
View File
@@ -7299,14 +7299,6 @@ impl Iterator for MultiBufferRows<'_> {
let overshoot = self.point - region.range.start;
let buffer_point = region.buffer_range.start + overshoot;
// dbg!(
// buffer_point.row,
// region.range.end.column,
// self.point.row,
// region.range.end.row,
// self.cursor.is_at_end_of_excerpt(),
// region.buffer.max_point().row
// );
let expand_info = if self.is_singleton {
None
} else {