Skip to content

fix(lsp): support typescript-language-server v5#21788

Open
chriswritescode-dev wants to merge 4 commits intoanomalyco:devfrom
chriswritescode-dev:fix/lsp-typescript-v5-compat
Open

fix(lsp): support typescript-language-server v5#21788
chriswritescode-dev wants to merge 4 commits intoanomalyco:devfrom
chriswritescode-dev:fix/lsp-typescript-v5-compat

Conversation

@chriswritescode-dev
Copy link
Copy Markdown

@chriswritescode-dev chriswritescode-dev commented Apr 10, 2026

Issue for this PR

Closes #21791

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This updates the TypeScript LSP launcher to work with typescript-language-server v5. The old --tsserver-path and --tsserver-log-verbosity CLI 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-server v5 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Hona and others added 3 commits April 10, 2026 10:00
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.
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 10, 2026
@github-actions
Copy link
Copy Markdown
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript LSP fails with typescript-language-server v5 deprecated CLI flags

2 participants