You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commented-out JSONC lines still get full JSON syntax highlighting #55
Open a JSONC file (JSON with // comments, like the cmux settings template) and the commented-out lines keep their full JSON syntax highlighting — keys stay red, strings green, booleans amber. Only the // markers hint that the block is inert, so at a glance the file reads as if all those settings are active.
What should happen
Everything after // on a comment line renders in the muted comment colour, the way any other language's comments do.
Likely cause
.json files load the plain JSON grammar (src/language.ts), which has no comment support, so the parser treats // lines as ordinary (broken) JSON tokens and highlights them. Probably wants the JSONC variant of the CodeMirror JSON language for .json/.jsonc, or at least for .jsonc plus known comment-friendly files.
Repro
Open any .json file that uses // comments (cmux's generated cmux.json template is a ready-made example).
Look at the commented block - full token colours instead of comment styling.
Hi! If you are looking for a Lezer grammar for JSONC, you may consider my package @bhsd/lezer-json. It is a fork of @lezer/json and @codemirror/lang-json, and provides JSONC as a dialect of JSON. This package has already been used by MediaWiki (powering websites including Wikipedia).
Activity
bhsd-harry commentedon Sep 24, 2026
Hi! If you are looking for a Lezer grammar for JSONC, you may consider my package
@bhsd/lezer-json. It is a fork of@lezer/jsonand@codemirror/lang-json, and provides JSONC as a dialect of JSON. This package has already been used by MediaWiki (powering websites including Wikipedia).