Use rust-analyzer's flycheck as source of cargo diagnostics (#29779)

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

Instead of doing `cargo check` manually, use rust-analyzer's flycheck:
at the cost of more sophisticated check command configuration, we keep
much less code in Zed, and get a proper progress report.

User-facing UI does not change except `diagnostics_fetch_command` and
`env` settings removed from the diagnostics settings.

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-05-02 10:07:51 +03:00 committed by GitHub
parent 672a1dd553
commit ba59305510
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 520 additions and 1071 deletions

View file

@ -706,7 +706,7 @@ message LspResponse {
message LanguageServerIdForName {
uint64 project_id = 1;
optional uint64 buffer_id = 2;
uint64 buffer_id = 2;
string name = 3;
}
@ -728,3 +728,22 @@ message LspRunnable {
bytes task_template = 1;
optional LocationLink location = 2;
}
message LspExtCancelFlycheck {
uint64 project_id = 1;
uint64 buffer_id = 2;
uint64 language_server_id = 3;
}
message LspExtRunFlycheck {
uint64 project_id = 1;
uint64 buffer_id = 2;
uint64 language_server_id = 3;
bool current_file_only = 4;
}
message LspExtClearFlycheck {
uint64 project_id = 1;
uint64 buffer_id = 2;
uint64 language_server_id = 3;
}

View file

@ -381,7 +381,10 @@ message Envelope {
DebugRequest debug_request = 342;
LspExtGoToParentModule lsp_ext_go_to_parent_module = 343;
LspExtGoToParentModuleResponse lsp_ext_go_to_parent_module_response = 344;// current max
LspExtGoToParentModuleResponse lsp_ext_go_to_parent_module_response = 344;
LspExtCancelFlycheck lsp_ext_cancel_flycheck = 345;
LspExtRunFlycheck lsp_ext_run_flycheck = 346;
LspExtClearFlycheck lsp_ext_clear_flycheck = 347; // current max
}
reserved 87 to 88;

View file

@ -171,6 +171,9 @@ messages!(
(LspExtSwitchSourceHeaderResponse, Background),
(LspExtGoToParentModule, Background),
(LspExtGoToParentModuleResponse, Background),
(LspExtCancelFlycheck, Background),
(LspExtRunFlycheck, Background),
(LspExtClearFlycheck, Background),
(MarkNotificationRead, Foreground),
(MoveChannel, Foreground),
(MultiLspQuery, Background),
@ -425,6 +428,9 @@ request_messages!(
(SynchronizeContexts, SynchronizeContextsResponse),
(LspExtSwitchSourceHeader, LspExtSwitchSourceHeaderResponse),
(LspExtGoToParentModule, LspExtGoToParentModuleResponse),
(LspExtCancelFlycheck, Ack),
(LspExtRunFlycheck, Ack),
(LspExtClearFlycheck, Ack),
(AddWorktree, AddWorktreeResponse),
(ShutdownRemoteServer, Ack),
(RemoveWorktree, Ack),
@ -548,6 +554,9 @@ entity_messages!(
SynchronizeContexts,
LspExtSwitchSourceHeader,
LspExtGoToParentModule,
LspExtCancelFlycheck,
LspExtRunFlycheck,
LspExtClearFlycheck,
LanguageServerLog,
Toast,
HideToast,