Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0483937
Add configurable LSP timeout setting
Bertie690 Dec 12, 2025
fbe8a11
Merge branch 'main' into lsp-timeout
Bertie690 Dec 12, 2025
3226c27
removed accidental circ dep from Cargo.toml
Bertie690 Dec 12, 2025
8784961
ran preettier again
Bertie690 Dec 12, 2025
837f70d
proceeds to scream in pain
Bertie690 Dec 13, 2025
25e7457
screams some more
Bertie690 Dec 13, 2025
648d1ed
maybe fixed tests???
Bertie690 Dec 13, 2025
23d8f6c
updated other site of conditional compilation
Bertie690 Dec 13, 2025
53c41d9
fix unused import i think
Bertie690 Dec 13, 2025
e427445
fix 0.5
Bertie690 Jan 7, 2026
806df27
Have LSP store query for project settings
Bertie690 Jan 7, 2026
71cea9d
ran cargo fmt
Bertie690 Jan 8, 2026
9e099ce
Fix typos, avoid unwrapping 0 durations into defaults
Bertie690 Jan 10, 2026
77f3d6b
Merge branch 'main' into lsp-timeout
Bertie690 Jan 11, 2026
15300a0
fix?
Bertie690 Jan 11, 2026
69d6c41
run formatting
Bertie690 Jan 11, 2026
b677d3c
Merge branch 'main' into lsp-timeout
Bertie690 Jan 14, 2026
a04c0ab
batch apply
Bertie690 Jan 16, 2026
8a7d15f
add approximately every single LSP timeout under the sun
Bertie690 Jan 18, 2026
85f95e5
Merge remote-tracking branch 'upstream/main' into lsp-timeout
Bertie690 Jan 18, 2026
1a9d61f
ran cargo format
Bertie690 Jan 18, 2026
97379db
fix typos
Bertie690 Jan 19, 2026
385f9c3
added test
Bertie690 Jan 19, 2026
ebd45dc
Fix the tests
SomeoneToIgnore Jan 20, 2026
b675b9e
Merge branch 'main' into lsp-timeout
SomeoneToIgnore Jan 20, 2026
00280bc
Do not test the obvious
SomeoneToIgnore Jan 20, 2026
613967a
Fix a test
SomeoneToIgnore Jan 20, 2026
6435042
Clean up timeout and shutdown server code paths
SomeoneToIgnore Jan 21, 2026
1ba48b6
Fix the test
SomeoneToIgnore Jan 22, 2026
560df49
Merge branch 'main' into lsp-timeout
SomeoneToIgnore Feb 6, 2026
e27b314
Post-merge fixes
SomeoneToIgnore Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions assets/settings/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2230,6 +2230,11 @@
"global_lsp_settings": {
Comment thread
Bertie690 marked this conversation as resolved.
// Whether to show the LSP servers button in the status bar.
"button": true,
// The maximum amount of time to wait for responses from language servers, in seconds.
//
// A value of `0` will result in no timeout being applied (causing all LSP responses to wait
// indefinitely until completed).
"request_timeout": 120,
"notifications": {
// Timeout in milliseconds for automatically dismissing language server notifications.
// Set to 0 to disable auto-dismiss.
Expand Down
18 changes: 9 additions & 9 deletions crates/collab/tests/integration/editor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use gpui::{
};
use indoc::indoc;
use language::{FakeLspAdapter, language_settings::language_settings, rust_lang};
use lsp::LSP_REQUEST_TIMEOUT;
use lsp::DEFAULT_LSP_REQUEST_TIMEOUT;
use multi_buffer::{AnchorRangeExt as _, MultiBufferRow};
use pretty_assertions::assert_eq;
use project::{
Expand Down Expand Up @@ -1255,7 +1255,7 @@ async fn test_slow_lsp_server(cx_a: &mut TestAppContext, cx_b: &mut TestAppConte
cx_a.run_until_parked();
cx_b.run_until_parked();

let long_request_time = LSP_REQUEST_TIMEOUT / 2;
let long_request_time = DEFAULT_LSP_REQUEST_TIMEOUT / 2;
let (request_started_tx, mut request_started_rx) = mpsc::unbounded();
let requests_started = Arc::new(AtomicUsize::new(0));
let requests_completed = Arc::new(AtomicUsize::new(0));
Expand Down Expand Up @@ -1362,8 +1362,8 @@ async fn test_slow_lsp_server(cx_a: &mut TestAppContext, cx_b: &mut TestAppConte
);
assert_eq!(
requests_completed.load(atomic::Ordering::Acquire),
3,
"After enough time, all 3 LSP requests should have been served by the language server"
1,
"After enough time, a single, deduplicated, LSP request should have been served by the language server"
);
let resulting_lens_actions = editor_b
.update(cx_b, |editor, cx| {
Expand All @@ -1382,7 +1382,7 @@ async fn test_slow_lsp_server(cx_a: &mut TestAppContext, cx_b: &mut TestAppConte
);
assert_eq!(
resulting_lens_actions.first().unwrap().lsp_action.title(),
"LSP Command 3",
"LSP Command 1",
"Only the final code lens action should be in the data"
)
}
Expand Down Expand Up @@ -2164,7 +2164,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(

let after_special_edit_for_refresh = edits_made.fetch_add(1, atomic::Ordering::Release) + 1;
fake_language_server
.request::<lsp::request::InlayHintRefreshRequest>(())
.request::<lsp::request::InlayHintRefreshRequest>((), DEFAULT_LSP_REQUEST_TIMEOUT)
.await
.into_response()
.expect("inlay refresh request failed");
Expand Down Expand Up @@ -2375,7 +2375,7 @@ async fn test_inlay_hint_refresh_is_forwarded(

other_hints.fetch_or(true, atomic::Ordering::Release);
fake_language_server
.request::<lsp::request::InlayHintRefreshRequest>(())
.request::<lsp::request::InlayHintRefreshRequest>((), DEFAULT_LSP_REQUEST_TIMEOUT)
.await
.into_response()
.expect("inlay refresh request failed");
Expand Down Expand Up @@ -3414,7 +3414,7 @@ async fn test_lsp_pull_diagnostics(
}

fake_language_server
.request::<lsp::request::WorkspaceDiagnosticRefresh>(())
.request::<lsp::request::WorkspaceDiagnosticRefresh>((), DEFAULT_LSP_REQUEST_TIMEOUT)
.await
.into_response()
.expect("workspace diagnostics refresh request failed");
Expand Down Expand Up @@ -5185,7 +5185,7 @@ async fn test_semantic_token_refresh_is_forwarded(

other_tokens.fetch_or(true, atomic::Ordering::Release);
fake_language_server
.request::<lsp::request::SemanticTokensRefresh>(())
.request::<lsp::request::SemanticTokensRefresh>((), DEFAULT_LSP_REQUEST_TIMEOUT)
.await
.into_response()
.expect("semantic tokens refresh request failed");
Expand Down
11 changes: 7 additions & 4 deletions crates/collab/tests/integration/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use language::{
language_settings::{Formatter, FormatterList},
rust_lang, tree_sitter_rust, tree_sitter_typescript,
};
use lsp::{LanguageServerId, OneOf};
use lsp::{DEFAULT_LSP_REQUEST_TIMEOUT, LanguageServerId, OneOf};
use parking_lot::Mutex;
use pretty_assertions::assert_eq;
use project::{
Expand Down Expand Up @@ -4358,9 +4358,12 @@ async fn test_collaborating_with_lsp_progress_updates_and_diagnostics_ordering(
let fake_language_server = fake_language_servers.next().await.unwrap();
executor.run_until_parked();
fake_language_server
.request::<lsp::request::WorkDoneProgressCreate>(lsp::WorkDoneProgressCreateParams {
token: lsp::NumberOrString::String("the-disk-based-token".to_string()),
})
.request::<lsp::request::WorkDoneProgressCreate>(
lsp::WorkDoneProgressCreateParams {
token: lsp::NumberOrString::String("the-disk-based-token".to_string()),
},
DEFAULT_LSP_REQUEST_TIMEOUT,
)
.await
.into_response()
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions crates/copilot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ indoc.workspace = true
language = { workspace = true, features = ["test-support"] }
lsp = { workspace = true, features = ["test-support"] }
node_runtime = { workspace = true, features = ["test-support"] }
pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] }
rpc = { workspace = true, features = ["test-support"] }
serde_json.workspace = true
Expand Down
Loading