ZIm/crates
João Marcos b15ee1b1cc
Add dedicated actions for LSP completions insertion mode (#28121)
Adds actions so you can have customized keybindings for `insert` and
`replace` modes.

And add `shift-enter` as a default for `replace`, this will override the
default setting
`completions.lsp_insert_mode` which is set to `replace_suffix`, which
tries to "smartly"
decide whether to replace or insert based on the surrounding text.

For those who come from VSCode, if you want to mimic their behavior, you
only have to
set `completions.lsp_insert_mode` to `insert`.

If you want `tab` and `enter` to do different things, you need to remap
them, here is
an example:

```jsonc
[
  // ...
  {
    "context": "Editor && showing_completions",
    "bindings": {
      "enter": "editor::ConfirmCompletionInsert",
      "tab": "editor::ConfirmCompletionReplace"
    }
  },
]
```

Closes #24577

- [x] Make LSP completion insertion mode decision in guest's machine
(host is currently deciding it and not allowing guests to have their own
setting for it)
- [x] Add shift-enter as a hotkey for `replace` by default.
- [x] Test actions.
- [x] Respect the setting being specified per language, instead of using
the "defaults".
- [x] Move `insert_range` of `Completion` to the Lsp variant of
`.source`.
- [x] Fix broken default, forgotten after
https://github.com/zed-industries/zed/pull/27453#pullrequestreview-2736906628,
should be `replace_suffix` and not `insert`.

Release Notes:

- LSP completions: added actions `ConfirmCompletionInsert` and
`ConfirmCompletionReplace` that control how completions are inserted,
these override `completions.lsp_insert_mode`, by default, `shift-enter`
triggers `ConfirmCompletionReplace` which replaces the whole word.
2025-04-08 22:03:03 +00:00
..
activity_indicator Git activity indicator (#28204) 2025-04-07 18:10:01 +00:00
agent Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
agent_eval Move assistant_evals to agent_evals and remove Judge logic (#28233) 2025-04-07 13:28:06 -05:00
anthropic collab: Capture upstream input/output rate limits from Anthropic (#28106) 2025-04-04 17:09:00 +00:00
askpass Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assets Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assistant assistant: Fix assistant: open prompt library not opening the prompt library (#28156) 2025-04-05 17:10:39 +00:00
assistant_context_editor Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
assistant_settings ai: Separate model settings for each feature (#28088) 2025-04-04 11:40:55 -03:00
assistant_slash_command Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assistant_slash_commands Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assistant_tool agent: Only require confirmation for batch tool when subset of tool calls require confirmation (#28363) 2025-04-08 21:37:10 +00:00
assistant_tools agent: Only require confirmation for batch tool when subset of tool calls require confirmation (#28363) 2025-04-08 21:37:10 +00:00
audio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
auto_update Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
auto_update_ui Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
aws_http_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
bedrock bedrock: Add support for tool use, cross-region inference, and Claude 3.7 Thinking (#28137) 2025-04-05 11:16:26 -04:00
breadcrumbs breadcrumbs: Update multibuffer to match singleton (#28267) 2025-04-07 20:26:55 +00:00
buffer_diff Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
call Fix deafening new participants (#28330) 2025-04-08 16:01:27 +00:00
channel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
cli Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
client Upgrade async-tungstenite to tokio (#26193) 2025-04-08 09:17:08 -06:00
clock Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
collab Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
collab_ui Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
collections Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
command_palette Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
command_palette_hooks Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
component Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
component_preview Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
context_server agent: Only require confirmation for batch tool when subset of tool calls require confirmation (#28363) 2025-04-08 21:37:10 +00:00
context_server_settings Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
copilot chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
credentials_provider Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
dap Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
dap_adapters debugger: Fix gdb adapter and logger (#28280) 2025-04-07 22:02:13 +00:00
db Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
debugger_tools Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
debugger_ui Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
deepseek Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
diagnostics Introduce "Near" block type (#28032) 2025-04-04 17:37:42 -06:00
docs_preprocessor Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
editor Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
evals Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
extension extension: Bump wasi-sdk to version 25 (#27906) 2025-04-05 13:20:36 -04:00
extension_api chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
extension_cli Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
extension_host Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
extensions_ui Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
feature_flags Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
feedback Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
file_finder file_finder: Fix filename matching to require contiguous characters (#28093) 2025-04-05 05:01:56 +05:30
file_icons Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fs chore: Make objc a workspace level crate (#28258) 2025-04-07 18:46:09 +00:00
fsevent Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fuzzy Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
git git: Fix logging FromUtf8Error when diffing (#28276) 2025-04-08 11:28:34 -04:00
git_hosting_providers Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
git_ui chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
go_to_line Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
google_ai agent: Add support for Google Gemini 2.5 preview (#28326) 2025-04-08 15:00:23 +00:00
gpui chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
gpui_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
gpui_tokio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
html_to_markdown Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
http_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
http_client_tls Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
icons agent: Adjust the thread generation design (#28193) 2025-04-07 18:09:38 -03:00
image_viewer Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
indexed_docs Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
inline_completion Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
inline_completion_button Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
install_cli Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
journal Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
language Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
language_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
language_model agent: Add support for Google Gemini 2.5 preview (#28326) 2025-04-08 15:00:23 +00:00
language_model_selector agent: Fix opening configuration view from the model selector (#28154) 2025-04-05 16:32:16 +00:00
language_models language_models: Allow overriding Zed completions URL via environment variable (#28323) 2025-04-08 14:46:15 +00:00
language_selector Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
language_tools Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
languages Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
livekit_api Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
livekit_client Fix deafening new participants (#28330) 2025-04-08 16:01:27 +00:00
lmstudio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
lsp Add support for insert_text_mode of a completion (#28171) 2025-04-07 10:35:11 -06:00
markdown debugger: Add close button and coloring to debug panel session's menu (#28310) 2025-04-08 16:35:33 +00:00
markdown_preview Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
media chore: Make objc a workspace level crate (#28258) 2025-04-07 18:46:09 +00:00
menu Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
migrator Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
mistral Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
multi_buffer Fix panic when a file in a path-based multibuffer excerpt is renamed (#28364) 2025-04-08 22:01:40 +00:00
node_runtime node_runtime: Update to Node 20 (#27912) 2025-04-07 15:47:04 -04:00
notifications Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
ollama Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
open_ai open_ai: Disable parallel_tool_calls (#28056) 2025-04-03 22:07:37 +00:00
outline Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
outline_panel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
panel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
paths Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
picker Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
prettier Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
project Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
project_panel project_panel: Do not allow creating empty file/dir or file/dir with only whitespaces (#28240) 2025-04-08 18:00:01 +05:30
project_symbols Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
prompt_library ai: Separate model settings for each feature (#28088) 2025-04-04 11:40:55 -03:00
prompt_store prompt_store: Remove additional code for /project (#27981) 2025-04-07 12:11:14 -04:00
proto Add dedicated actions for LSP completions insertion mode (#28121) 2025-04-08 22:03:03 +00:00
recent_projects chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
refineable Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
release_channel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
remote Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
remote_server Git activity indicator (#28204) 2025-04-07 18:10:01 +00:00
repl Upgrade async-tungstenite to tokio (#26193) 2025-04-08 09:17:08 -06:00
reqwest_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
rich_text Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
rope chore: Bump Rust version to 1.86 (#28021) 2025-04-03 23:32:50 +02:00
rpc chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
schema_generator Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
search Use new multibuffer excerpts in project search (#27893) 2025-04-02 22:57:40 +00:00
semantic_index Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
semantic_version Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
session Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
settings Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
settings_ui Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
snippet Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
snippet_provider Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
snippets_ui Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
sqlez Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
sqlez_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
story Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
storybook Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
streaming_diff Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
sum_tree Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
supermaven Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
supermaven_api Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
tab_switcher tab_switcher: Add keybind to close tab tooltip (#27212) 2025-04-08 15:57:36 -06:00
task tasks: Add spawn option by tag (#25650) 2025-04-04 14:20:09 +00:00
tasks_ui Support tasks from rust-analyzer (#28359) 2025-04-08 15:07:56 -06:00
telemetry Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
telemetry_events telemetry_events: Rename AssistantEvent to AssistantEventData (#28133) 2025-04-04 19:28:32 -04:00
terminal Fix scrolling too fast on selection for editor and terminal (#28309) 2025-04-08 12:16:18 +05:30
terminal_view chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
text Fix panic when a file in a path-based multibuffer excerpt is renamed (#28364) 2025-04-08 22:01:40 +00:00
theme Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_importer Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_selector Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
time_format Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
title_bar Reapply support for X11 screenshare (#28160) 2025-04-06 11:25:29 -06:00
toolchain_selector Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
ui chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
ui_input ui_input: TextField -> SingleLineInput (#28031) 2025-04-03 16:00:43 -03:00
ui_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
ui_prompt markdown: Don't retain MarkdownStyle in favor of using MarkdownElement directly (#28255) 2025-04-07 19:03:24 +00:00
util agent: Truncate bash tool output (#28291) 2025-04-08 16:55:35 +00:00
util_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
vim vim: Fix visual line yank on newline char (#28005) 2025-04-08 09:15:34 -06:00
vim_mode_setting Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
welcome Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
workspace Debugger UI: Dynamic session contents (#28033) 2025-04-07 23:22:09 +02:00
worktree chore: Replace as_any functions with trait upcasting (#28221) 2025-04-08 22:16:27 +02:00
zed markdown: Move open_url to the MarkdownElement as on_url_click (#28269) 2025-04-07 20:43:00 +00:00
zed_actions assistant: Fix assistant: open prompt library not opening the prompt library (#28156) 2025-04-05 17:10:39 +00:00
zeta Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
zlog Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
zlog_settings Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00