Add editor::GoToParentModule for rust-analyzer backed projects (#29755)

Support rust-analyzer's "go to parent module" action


https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#parent-module

Release Notes:

- Added `editor::GoToParentModule` for rust-analyzer backed projects

---------

Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com>
This commit is contained in:
Kirill Bulatov 2025-05-01 21:28:05 +03:00 committed by GitHub
parent 50ec26c163
commit 2a319efade
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 276 additions and 64 deletions

View file

@ -182,6 +182,16 @@ message LspExtSwitchSourceHeaderResponse {
string target_file = 1;
}
message LspExtGoToParentModule {
uint64 project_id = 1;
uint64 buffer_id = 2;
Anchor position = 3;
}
message LspExtGoToParentModuleResponse {
repeated LocationLink links = 1;
}
message GetCompletionsResponse {
repeated Completion completions = 1;
repeated VectorClockEntry version = 2;

View file

@ -378,7 +378,10 @@ message Envelope {
GetDebugAdapterBinary get_debug_adapter_binary = 339;
DebugAdapterBinary debug_adapter_binary = 340;
RunDebugLocators run_debug_locators = 341;
DebugRequest debug_request = 342; // current max
DebugRequest debug_request = 342;
LspExtGoToParentModule lsp_ext_go_to_parent_module = 343;
LspExtGoToParentModuleResponse lsp_ext_go_to_parent_module_response = 344;// current max
}
reserved 87 to 88;

View file

@ -169,6 +169,8 @@ messages!(
(LspExtRunnablesResponse, Background),
(LspExtSwitchSourceHeader, Background),
(LspExtSwitchSourceHeaderResponse, Background),
(LspExtGoToParentModule, Background),
(LspExtGoToParentModuleResponse, Background),
(MarkNotificationRead, Foreground),
(MoveChannel, Foreground),
(MultiLspQuery, Background),
@ -422,6 +424,7 @@ request_messages!(
(CreateContext, CreateContextResponse),
(SynchronizeContexts, SynchronizeContextsResponse),
(LspExtSwitchSourceHeader, LspExtSwitchSourceHeaderResponse),
(LspExtGoToParentModule, LspExtGoToParentModuleResponse),
(AddWorktree, AddWorktreeResponse),
(ShutdownRemoteServer, Ack),
(RemoveWorktree, Ack),
@ -544,6 +547,7 @@ entity_messages!(
UpdateContext,
SynchronizeContexts,
LspExtSwitchSourceHeader,
LspExtGoToParentModule,
LanguageServerLog,
Toast,
HideToast,