Skip to content

fix: the TypeScript Language Server template installs TypeScript 6, as TypeScript 7 has no tsserver - #2345

Merged
lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/typescript-template-typescript6
Nov 28, 2026
Merged

lagergren merged 1 commit into
redhat-developer:mainfrom
lagergren:fix/typescript-template-typescript6

Conversation

@lagergren

@lagergren lagergren commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

The TypeScript Language Server template installs typescript@6. This is for 0.30.2, since the template has been broken for every new install since 2026-07-08.

Behaviour change

Commit Change
fix: the TypeScript Language Server template installs TypeScript 6, as TypeScript 7 has no tsserver The installer ran npm install typescript-language-server typescript --force, and npm's default typescript has been 7.x since 2026-07-08. TypeScript 7 has no tsserver, which typescript-language-server needs (typescript-language-server#1110). So a server installed from the template failed its initialize with "Could not find a valid TypeScript installation … Exiting." The installer now runs npm install typescript-language-server typescript@6 --force.

The docs page says why. It also says how to fix a server created from the template before: such a server keeps its own copy of the installer, so it keeps installing TypeScript 7.

Checked

On macOS arm64, in a folder laid out as $USER_HOME$/.lsp4ij/lsp/typescript-language-server/node_modules, which is where the installer runs:

  • Before: the template's command installed typescript-language-server 6.1.0 with TypeScript 7.0.2. Its node_modules/typescript has only tsc, and the server answered initialize with the error above. In a test IDE, through LSP4IJ, the server stopped without a single semantic token.
  • After: the new command installs TypeScript 6.0.3. The server answers initialize and a textDocument/semanticTokens/full request, and in a test IDE it gave 33 semantic tokens for a sample file.

Tests

  • TypeScriptLanguageServerTemplateTest: checks that the installer's command installs typescript@6 on every OS. It fails on main.
  • Full suite: passes on macOS with IC 2024.2: 2,653 tests, 0 failures, 0 errors, 7 skipped.

Not in this PR

A template for TypeScript 7 itself, whose native compiler has no tsserver.

…s TypeScript 7 has no tsserver

The installer ran npm install typescript-language-server typescript, and
npm's default TypeScript has been TypeScript 7 since July 2026. It has no
tsserver, which typescript-language-server needs
(typescript-language-server#1110), so a server installed from the template
failed to start with "Could not find a valid TypeScript installation". The
installer now installs typescript@6. The docs page says why, and how to fix
a server created from the template before, which keeps its own installer.
@lagergren lagergren added this to the 0.30.3 milestone Nov 28, 2026
@lagergren lagergren added bug Something isn't working template-ls install labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • The TypeScript language server installer now installs TypeScript 6, helping prevent startup failures caused by incompatible TypeScript versions.
  • Documentation
    • Updated installation guidance with TypeScript 6 instructions and steps to address servers created with earlier installer versions.

The TypeScript language server installer and installation instructions now specify TypeScript 6. A test checks that every OS-specific installer command includes this version.

Changes: TypeScript language server installation

Layer / File(s) Summary
Pin TypeScript 6 and document installation
src/main/resources/templates/lsp/typescript-language-server/installer.json, docs/user-defined-ls/typescript-language-server.md, src/test/java/com/redhat/devtools/lsp4ij/launching/templates/TypeScriptLanguageServerTemplateTest.java
The installer and documented commands specify TypeScript 6. The documentation describes the tsserver requirement and provides steps for existing installations that fail to start. The test checks that the installer resource exists and that each OS-specific command installs TypeScript 6.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: angelozerr

Merge Risk: Minimal · up to dc350

This change pins the TypeScript Language Server template to TypeScript 6 so new installs avoid TypeScript 7, which has no tsserver. The docs and a test cover the change. No merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: the TypeScript Language Server template now installs TypeScript 6 because TypeScript 7 has no tsserver. The raw summary, objectives, and description all describe the …
Description check Passed The description explains the change in detail. It covers the installer command change from unpinned typescript to typescript@6, the cause (npm default TypeScript 7 lacks tsserver), the manual verifica…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: the TypeScript Language Server template now installs TypeScript 6 because TypeScript 7 has no tsserver. The raw summary, objectives, and description all describe the installer change to typescript@6, the docs update, and the new test. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description explains the change in detail. It covers the installer command change from unpinned typescript to typescript@6, the cause (npm default TypeScript 7 lacks tsserver), the manual verification on macOS, the new test, and the full test suite result. It matches the changeset.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c9abf9b-5eab-44a3-b164-8c1c410c1d6a
Commits

Reviewing files that changed from the base of the PR and between 7c6d061 and dc350a9.

Files selected for processing: 3

  • docs/user-defined-ls/typescript-language-server.md
  • src/main/resources/templates/lsp/typescript-language-server/installer.json
  • src/test/java/com/redhat/devtools/lsp4ij/launching/templates/TypeScriptLanguageServerTemplateTest.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@lagergren lagergren modified the milestones: 0.30.3, 0.30.2 Nov 28, 2026
@codecov

codecov Bot commented Nov 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.65%. Comparing base (7c6d061) to head (dc350a9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2345   +/-   ##
=======================================
  Coverage   58.64%   58.65%           
=======================================
  Files         849      849           
  Lines       36719    36719           
  Branches     7609     7609           
=======================================
+ Hits        21535    21536    +1     
- Misses      12186    12189    +3     
+ Partials     2998     2994    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lagergren

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lagergren
lagergren merged commit 0665956 into redhat-developer:main Nov 28, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working install template-ls

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant