Support TypeScript 7 content-mapper projects - #4
Merged
NullVoxPopuli merged 1 commit intoAug 23, 2026
Merged
Conversation
When the nearest tsconfig.json declares contentMappers (e.g. ember-content-mapper), attach nvim-lspconfig's tsc (TypeScript 7's native LSP) with runExternalCode enabled and glimmer filetypes mapped to plain typescript/javascript language ids, and keep ts_ls and glint detached: the content mapper transforms gts/gjs for TypeScript itself, so the classic tsserver plugin pipeline would only report bogus syntax errors on <template> tags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Why
So the routing is: |
| -- declare `contentMappers` in tsconfig.json (e.g. ember-content-mapper). | ||
| -- The mapper transforms gts/gjs for TypeScript itself, so ts_ls and glint | ||
| -- both stay detached in these projects (see lsp/utils.lua). | ||
| vim.lsp.config('tsc', { |
Contributor
Author
There was a problem hiding this comment.
This is nvim-lspconfig's config for TypeScript 7's native LSP (tsc --lsp --stdio, resolved from the workspace node_modules/.bin/tsc; tsgo is its deprecated alias). ts_ls can't serve these projects: it wraps tsserver, which doesn't exist in the TS 7 package, so it falls back to a bundled TS 5/6 that neither understands contentMappers nor loads @glint/tsserver-plugin (TS 7 dropped the tsserver plugin system; content mappers are its replacement extension point).
NullVoxPopuli
approved these changes
Aug 23, 2026
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.
When the nearest
tsconfig.jsondeclarescontentMappers(e.g. ember-content-mapper), the classic pipeline is wrong in both directions:ts_ls+@glint/tsserver-pluginonly works against a TS 5/6 tsserver, and in a TS 7 project the plugin is absent, so tsserver parses<template>as plain TS and paints syntax errors over the whole file.This PR detects
"contentMappers"in the nearest tsconfig and, for those projects:tsc(TypeScript 7's native LSP) withinit_options = { runExternalCode = true }, the explicit opt-in TypeScript requires before spawning mapper processes (VS Code sends the same for trusted workspaces)typescript.glimmer/javascript.glimmerfiletypes to plaintypescript/javascriptlanguage ids viaget_language_idts_lsandglintdetachedNon-content-mapper projects are untouched. nvim-lspconfig's
tscconfig resolves the workspacenode_modules/.bin/tscfrom the root we pass it, so the project's own TypeScript 7 nightly is used.Verified against ember-content-mapper's example apps: only
tscattaches, a cleanapplication.gtshas zero diagnostics, and a planted{{oops.nah}}reports2339 Property 'nah' does not exist on type '1'at the exact template position.🤖 Generated with Claude Code