ZIm/crates
Techatrix d5f2bca382
Filter LSP code actions based on the requested kinds (#20847)
I've observed that Zed's implementation of [Code Actions On
Format](https://zed.dev/docs/configuring-zed#code-actions-on-format)
uses the
[CodeActionContext.only](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext)
parameter to request specific code action kinds from the server. The
issue is that it does not filter out code actions from the response,
believing that the server will do it.

The [LSP
specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionContext)
says that the client is responsible for filtering out unwanted code
actions:

```js
/**
* Requested kind of actions to return.
*
* Actions not of this kind are filtered out by the client before being
* shown. So servers can omit computing them.
*/
only?: CodeActionKind[];
```

This PR will filter out unwanted code action on the client side.

I have initially encountered this issue because the [ZLS language
server](https://github.com/zigtools/zls) (until
https://github.com/zigtools/zls/pull/2087) does not filter code action
based on `CodeActionContext.only` so Zed runs all received code actions
even if they are explicitly disabled in the `code_actions_on_format`
setting.

Release Notes:

- Fix the `code_actions_on_format` setting when used with a language
server like ZLS

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-11-22 13:01:00 +01:00
..
activity_indicator language servers: Fix wrong language server name (#20428) 2024-11-11 10:18:38 +01:00
anthropic assistant: Remove low_speed_timeout (#20681) 2024-11-15 07:37:31 +01:00
assets add ui::Vector and separate images from icons (#17815) 2024-09-13 17:44:16 -04:00
assistant Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
assistant_slash_command Extract ExtensionSlashCommand to assistant_slash_command crate (#20617) 2024-11-13 14:34:58 -05:00
assistant_tool assistant: Add basic tool invocation (#17368) 2024-09-04 14:32:20 -04:00
audio Update Rust crate rodio to 0.19.0 (#17389) 2024-09-16 21:55:32 -06:00
auto_update Extract auto_update_ui crate (#21008) 2024-11-21 14:11:57 -05:00
auto_update_ui Extract auto_update_ui crate (#21008) 2024-11-21 14:11:57 -05:00
breadcrumbs Add missing shortcuts in tooltips (#18282) 2024-09-27 11:06:48 +02:00
call Revert "Use livekit's Rust SDK instead of their swift SDK (#13343)" (#20809) 2024-11-18 11:43:53 +02:00
channel Use Instant not chrono for telemetry (#20756) 2024-11-19 08:23:12 -07:00
cli Add initial FreeBSD support (#20480) 2024-11-11 18:39:05 +01:00
client Send os_version and country to amplitude (#20936) 2024-11-20 15:34:24 -07:00
clock Use Instant not chrono for telemetry (#20756) 2024-11-19 08:23:12 -07:00
collab Filter LSP code actions based on the requested kinds (#20847) 2024-11-22 13:01:00 +01:00
collab_ui collab_ui: Remove dependency on vcs_menu (#21016) 2024-11-21 15:48:35 -05:00
collections gpui: Add SVG rendering to img element and generic asset cache (#9931) 2024-03-29 17:09:49 -07:00
command_palette title_bar: Remove dependency on command_palette (#21006) 2024-11-21 13:37:34 -05:00
command_palette_hooks Improve context server lifecycle management (#20622) 2024-11-13 13:55:06 -08:00
context_servers windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
copilot Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
db chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795) 2024-10-07 01:29:58 +02:00
diagnostics Only show breadcrumbs for terminals when there's a title (#20997) 2024-11-21 19:57:09 +02:00
docs_preprocessor Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00
editor Filter LSP code actions based on the requested kinds (#20847) 2024-11-22 13:01:00 +01:00
evals windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
extension windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
extension_api zed_extension_api: Release v0.2.0 (#20683) 2024-11-14 12:44:10 -05:00
extension_cli Add new extension crate (#20089) 2024-11-01 13:20:30 -04:00
extension_host Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
extensions_ui extensions_ui: Remove dependency on theme_selector (#21023) 2024-11-21 16:48:25 -05:00
feature_flags Initial Notebook UI structure (#19756) 2024-10-29 11:30:07 -07:00
feedback title_bar: Remove dependency on feedback (#21013) 2024-11-21 15:24:04 -05:00
file_finder Adjust file finder width configuration (#20819) 2024-11-18 16:32:16 -03:00
file_icons chore: Clean up allocs around project panel (#15422) 2024-07-29 14:21:41 +02:00
fs Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
fsevent Retain run loop (#11241) 2024-04-30 23:31:59 -06:00
fuzzy Improve slash commands (#16195) 2024-08-13 23:06:07 -07:00
git windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
git_hosting_providers git_hosting_providers: Fix support for GitLab remotes containing subgroups (#19962) 2024-10-30 11:16:44 -04:00
go_to_line Improve project search performance (#20211) 2024-11-05 03:49:37 +02:00
google_ai assistant: Remove low_speed_timeout (#20681) 2024-11-15 07:37:31 +01:00
gpui vim: Fix shortcuts that require shift+punct (#20990) 2024-11-21 09:05:00 -07:00
gpui_macros add ui::Vector and separate images from icons (#17815) 2024-09-13 17:44:16 -04:00
html_to_markdown chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
http_client Revert "Use livekit's Rust SDK instead of their swift SDK (#13343)" (#20809) 2024-11-18 11:43:53 +02:00
image_viewer Only show breadcrumbs for terminals when there's a title (#20997) 2024-11-21 19:57:09 +02:00
indexed_docs Use Extension trait in ExtensionLspAdapter (#20704) 2024-11-14 20:44:57 -05:00
inline_completion Extract InlineCompletionProvider to its own crate (#20935) 2024-11-20 16:51:13 -05:00
inline_completion_button language_model: Remove dependency on inline_completion_button (#20930) 2024-11-20 16:19:20 -05:00
install_cli Fix flickering (#9012) 2024-03-11 10:45:57 +01:00
journal chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
language Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
language_model Add language_models crate to house language model providers (#20945) 2024-11-20 18:49:34 -05:00
language_models Add language_models crate to house language model providers (#20945) 2024-11-20 18:49:34 -05:00
language_selector python: Fix toolchains not getting picked up after workspace deserialization (#20488) 2024-11-11 14:35:01 +01:00
language_tools Expose active key equivalents in the keymap context view (#20530) 2024-11-11 23:04:15 -07:00
languages pylsp: Update mypy plugin name (#21031) 2024-11-22 01:13:48 +01:00
live_kit_client Revert "Use livekit's Rust SDK instead of their swift SDK (#13343)" (#20809) 2024-11-18 11:43:53 +02:00
live_kit_server Restore HTTP client transition, but use reqwest everywhere (#19055) 2024-10-11 14:58:58 -07:00
lsp windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
markdown Add initial FreeBSD support (#20480) 2024-11-11 18:39:05 +01:00
markdown_preview Rename ime_key -> key_char and update behavior (#20953) 2024-11-20 20:29:47 -07:00
media Revert "Use livekit's Rust SDK instead of their swift SDK (#13343)" (#20809) 2024-11-18 11:43:53 +02:00
menu open picker (#14524) 2024-07-15 17:04:15 -06:00
multi_buffer Add File.disk_state enum to clarify filesystem states (#20776) 2024-11-18 10:30:08 -08:00
node_runtime windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
notifications Pass Summary::Context to Item::summarize (#18510) 2024-09-29 10:30:48 -06:00
ollama assistant: Remove low_speed_timeout (#20681) 2024-11-15 07:37:31 +01:00
open_ai assistant: Remove low_speed_timeout (#20681) 2024-11-15 07:37:31 +01:00
outline Revert "remove usages of theme::color_alpha" 2024-11-19 00:24:48 -05:00
outline_panel editor: Show hints for using AI features on empty lines (#20824) 2024-11-19 09:41:44 +01:00
paths Add initial FreeBSD support (#20480) 2024-11-11 18:39:05 +01:00
picker toolchains: Use language-specific terms in UI (#20985) 2024-11-21 15:57:22 +01:00
prettier Add more common Prettier plugin base paths (#20758) 2024-11-16 13:20:52 +02:00
project Filter LSP code actions based on the requested kinds (#20847) 2024-11-22 13:01:00 +01:00
project_panel Maintain selection on file/dir deletion in project panel (#20577) 2024-11-22 12:59:04 +02:00
project_symbols Fix renames over language server for SSH remoting (#17897) 2024-09-16 16:20:17 -06:00
proto toolchains: Expose raw JSON representation of a toolchain (#20721) 2024-11-21 13:27:25 +01:00
recent_projects Add extensions to the remote server (#20049) 2024-11-20 19:21:09 -07:00
refineable Move Clippy configuration to the workspace level (#8891) 2024-03-05 12:01:17 -05:00
release_channel chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
remote Fix panics from spawn_local tasks dropped on other threads in remote server (#21022) 2024-11-21 14:50:38 -07:00
remote_server Add extensions to the remote server (#20049) 2024-11-20 19:21:09 -07:00
repl Implement RunningKernel trait for native and remote kernels (#20934) 2024-11-21 14:00:19 -08:00
reqwest_client assistant: Remove low_speed_timeout (#20681) 2024-11-15 07:37:31 +01:00
rich_text Disable definition lists in Markdown (#17648) 2024-09-10 11:16:27 -04:00
rope rope: Minor optimization for tab indices (#20911) 2024-11-21 08:48:13 +01:00
rpc Add support for git branches on remote projects (#19755) 2024-10-27 15:50:54 -07:00
search Only show breadcrumbs for terminals when there's a title (#20997) 2024-11-21 19:57:09 +02:00
semantic_index Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
semantic_version Extract SemanticVersion into its own crate (#9956) 2024-03-29 12:11:57 -04:00
session chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795) 2024-10-07 01:29:58 +02:00
settings Fix keybindings on a Spanish ISO keyboard (#20995) 2024-11-21 10:18:54 -07:00
settings_ui Revert "theme: Turn ThemeRegistry into a trait (#20076)" (#20094) 2024-11-01 15:34:20 -04:00
snippet Snippet choices (#13958) 2024-11-18 22:56:34 +01:00
snippet_provider chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795) 2024-10-07 01:29:58 +02:00
snippets_ui Add snippet commands (#18453) 2024-10-02 13:27:16 +02:00
sqlez Add initial FreeBSD support (#20480) 2024-11-11 18:39:05 +01:00
sqlez_macros Add initial FreeBSD support (#20480) 2024-11-11 18:39:05 +01:00
story chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
storybook Add preview for Checkbox with Label (#20448) 2024-11-08 22:53:15 -05:00
sum_tree Speed up point translation in the Rope (#19913) 2024-10-30 10:59:03 +01:00
supermaven windows: Set CREATE_NO_WINDOW for commands (#18447) 2024-11-20 16:52:38 -08:00
supermaven_api chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
tab_switcher tab_switcher: Use git-aware colors for file icons (#18733) 2024-10-04 10:37:41 -04:00
task tasks: Add editor: Spawn Nearest Task action (#19901) 2024-10-31 14:25:57 +01:00
tasks_ui chore: Sever terminal_view <-> tasks_ui dependency (#20946) 2024-11-21 01:07:14 +01:00
telemetry_events Start to send data to Snowflake too (#20698) 2024-11-15 12:58:00 -07:00
terminal Only show breadcrumbs for terminals when there's a title (#20997) 2024-11-21 19:57:09 +02:00
terminal_view Only show breadcrumbs for terminals when there's a title (#20997) 2024-11-21 19:57:09 +02:00
text Fix a test flake involving zeroed out group_intervals (#20328) 2024-11-07 09:17:43 -07:00
theme Revert "remove usages of theme::color_alpha" 2024-11-19 00:24:48 -05:00
theme_importer chore: Another round of style lints fixes (#17519) 2024-09-07 02:36:55 +02:00
theme_selector title_bar: Remove dependency on theme_selector (#21009) 2024-11-21 14:33:58 -05:00
time_format chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
title_bar title_bar: Remove dependency on feedback (#21013) 2024-11-21 15:24:04 -05:00
toolchain_selector toolchains: Use language-specific terms in UI (#20985) 2024-11-21 15:57:22 +01:00
ui theme: Add color darken function (#20746) 2024-11-18 12:44:49 -03:00
ui_input Rename ui_text_field crate to ui_input (#13949) 2024-07-08 17:05:30 -04:00
ui_macros Fix DynamicSpacing docs (#20509) 2024-11-11 12:58:39 -05:00
util Maintain selection on file/dir deletion in project panel (#20577) 2024-11-22 12:59:04 +02:00
vcs_menu title_bar: Remove dependency on vcs_menu (#21011) 2024-11-21 14:56:02 -05:00
vim Extract VimModeSetting to its own crate (#21019) 2024-11-21 16:24:38 -05:00
vim_mode_setting Extract VimModeSetting to its own crate (#21019) 2024-11-21 16:24:38 -05:00
welcome welcome: Remove dependency on theme_selector (#21024) 2024-11-21 17:50:22 -05:00
workspace Maintain selection on file/dir deletion in project panel (#20577) 2024-11-22 12:59:04 +02:00
worktree Add fs::MTime newtype to encourage != instead of > (#20830) 2024-11-21 19:21:18 -07:00
zed zed: Remove unnecessary #[allow(non_snake_case)] attribute (#21030) 2024-11-21 18:47:44 -05:00
zed_actions title_bar: Remove dependency on feedback (#21013) 2024-11-21 15:24:04 -05:00