fix(lsp): support typescript-language-server v5#21788
Open
chriswritescode-dev wants to merge 4 commits intoanomalyco:devfrom
Open
fix(lsp): support typescript-language-server v5#21788chriswritescode-dev wants to merge 4 commits intoanomalyco:devfrom
chriswritescode-dev wants to merge 4 commits intoanomalyco:devfrom
Conversation
typescript-language-server v5 removed --tsserver-path, --tsserver-log-verbosity, and --ignore-node-modules CLI flags. Since Npm.which installs the latest version (v5.1.3), the server exits immediately with "unknown option" and the LSP client times out after 45s waiting for the initialize response. Pass tsserver path and log verbosity via initialization options instead, which is the supported approach in v5.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
- Assert spawn argv is exactly ['--stdio'] instead of deprecated CLI flags - Validate initialization payload contains tsserver.path and logVerbosity - Remove --ignore-node-modules assertion (no implementation exists) - Add Npm.which mock to prevent actual npm installs during tests The implementation in src/lsp/server.ts:109-123 already uses the v5 contract with --stdio only and initializationOptions for configuration.
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.
Issue for this PR
Closes #21791
Type of change
What does this PR do?
This updates the TypeScript LSP launcher to work with
typescript-language-serverv5. The old--tsserver-pathand--tsserver-log-verbosityCLI flags are no longer accepted by v5, so this change removes those deprecated arguments and passes the tsserver path and log verbosity through the LSP initialization payload instead.How did you verify your code works?
I checked the installed
typescript-language-serverv5 CLI help output to confirm the deprecated flags are no longer supported, then verified the branch passes the repo's pre-push typecheck and successfully pushed it.Screenshots / recordings
Not applicable. This is not a UI change.
Checklist