ZIm/crates/language/src
frederik-uni 07a77792c5
Add completions.lsp_insert_mode setting to control what ranges are replaced when a completion is inserted (#27453)
This PR adds `completions.lsp_insert_mode` and effectively changes the
default from `"replace"` to `"replace_suffix"`, which automatically
detects whether to use the LSP `replace` range instead of `insert`
range.

`"replace_suffix"` was chosen as a default because it's more
conservative than `"replace_subsequence"`, considering that deleting
text is usually faster and less disruptive than having to rewrite a long
replaced word.

Fixes #27197
Fixes #23395 (again)
Fixes #4816 (again)

Release Notes:

- Added new setting `completions.lsp_insert_mode` that changes what will
be replaced when an LSP completion is accepted. The default is
`"replace_suffix"`, but it accepts 4 values: `"insert"` for replacing
only the text before the cursor, `"replace"` for replacing the whole
text, `"replace_suffix"` that acts like `"replace"` when the text after
the cursor is a suffix of the completion, and `"replace_subsequence"`
that acts like `"replace"` when the text around your cursor is a
subsequence of the completion (similiar to a fuzzy match). Check [the
documentation](https://zed.dev/docs/configuring-zed#LSP-Insert-Mode) for
more information.

---------

Co-authored-by: João Marcos <marcospb19@hotmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-04-02 16:55:03 -03:00
..
syntax_map chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
buffer.rs Improve tracking for agent edits (#27857) 2025-04-01 22:13:28 +00:00
buffer_tests.rs Improve tracking for agent edits (#27857) 2025-04-01 22:13:28 +00:00
diagnostic_set.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
highlight_map.rs Docs for indent_size_for_line and co 2024-01-09 20:50:34 +01:00
language.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
language_registry.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
language_settings.rs Add completions.lsp_insert_mode setting to control what ranges are replaced when a completion is inserted (#27453) 2025-04-02 16:55:03 -03:00
manifest.rs project: Track manifest locations per unique manifest locator (#27194) 2025-03-21 15:22:36 +01:00
outline.rs Fix panic when outline items have no name (#24574) 2025-02-10 18:50:26 +00:00
proto.rs Allow viewing past commits in Zed (#27636) 2025-03-31 23:26:47 +00:00
syntax_map.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
task_context.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
text_diff.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
toolchain.rs toolchains: Add support for relative paths (#27777) 2025-03-31 19:48:09 +02:00