Skip to content

fix(claude-code): replace typescript-lsp with typescript-native-lsp (#194) - #195

Merged
gatezh merged 1 commit into
masterfrom
fix/194-typescript-native-lsp
Oct 6, 2026
Merged

gatezh merged 1 commit into
masterfrom
fix/194-typescript-native-lsp

Conversation

@gatezh

@gatezh gatezh commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Closes #194

Why

The template installs typescript-lsp@claude-plugins-official, which runs typescript-language-server on top of tsserver. TypeScript 7 ships no tsserver.js, so on a TS 7 project every LSP request fails and Claude gets no type errors after edits, no go-to-definition and no find-references. Nothing upstream is scheduled to fix it (anthropics/claude-plugins-official#4492 is still open and unassigned).

What changed

claude-code/.devcontainer/init-plugins.sh

  • Registers the rubberduck-studio/typescript-native-lsp marketplace.
  • Replaces typescript-lsp@claude-plugins-official with typescript-native-lsp@typescript-native-lsp. It runs tsc --lsp on TS 7+ and falls back to typescript-language-server on TS 6 and older.
  • Adds a DISABLED_PLUGINS list. When two plugins claim .ts, Claude Code starts only the one that registers first. Because ~/.claude is a persistent volume, existing containers still have the official plugin installed, so the script disables it if claude plugin list --json shows it as enabled. Fresh containers never install it, so for them this step does nothing. The guard is needed because claude plugin disable exits 1 on a plugin that is already disabled or missing, and that would trip set -e.

claude-code/README.md: updates the bundled-plugins table and the marketplace count, and adds a note on why the official plugin was replaced and when to switch back.

Verification

  • bash -n and shellcheck (koalaman/shellcheck:stable) pass on init-plugins.sh.
  • Ran the jq guard against real claude plugin list --json output from Claude Code 2.1.291, plus synthetic cases. It matches an enabled plugin, and does not match a disabled plugin, a missing plugin or an empty list.
  • Checked the plugin manifests: the marketplace name is typescript-native-lsp, so the id is typescript-native-lsp@typescript-native-lsp. Its requirement of Node ≥ 22.22 is met by the node:24 base.
  • Not yet tested end to end in a rebuilt container.

Caveats

…194)

The official typescript-lsp plugin wraps tsserver, which TypeScript 7 no
longer ships, so it fails every request on TS 7 projects. Install
rubberduck-studio/typescript-native-lsp instead: it runs `tsc --lsp` on
TS 7+ and falls back to typescript-language-server on TS 6 and older.

Two plugins claiming .ts can't coexist, and the persistent ~/.claude
volume keeps the old plugin installed, so init-plugins.sh now disables
typescript-lsp when it's still enabled.

Closes #194
@gatezh
gatezh force-pushed the fix/194-typescript-native-lsp branch from 5d1bcee to ed73c0b Compare October 6, 2026 19:37
@gatezh
gatezh merged commit 9a51994 into master Oct 6, 2026
11 checks passed
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.

claude-code template: replace typescript-lsp with typescript-native-lsp — the official plugin fails on TypeScript 7 projects

1 participant