feat: underline grammar-engine-backed keys behind a dedicated flag (#467)#500
Merged
Conversation
) A debug aid for the grammar engine work: while enabled, underline the KEY of every option whose value is backed by a GrammarOptionValue, so it's obvious at a glance which keys the new engine covers. The key keeps its normal color and just gets a gray underline — recoloring grammar vs non-grammar keys was too distracting, especially on light themes. Gated on its own experimental flag (underlineGrammarEngineKeys, off by default), independent of useGrammarParseEngine: the grammar validators exist in the registry regardless of which validation path is active, so this toggles on its own. Surfaced as a third checkbox on the settings page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 2, 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.
Re-cut of the key-marking feature (originally #474 + #481) straight onto current
242.x, with one change requested during review: it now has its own experimental flag, off by default, instead of riding onuseGrammarParseEngine.What it does
While the flag is on, the key of every option whose value is backed by a
GrammarOptionValuegets a gray underline (its normal color is kept). This makes it obvious at a glance which keys the new grammar engine covers versus the originalSyntacticMatch/SemanticMatchpath. Does nothing when the flag is off, so normal users are unaffected.The new flag
ExperimentalSettings.State.underlineGrammarEngineKeys(defaultfalse), independent ofuseGrammarParseEngine. This is coherent: the grammar validators exist in the registry regardless of which validation path is active, so "underline grammar-backed keys" is meaningful on its own. Surfaced as a third checkbox on the "systemd Unit Files" settings page. A test (testIndependentOfParseEngineFlag) locks in that the two flags are decoupled.Notes
LINE_UNDERSCORE) supersedes the original recolor approach from feat: visually mark grammar-engine keys when the experimental flag is on (#467) #474 — recoloring was too distracting on light themes.GrammarParseEngineInspectionTestINFORMATION-filter tweak from the original feat: visually mark grammar-engine keys when the experimental flag is on (#467) #474 is not included here — it already landed on242.xvia the value-coloring MR (feat: grammar-based value coloring behind the experimental flag #497).Testing
GrammarEngineKeyAnnotatorTest(3 tests) pass; annotator + settings suites green.🤖 Generated with Claude Code