feat: visually mark grammar-engine keys when the experimental flag is on (#467)#474
Open
SJrX wants to merge 1 commit into
Open
feat: visually mark grammar-engine keys when the experimental flag is on (#467)#474SJrX wants to merge 1 commit into
SJrX wants to merge 1 commit into
Conversation
A debug aid: while useGrammarParseEngine is enabled, an annotator marks the KEY of every option whose value is validated by the new engine (a GrammarOptionValue), so it's obvious at a glance which keys run on the new parse() path vs the original one. This avoids wasting time poking at keys that aren't actually on the new path. - GrammarEngineKeyAnnotator: when the flag is on, resolves each property's validator and, if it is a GrammarOptionValue, adds an INFORMATION-level annotation on the key with a distinct (METADATA-tinted) text attribute. No-op when the flag is off, so no effect for normal users. Not configurable, by request. - Adjusts GrammarParseEngineInspectionTest to count only non-INFORMATION highlights, since the annotator (same flag) now also marks the keys. Refs #467 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 21, 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.
What
A small debug aid: while the experimental grammar engine is enabled, the key of any option whose value is validated by the new engine (a
GrammarOptionValue) is visually marked, so it's obvious at a glance which keys run on the newparse()path versus the originalSyntacticMatch/SemanticMatchone.How
GrammarEngineKeyAnnotator— whenuseGrammarParseEngineis on, resolves each property's validator (same lookup the inspection uses: file class + section + key) and, if it's aGrammarOptionValue, adds anINFORMATION-level annotation on the key with a distinct, theme-aware (METADATA-tinted) text attribute. When the flag is off it returns immediately, so there's no effect for normal users.Test note
GrammarParseEngineInspectionTest(from #472) now counts only non-INFORMATIONhighlights, because this annotator — keyed off the same flag — also marks the keys, which would otherwise inflate the inspection's highlight counts. Engine/inspection behavior is unchanged; full suite green.Refs #467
🤖 Generated with Claude Code