Fix(Language): Add language-configuration for comment toggle#433
Merged
1aron merged 1 commit intomaster-co:rcfrom May 3, 2026
Merged
Fix(Language): Add language-configuration for comment toggle#4331aron merged 1 commit intomaster-co:rcfrom
1aron merged 1 commit intomaster-co:rcfrom
Conversation
The `master-css` language declaration in `contributes.languages` had no `configuration` pointing at a `language-configuration.json`. As a result, VS Code had no comment characters for `.mcss` files or for `meta.embedded.block.master-css.class` regions inside JS/TS host files — pressing the Toggle Comment shortcut inside a `classNames(…)` call did nothing. This adds `packages/language/syntaxes/language-configuration.json` with line/block comments (`//` and `/* */`), brackets, auto-closing pairs and surrounding pairs, and wires it through `declaration.ts` so the generated `packages/vscode/package.json` references it. A dependency-free `node --test` regression covers the file shape and the declaration link so the wiring can't silently regress. Closes master-co#361
|
@0Miles is attempting to deploy a commit to the Aoyue Team on Vercel. A member of the Team first needs to authorize it. |
6 tasks
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.
Summary
packages/vscode/package.json'scontributes.languagesentry formaster-csshad noconfigurationfield — there was nolanguage-configuration.json. As a result, when the cursor sits insidemeta.embedded.block.master-css.class(the embedded scope created bymaster-css.injection-react.json/injection-js.json/ etc. forclassName={classNames(...)}etc.), VS Code asks themaster-csslanguage for comment characters, gets nothing, and the Toggle Line Comment shortcut becomes a no-op. That is the exact "doesn't work at all" symptom in #361.Changes
packages/language/syntaxes/language-configuration.json(new) —lineComment: \"//\",blockComment: [\"/*\", \"*/\"], plus standardbrackets,autoClosingPairs,surroundingPairs. The comment characters are JS-syntactic on purpose: when the cursor is inside an embeddedmaster-cssblock within a TS/JS host file (the situation in the issue's screenshots), toggling produces a valid host-language comment.packages/language/src/declaration.ts— addsconfiguration: './syntaxes/language-configuration.json'.packages/vscode/generate.tspropagatesdeclarationverbatim into the language entry, so this is the single source of truth.packages/vscode/package.json— pre-applies the same field sopnpm generateis a no-op after merge (and CI checks that compare hand-written vs generated stay green). Diff verified by re-running the generate logic locally — the rendered output matches byte-for-byte.packages/language/tests/language-configuration.test.mjs(new) — 4 dependency-freenode --testcases: JSON parses, line+block comments are present, brackets/auto-closing pairs are non-empty, anddeclaration.tsreferences the file. Runs asnode --test packages/language/tests/language-configuration.test.mjs. No vitest deps added so this doesn't conflict with the separatefeat/language-grammar-testsbranch that introduces vitest to this package.Why this scope
The issue's second screenshot ("works but syntax highlighting broken") is a separate grammar concern — fixing the missing language-configuration is necessary regardless and is the cleanly-isolatable change. Keeping this PR surgical means it can land independently.
Test plan
node --test packages/language/tests/language-configuration.test.mjs— 4/4 passtsx -ere-render ofgenerate.ts's language emission matches the hand-applied edit inpackages/vscode/package.jsonclassName={classNames(\"bg:white\", \"fg:black\")}, press Cmd/Ctrl+/, observe both lines toggle correctlyCloses #361