ZIm/crates
Kirill Bulatov e07ffe7cf1
Allow to fetch cargo diagnostics separately (#29706)
Adjusts the way `cargo` and `rust-analyzer` diagnostics are fetched into
Zed.

Nothing is changed for defaults: in this mode, Zed does nothing but
reports file updates, which trigger rust-analyzers'
mechanisms:

* generating internal diagnostics, which it is able to produce on the
fly, without blocking cargo lock.
Unfortunately, there are not that many diagnostics in r-a, and some of
them have false-positives compared to rustc ones

* running `cargo check --workspace --all-targets` on each file save,
taking the cargo lock
For large projects like Zed, this might take a while, reducing the
ability to choose how to work with the project: e.g. it's impossible to
save multiple times without long diagnostics refreshes (may happen
automatically on e.g. focus loss), save the project and run it instantly
without waiting for cargo check to finish, etc.

In addition, it's relatively tricky to reconfigure r-a to run a
different command, with different arguments and maybe different env
vars: that would require a language server restart (and a large project
reindex) and fiddling with multiple JSON fields.

The new mode aims to separate out cargo diagnostics into its own loop so
that all Zed diagnostics features are supported still.


For that, an extra mode was introduced:

```jsonc
"rust": {
  // When enabled, Zed runs `cargo check --message-format=json`-based commands and
  // collect cargo diagnostics instead of rust-analyzer.
  "fetch_cargo_diagnostics": false,
  // A command override for fetching the cargo diagnostics.
  // First argument is the command, followed by the arguments.
  "diagnostics_fetch_command": [
    "cargo",
    "check",
    "--quiet",
    "--workspace",
    "--message-format=json",
    "--all-targets",
    "--keep-going"
  ],
  // Extra environment variables to pass to the diagnostics fetch command.
  "env": {}
}
```

which calls to cargo, parses its output and mixes in with the existing
diagnostics:




https://github.com/user-attachments/assets/e986f955-b452-4995-8aac-3049683dd22c




Release Notes:

- Added a way to get diagnostics from cargo and rust-analyzer without
mutually locking each other
- Added `ctrl-r` binding to refresh diagnostics in the project
diagnostics editor context
2025-05-01 11:25:52 +03:00
..
activity_indicator Git activity indicator (#28204) 2025-04-07 18:10:01 +00:00
agent agent: Allow adding/removing context when editing existing messages (#29698) 2025-05-01 01:39:34 +00:00
anthropic anthropic: Remove list of supported countries (#29346) 2025-04-24 15:17:33 +00:00
askpass askpass: Shell escape Zed path in askpass script (#29447) 2025-04-25 21:16:43 +00:00
assets Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assistant agent: Add new panel navigation dropdown (#29539) 2025-04-29 21:58:45 -03:00
assistant_context_editor agent: Add new panel navigation dropdown (#29539) 2025-04-29 21:58:45 -03:00
assistant_settings VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
assistant_slash_command Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
assistant_slash_commands zed: Remove unnecessary clones (#29513) 2025-04-27 19:23:37 -07:00
assistant_tool Use outline (#29687) 2025-04-30 18:00:00 +00:00
assistant_tools Re-enable open tool (#29707) 2025-04-30 22:33:52 -04:00
audio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
auto_update VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
auto_update_helper Update block diagnostics (#28006) 2025-04-15 09:35:13 -06:00
auto_update_ui Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
aws_http_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
bedrock bedrock: Preserve thinking blocks for Bedrock (#29602) 2025-04-29 12:18:32 -04:00
breadcrumbs breadcrumbs: Update multibuffer to match singleton (#28267) 2025-04-07 20:26:55 +00:00
buffer_diff Fix diff recalculation hang (#28377) 2025-04-10 22:58:41 +00:00
call VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
channel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
cli Try to weak-link ScreenCaptureKit always (#28585) 2025-04-11 17:38:14 +00:00
client reqwest_client: Only register proxies with valid proxy URIs (#27773) 2025-04-28 11:12:16 -04:00
clock Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
collab collab: Look up Stripe prices with lookup keys (#29715) 2025-05-01 00:26:31 +00:00
collab_ui Fix channel notes searching in buffer picker (#29611) 2025-04-29 17:57:39 +00:00
collections Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
command_palette Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00:00
command_palette_hooks Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
component Add example agent tool preview (#28984) 2025-04-17 17:29:19 +00:00
component_preview Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00:00
context_server agent: Render diffs for the edit file tool (#29234) 2025-04-23 15:43:33 -03:00
context_server_settings VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
copilot Default to fast model for thread summaries and titles + don't include system prompt / context / thinking segments (#29102) 2025-04-19 23:26:29 +00:00
credentials_provider Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
dap debugger: Fix bug where args from debug config weren't sent to adapters (#29445) 2025-04-28 18:20:03 +00:00
dap_adapters debugger/tasks: Remove TaskType enum (#29208) 2025-04-26 01:44:56 +02:00
db Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00:00
debugger_tools Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
debugger_ui debugger: Extract running state from DebugSession mode and remove mode field (#29646) 2025-04-30 05:57:53 +00:00
deepseek Default to fast model for thread summaries and titles + don't include system prompt / context / thinking segments (#29102) 2025-04-19 23:26:29 +00:00
diagnostics Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
docs_preprocessor Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
editor Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
eval Make eval more resilient to bad input from LLM (#29703) 2025-04-30 18:13:45 -04:00
extension extension: Use heck instead of convert_case for snake_case check (#28608) 2025-04-11 22:01:25 +00:00
extension_api zed_extension_api: Fork new version of extension API (#29579) 2025-04-29 01:24:13 +00:00
extension_cli Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
extension_host zed_extension_api: Fork new version of extension API (#29579) 2025-04-29 01:24:13 +00:00
extensions_ui extensions_ui: Fix scroll to top only on refetch (#29640) 2025-04-30 09:39:17 +05:30
feature_flags title_bar: Put plan behind new-billing feature flag (#29540) 2025-04-28 15:23:25 +00:00
feedback feedback: Update issue template URL (#28790) 2025-04-15 21:36:30 -04:00
file_finder file_finder: Add skip_focus_for_active_in_search setting (#27624) 2025-04-30 22:58:33 +05:30
file_icons Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fs git: Use the CLI for loading commit SHAs and details (#29351) 2025-04-25 14:46:02 -04: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 Fix parsing of author name in git show output (#29704) 2025-04-30 20:54:53 +00:00
git_hosting_providers VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
git_ui Mitigate panic in merge conflict resolution (#29678) 2025-04-30 11:25:26 -04:00
go_to_line VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
google_ai Fix token counting requests in Gemini (#29643) 2025-04-30 04:55:07 +00:00
gpui chore: Move Windows dependencies to windows section (#29649) 2025-04-30 16:24:05 +08:00
gpui_macros Rename regex search tool to grep and accept an include glob pattern (#29100) 2025-04-20 00:53:30 +00: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 reqwest_client: Only register proxies with valid proxy URIs (#27773) 2025-04-28 11:12:16 -04:00
http_client_tls Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
icons agent: Add new panel navigation dropdown (#29539) 2025-04-29 21:58:45 -03:00
image_viewer Use image cache to stop leaking images (#29452) 2025-04-29 19:30:16 +00:00
indexed_docs Add --user-data-dir CLI flag and propose renaming support_dir to data_dir (#26886) 2025-04-10 21:16:43 +00:00
inline_completion Show edit predictions usage in status bar menu (#29046) 2025-04-18 14:15:19 +00:00
inline_completion_button inline_completion_button: Show the usage limits returned from the API (#29239) 2025-04-22 21:16:54 +00:00
install_cli install_cli: Show feedback when installing CLI from welcome screen (#28532) 2025-04-11 01:47:40 +05:30
journal VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
language Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
language_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
language_model agent: Support images via @file and the file context picker (#29596) 2025-04-29 16:26:27 +02:00
language_model_selector Associate each thread with a model (#29573) 2025-04-28 23:43:16 +00:00
language_models Fix token counting requests in Gemini (#29643) 2025-04-30 04:55:07 +00:00
language_selector Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
language_tools Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
languages Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03: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 debugger: Add support for inline value hints (#28656) 2025-04-23 22:27:27 +00:00
markdown Make code block eval resilient to indentation (#29633) 2025-04-30 02:13:13 +00:00
markdown_preview Use image cache to stop leaking images (#29452) 2025-04-29 19:30:16 +00:00
media chore: Make objc a workspace level crate (#28258) 2025-04-07 18:46:09 +00:00
menu agent: Add new panel navigation dropdown (#29539) 2025-04-29 21:58:45 -03:00
migrator agent: Improve initial file search quality (#29317) 2025-04-23 21:24:41 -03:00
mistral Switch from open-codestral-mamba to codestral-latest for default mistral model (#29104) 2025-04-19 23:29:36 +00:00
multi_buffer Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
node_runtime reqwest_client: Only register proxies with valid proxy URIs (#27773) 2025-04-28 11:12:16 -04:00
notifications Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
ollama ollama: Add Qwen3 and Gemma3 (default to 16K context) (#29580) 2025-04-28 21:44:28 -04:00
open_ai open_ai: Remove list of supported countries (#29347) 2025-04-24 14:55:37 +00:00
outline Highlight merge conflicts and provide for resolving them (#28065) 2025-04-23 12:38:46 -04:00
outline_panel VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
panel Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
paths VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
picker agent: Refine language model selector (#28597) 2025-04-11 23:02:50 +00:00
prettier Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
project Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
project_panel Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
project_symbols Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
prompt_store agent: Include grep-related instructions in the prompt only if the tool is available (#29536) 2025-04-28 19:47:40 +00:00
proto Allow to fetch cargo diagnostics separately (#29706) 2025-05-01 11:25:52 +03:00
recent_projects VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
refineable Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
release_channel Fix handling of --system-specs argument so it happens before Application::new (#29240) 2025-04-22 21:32:32 +00:00
remote Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
remote_server reqwest_client: Only register proxies with valid proxy URIs (#27773) 2025-04-28 11:12:16 -04:00
repl Use image cache to stop leaking images (#29452) 2025-04-29 19:30:16 +00:00
reqwest_client reqwest_client: Only register proxies with valid proxy URIs (#27773) 2025-04-28 11:12:16 -04: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 rpc: Remove llm module in favor of zed_llm_client (#28900) 2025-04-16 20:22:44 +00:00
rules_library agent: Add "max mode" toggle (#29549) 2025-04-28 16:50:47 +00:00
schema_generator Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
search Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
semantic_index agent: Add "max mode" toggle (#29549) 2025-04-28 16:50:47 +00:00
semantic_version Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
session Avoid unnecessary DB writes (#29417) 2025-04-25 17:41:49 +03:00
settings Refactor markdown formatting utilities to avoid building intermediate strings (#29511) 2025-04-27 19:04:51 +00:00
settings_ui Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
snippet Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
snippet_provider snippet_provider: Use proper casing of VsCode in identifiers (#29038) 2025-04-18 12:11:54 +00:00
snippets_ui Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
sqlez Simplify the SerializableItem::cleanup implementation (#29567) 2025-04-28 22:15:24 +00: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 Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06: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 Add searchable global tab switcher (#28047) 2025-04-28 09:21:27 +00:00
task debugger: Fix new session modal not having worktree scenarios (#29453) 2025-04-26 00:16:21 +00:00
tasks_ui debugger/tasks: Remove TaskType enum (#29208) 2025-04-26 01:44:56 +02:00
telemetry Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
telemetry_events Add new action to run agent eval (#29158) 2025-04-21 21:30:21 -07:00
terminal agent: Create TerminalToolCard and display shell output while it's running (#29546) 2025-04-29 16:06:43 +00:00
terminal_view agent: Create TerminalToolCard and display shell output while it's running (#29546) 2025-04-29 16:06:43 +00:00
text format: Re-implement support for formatting with code actions that contain commands (#28392) 2025-04-09 01:53:54 +00:00
theme VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
theme_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_importer theme_importer: Handle comma-separated token scopes (#27740) 2025-04-23 14:06:58 +00:00
theme_selector theme_selector: Don't select last theme when fuzzy searching (#28278) 2025-04-28 14:29:17 +00:00
time_format Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
title_bar title_bar: Put plan behind new-billing feature flag (#29540) 2025-04-28 15:23:25 +00:00
toolchain_selector toolchain: Respect currently focused file when querying toolchains (#28875) 2025-04-16 19:05:57 +02:00
ui welcome: Theme preview tile (#29689) 2025-04-30 17:46:11 +00:00
ui_input Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
ui_macros Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06: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: Create TerminalToolCard and display shell output while it's running (#29546) 2025-04-29 16:06:43 +00:00
util_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
vim vim: Fix incorrect escaping parenthesis of replacement string (#29555) 2025-04-29 19:55:02 -06:00
vim_mode_setting VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00
web_search agent: Expose web search tool to beta users (#29273) 2025-04-23 15:30:20 +00:00
web_search_providers agent: Expose web search tool to beta users (#29273) 2025-04-23 15:30:20 +00:00
welcome welcome: Theme preview tile (#29689) 2025-04-30 17:46:11 +00:00
workspace debugger: Fix bug where active debug line highlights weren't cleared (#29562) 2025-04-29 15:15:45 +00:00
worktree Fix agent rules files for remote project by loading via buffer (#29440) 2025-04-25 20:06:40 +00:00
zed zed: Fix application menu capitalization (#29722) 2025-05-01 08:19:02 +00:00
zed_actions Rename "Prompt Library" to "Rules Library" (#29349) 2025-04-24 16:42:06 -03:00
zeta Use u64 instead of usize in ElementId (#29493) 2025-04-27 02:31:25 +00:00
zlog zlog: Fix incorrect assumption with filters (#29428) 2025-04-25 16:11:58 +00:00
zlog_settings VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00