Query code actions and hovers from all related local language servers (from remote clients) (#10111)

Supersedes https://github.com/zed-industries/zed/pull/8634
Fixes https://github.com/zed-industries/zed/issues/7947 by continuing
https://github.com/zed-industries/zed/pull/9943 with the remote part.

Now, clients are able to issue collab requests, that query all related
language servers, not only the primary one.
Such mode is enabled for GetHover and GetCodeActions LSP requests only.

Release Notes:

- Added Tailwind CSS hover popovers for Zed in multi player mode
([7947](https://github.com/zed-industries/zed/issues/7947))
This commit is contained in:
Kirill Bulatov 2024-04-03 12:34:56 +02:00 committed by GitHub
parent 3a0d3cee87
commit 9aad30a559
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 501 additions and 164 deletions

View file

@ -209,8 +209,11 @@ message Envelope {
BlameBuffer blame_buffer = 172;
BlameBufferResponse blame_buffer_response = 173;
UpdateNotification update_notification = 174; // current max
UpdateNotification update_notification = 174;
MultiLspQuery multi_lsp_query = 175;
MultiLspQueryResponse multi_lsp_query_response = 176; // current max
}
reserved 158 to 161;
@ -1838,3 +1841,29 @@ message BlameBufferResponse {
repeated CommitMessage messages = 2;
repeated CommitPermalink permalinks = 3;
}
message MultiLspQuery {
uint64 project_id = 1;
uint64 buffer_id = 2;
repeated VectorClockEntry version = 3;
oneof strategy {
AllLanguageServers all = 4;
}
oneof request {
GetHover get_hover = 5;
GetCodeActions get_code_actions = 6;
}
}
message AllLanguageServers {}
message MultiLspQueryResponse {
repeated LspResponse responses = 1;
}
message LspResponse {
oneof response {
GetHoverResponse get_hover_response = 1;
GetCodeActionsResponse get_code_actions_response = 2;
}
}

View file

@ -299,6 +299,8 @@ messages!(
(SetRoomParticipantRole, Foreground),
(BlameBuffer, Foreground),
(BlameBufferResponse, Foreground),
(MultiLspQuery, Background),
(MultiLspQueryResponse, Background),
);
request_messages!(
@ -390,6 +392,7 @@ request_messages!(
(LspExtExpandMacro, LspExtExpandMacroResponse),
(SetRoomParticipantRole, Ack),
(BlameBuffer, BlameBufferResponse),
(MultiLspQuery, MultiLspQueryResponse),
);
entity_messages!(
@ -418,6 +421,7 @@ entity_messages!(
InlayHints,
JoinProject,
LeaveProject,
MultiLspQuery,
OnTypeFormatting,
OpenBufferById,
OpenBufferByPath,