lsp: Update root_path for compatibility with language servers#48587
Merged
SomeoneToIgnore merged 3 commits intozed-industries:mainfrom Feb 6, 2026
Merged
lsp: Update root_path for compatibility with language servers#48587SomeoneToIgnore merged 3 commits intozed-industries:mainfrom
SomeoneToIgnore merged 3 commits intozed-industries:mainfrom
Conversation
Contributor
|
Looks like we need to annotate the test with warning suppressions or remove the test. |
auto-merge was automatically disabled
February 6, 2026 22:07
Head branch was pushed to by a user without write access
Contributor
Author
I've added |
Contributor
Author
|
Fixed the failing fmt (extra new line). |
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) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the deprecated
rootPathfield in the LSPInitializeParamsfor backwards compatibility with language servers that still rely on this field.Issue
Some language servers (notably the Salesforce Apex Language Server) only read from the deprecated
rootPathfield in the LSP initialize request and do not userootUriorworkspaceFolders.When Zed sends
root_path: None, these language servers fail to initialize because they cannot determine the workspace root.Example error from the Apex Language Server:
The Apex LSP's initialize handler does:
VSCode's LanguageClient sends both
rootPathandrootUrifor backwards compatibility:https://github.com/microsoft/vscode-languageserver-node/blob/main/client/src/common/client.ts#L1434
Fix
Derive
rootPathfrom the existingroot_urifield when building the initialize params. The LSP spec states that if bothrootPathandrootUriare provided,rootUriwins, so this change should be backwards compatible and won't affect language servers that properly userootUri(1).(1) LSP Specification - InitializeParams - notes that
rootPathis deprecated in favor ofworkspaceFolders, but for backwards compatibility it should still be provided when possible.Release Notes: