Added maxResults argument to provideWorkspaceSymbols #193524
Open
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.
With Reference to Issue #191725
JS/TS's workspace symbol provider currently limits the number of workspace symbols it returns to 256. This is done for performance reasons. In large repos, it is costly to collect and transmit tens of thousands of workspace symbols, especially when you consider that users typically only look at the first 10 or so
However there are cases where you really do want every single workspace symbol in a workspace, for example when an extension uses the
vscode.executeWorkspaceSymbolProvider
command. Today there is no way for an extension to get all JS/TS symbols as the VS Code api dose not provide a way to override TS Server's limit of 256 symbols per responseProposal
Add a new
maxResults
argument toprovideWorkspaceSymbols
. This would have two benefits:In the normal go to symbol in workspace flow, we could set
maxResults = 500
or some other number. This would let extensions that observe this new argument improve their performance by not collecting and transmitting tons and tons of symbolsWith the
vscode.executeWorkspaceSymbolProvider
command or other cases where something else besides VS Code is calling intoprovideWorkspaceSymbols,
we provide a mechanism to explicitly request every single workspace symbol instead of leaving it up to language servers to determine how many symbols they should return for good performance