Skip to content

Add configurable LSP timeout setting#44745

Merged
SomeoneToIgnore merged 31 commits intozed-industries:mainfrom
Bertie690:lsp-timeout
Feb 7, 2026
Merged

Add configurable LSP timeout setting#44745
SomeoneToIgnore merged 31 commits intozed-industries:mainfrom
Bertie690:lsp-timeout

Conversation

@Bertie690
Copy link
Contributor

@Bertie690 Bertie690 commented Dec 12, 2025

Fixes #36818

Release Notes:

  • Added new global_lsp_settings.request_timeout setting to configure the maximum timeout duration for LSP-related operations.

Code inspired by prior implementation, though with a few tweaks here & there (like using serde:default and keeping the pre-defined constant in the LSP file).

Fixes zed-industries#36818

(IDK how to configure the schema so yeah)
@cla-bot
Copy link

cla-bot bot commented Dec 12, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @Bertie690 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link

cla-bot bot commented Dec 12, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @Bertie690 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@Bertie690
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 12, 2025
@cla-bot
Copy link

cla-bot bot commented Dec 12, 2025

The cla-bot has been summoned, and re-checked this pull request!

@Bertie690 Bertie690 marked this pull request as draft December 12, 2025 23:24
@Bertie690 Bertie690 marked this pull request as ready for review December 21, 2025 22:25
@Bertie690
Copy link
Contributor Author

Bertie690 commented Dec 21, 2025

NB: The code has worked since last week - i just hadn't the chance to verify it worked until now.

VERIFICATION SCREENSHOTS:

  1. Setting shows up inside proper location inside settings.json
image
  1. Setting custom timeout works correctly and affects all LSP actions - I set it to 1s and got this wonderful series of responses from vtsls. (And yes, my computer is fast enough to not make these timeout normally)
image

@SomeoneToIgnore SomeoneToIgnore self-assigned this Jan 5, 2026
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, this looks quite good overall.

One confusing point for me are the remote requests: using a hardcoded default timeout there seems odd?
Maybe I miss some context there, as not sure at all what has to be done there.

@Bertie690
Copy link
Contributor Author

okee... i have literally zero idea why a singular terminal test would fail exclusively on Mac.

@Bertie690
Copy link
Contributor Author

get_request_timeout could be just request_timeout to match the general style

@SomeoneToIgnore My only fear is that the (numeric) property on GlobalLspSettings is also named request_timeout - I want to keep the distinction of "Duration vs number" as clear as possible.

Any thoughts?

@SomeoneToIgnore
Copy link
Contributor

I think we only care about the field when we [de]serialize, and .foo and .foo() are quite distinct enough.
Not insisting on this one though, anything in the rest of the list is more important.

@Bertie690
Copy link
Contributor Author

Bertie690 commented Jan 18, 2026

1 is done, 3 I have written (and am attempting to run on my potato lol)

i doubt we will execute the code in question >=1ns
@Bertie690
Copy link
Contributor Author

@SomeoneToIgnore Test has been written.

Judging by how long it took my laptop to compile the last batch of code, I'mma just use github actions to check the results lol

@SomeoneToIgnore
Copy link
Contributor

I have updated the test to actually test something useful, and it starts to show that we never drop the timed out LSP requests, rather always polling the server.

This is wrong, and I have not gotten to the bottom of it yet: meanwhile, I have fixed 2 lsp_query_task.detach()-eque calls that should be tasks instead.

@Bertie690
Copy link
Contributor Author

Thanks for helping - I've fallen ill as of late and have struggled to find the time/wherewithal to fix the remaining edge cases.

# Conflicts:
#	assets/settings/default.json
#	crates/collab/tests/integration/editor_tests.rs
#	crates/copilot/src/copilot.rs
#	crates/copilot_ui/src/sign_in.rs
#	crates/editor/src/editor_tests.rs
#	crates/lsp/src/lsp.rs
#	crates/project/src/lsp_store.rs
#	crates/project/src/project_settings.rs
#	crates/project/tests/integration/project_tests.rs
#	crates/settings_content/src/project.rs
#	docs/src/configuring-zed.md
@SomeoneToIgnore SomeoneToIgnore force-pushed the lsp-timeout branch 3 times, most recently from 4bb7137 to ae5a022 Compare February 6, 2026 23:36
@SomeoneToIgnore SomeoneToIgnore merged commit db53a65 into zed-industries:main Feb 7, 2026
27 checks passed
baldwindavid added a commit to baldwindavid/zed that referenced this pull request Feb 9, 2026
* main: (57 commits)
  agent: Fix disabled MCP servers disappearing from UI after restart (zed-industries#47758)
  Update Rust crate git2 to v0.20.4 [SECURITY] (zed-industries#48400)
  Update Rust crate time to v0.3.47 [SECURITY] (zed-industries#48514)
  gpui: Reset `external_files_dragged` after successful drag-drop on macOS (zed-industries#48727)
  language: Return early if no grammars are added (zed-industries#48685)
  Properly handle multi-char folds (zed-industries#48721)
  collab: Proxy `GET /extensions` to Cloud (zed-industries#48717)
  git: Fix a potential misalignment in the side-by-side diff (zed-industries#48690)
  Move extension API DTOs into `cloud_api_types` (zed-industries#48689)
  git: Add a setting for the default view mode of `SplittableEditor` (zed-industries#48440)
  Use proper settings name for semantic tokens' settings UI (zed-industries#48686)
  gpui: Fix restarting panicking due to double borrows on windows (zed-industries#48667)
  Strip broken thinking blocks from Anthropic requests (zed-industries#48548)
  keymap_editor: Add `alt-l` keybinding for cycling favorite models (zed-industries#48390)
  Only raise Windows timer resolution while blocking with timeout (zed-industries#48379)
  editor: Propagate `buffer_font_features` to signatureHelp popover (zed-industries#48653)
  Add configurable LSP timeout setting (zed-industries#44745)
  editor: Use buffer_font for folds and change foreground color (zed-industries#48652)
  lsp: Update root_path for compatibility with language servers (zed-industries#48587)
  Fix panic with LSP folds on disappearing excerpts (zed-industries#48649)
  ...
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- LSP folding ranges support (zed-industries#48611) - textDocument/foldingRange with custom fold text
- LSP refactoring (zed-industries#48604) - extracted document_colors, code_lens, folding_ranges into modules
- Crate graph restructuring (zed-industries#48602) - terminal moved closer to editor
- Side-by-side diff searching (zed-industries#48539) and OpenExcerpts for LHS (zed-industries#48438)
- SplittableEditor: sync custom blocks between RHS/LHS (zed-industries#48575)
- Thinking effort for Zed/OpenAI providers (zed-industries#48545, zed-industries#48605)
- Agent default_model.enable_thinking setting (zed-industries#48536)
- Configurable LSP timeout setting (zed-industries#44745)
- PaneSearchBarCallbacks global (search bar setup extracted from vim)
- Settings migrations for nested platform/channel/profile keys (zed-industries#48550)
- Shell parser: I/O redirects, here-documents, compound commands (zed-industries#48635)
- Hardened tool authorization: sensitive settings, deferred ops (zed-industries#48641)
- rm security bypass fixes (zed-industries#48640, zed-industries#48647)
- MCP tool name parsing fix: newline delimiter (zed-industries#48636)
- Canonicalize --user-data-dir path (zed-industries#48470)
- Fix text_threads_dir XDG spec compliance (zed-industries#45771)
- Buffer font for folds (zed-industries#48652)
- Multibuffer toolbar layout shift fix (zed-industries#48472)
- Editor: tabs bitmask syncing (zed-industries#48366)

Conflict resolution:
- collab tests: deleted (collab removed)
- util/archive.rs, util/shell.rs: deleted (extracted to Obsydian)
- copilot_ui/sign_in.rs: kept native_button style
- editor_tests.rs: merged imports (kept MoveItemToPaneInDirection, added ViewId/FollowEvent)
- lsp_store.rs: took upstream refactored imports, added FoldingRangeData, removed collab imports
- main.rs: added PaneSearchBarCallbacks, removed vim::init

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable LSP initialization timeout (currently 120secs)

2 participants