Support js/ts.workspaceSymbols.scope and extra textDocument param on workspace/symbol request - #4805
Open
jakebailey wants to merge 2 commits into
Open
Support js/ts.workspaceSymbols.scope and extra textDocument param on workspace/symbol request#4805jakebailey wants to merge 2 commits into
jakebailey wants to merge 2 commits into
Conversation
…workspace/symbol request
Contributor
There was a problem hiding this comment.
Pull request overview
Adds configurable workspace-symbol scoping to match the classic TypeScript service behavior.
Changes:
- Adds
textDocumentcontext to workspace symbol requests. - Supports
allOpenProjectsandcurrentProjectscopes. - Adds server tests, preference parsing, and extension middleware.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
testdata/baselines/reference/fourslash/state/codeLensAcrossProjects.baseline |
Updates default preference baseline. |
internal/project/session.go |
Adds document-scoped snapshot access. |
internal/lsp/server.go |
Selects projects according to symbol scope. |
internal/lsp/server_workspace_symbol_test.go |
Tests both scope modes. |
internal/lsp/lsproto/lsp_generated.go |
Adds the optional document parameter. |
internal/lsp/lsproto/_generate/generate.mts |
Generates the protocol extension. |
internal/ls/lsutil/userpreferences.go |
Defines and defaults the scope preference. |
internal/ls/lsutil/userpreferences_test.go |
Tests preference parsing. |
_extension/src/workspaceSymbolMiddleware.ts |
Adds document context to requests. |
_extension/src/client.ts |
Registers the request middleware. |
Files not reviewed (1)
- internal/lsp/lsproto/lsp_generated.go: Generated file
Suppressed comments (1)
_extension/src/workspaceSymbolMiddleware.ts:16
- The fallback has the same selector mismatch: it may choose a TypeScript notebook/custom-scheme document that this client never sent to the server, causing
currentProjectsearches to target an unrelated or empty project. Filter fallback documents to the client’sfile/untitledschemes.
document => isSupportedLanguageMode(document) && !disabledSchemes.has(document.uri.scheme),
gabritto
reviewed
Jul 31, 2026
gabritto
approved these changes
Jul 31, 2026
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.
Fixes #4802
Strada allowed workspace symbol requests to include the current doc, then optionally filter the workspace symbol request to just the projects the current doc is a part of. Add that back. VS Code defaults this to
allOpenProjects, so this is a noop for anyone who hasn't opted into the filtering.This is the second LSP extension we've slapped onto an incoming request (expandible hover before this). Starting to wish we had named these extra props with an
_prefix or something like_vs_does.