Stop waiting for part of LSP responses on remote Collab clients' part (#36557)
Instead of holding a connection for potentially long LSP queries (e.g. rust-analyzer might take minutes to look up a definition), disconnect right after sending the initial request and handle the follow-up responses later. As a bonus, this allows to cancel previously sent request on the local Collab clients' side due to this, as instead of holding and serving the old connection, local clients now can stop previous requests, if needed. Current PR does not convert all LSP requests to the new paradigm, but the problematic ones, deprecating `MultiLspQuery` and moving all its requests to the new paradigm. Release Notes: - Improved resource usage when querying LSP over Collab --------- Co-authored-by: David Kleingeld <git@davidsk.dev> Co-authored-by: Mikayla Maki <mikayla@zed.dev> Co-authored-by: David Kleingeld <davidsk@zed.dev>
This commit is contained in:
parent
c731bb6d91
commit
5dcb90858e
20 changed files with 1395 additions and 681 deletions
|
@ -3005,6 +3005,7 @@ async fn test_definition(cx: &mut gpui::TestAppContext) {
|
|||
let mut definitions = project
|
||||
.update(cx, |project, cx| project.definitions(&buffer, 22, cx))
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
// Assert no new language server started
|
||||
|
@ -3519,7 +3520,7 @@ async fn test_apply_code_actions_with_commands(cx: &mut gpui::TestAppContext) {
|
|||
.next()
|
||||
.await;
|
||||
|
||||
let action = actions.await.unwrap()[0].clone();
|
||||
let action = actions.await.unwrap().unwrap()[0].clone();
|
||||
let apply = project.update(cx, |project, cx| {
|
||||
project.apply_code_action(buffer.clone(), action, true, cx)
|
||||
});
|
||||
|
@ -6110,6 +6111,7 @@ async fn test_multiple_language_server_hovers(cx: &mut gpui::TestAppContext) {
|
|||
hover_task
|
||||
.await
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.map(|hover| hover.contents.iter().map(|block| &block.text).join("|"))
|
||||
.sorted()
|
||||
.collect::<Vec<_>>(),
|
||||
|
@ -6183,6 +6185,7 @@ async fn test_hovers_with_empty_parts(cx: &mut gpui::TestAppContext) {
|
|||
hover_task
|
||||
.await
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.map(|hover| hover.contents.iter().map(|block| &block.text).join("|"))
|
||||
.sorted()
|
||||
.collect::<Vec<_>>(),
|
||||
|
@ -6261,7 +6264,7 @@ async fn test_code_actions_only_kinds(cx: &mut gpui::TestAppContext) {
|
|||
.await
|
||||
.expect("The code action request should have been triggered");
|
||||
|
||||
let code_actions = code_actions_task.await.unwrap();
|
||||
let code_actions = code_actions_task.await.unwrap().unwrap();
|
||||
assert_eq!(code_actions.len(), 1);
|
||||
assert_eq!(
|
||||
code_actions[0].lsp_action.action_kind(),
|
||||
|
@ -6420,6 +6423,7 @@ async fn test_multiple_language_server_actions(cx: &mut gpui::TestAppContext) {
|
|||
code_actions_task
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.into_iter()
|
||||
.map(|code_action| code_action.lsp_action.title().to_owned())
|
||||
.sorted()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue