fix: improve cross-validation normalizer (103→105 matches)#235
Merged
VladimirMakaev merged 1 commit intofwcd:mainfrom Feb 20, 2026
Merged
Conversation
c664048 to
13abffb
Compare
Three normalizer improvements: 1. Labeled expressions: prefix_expression with label child is now transparent (matches PSI's LABELED_EXPRESSION which is skipped). Fixes SimpleExpressions. 2. Comment-only bodies: control_structure_body containing only comments now produces empty BLOCK instead of being dropped. Fixes CommentsBindingInStatementBlock. 3. Destructuring declarations: DESTRUCTURING_DECLARATION_ENTRY added to SKIP_PSI_NODES, and DESTRUCTURING_DECLARATION children wrapped in VALUE_PARAMETER in lambda parameter lists. Reduces destructuringInLambdas diffs from 20 to 19. 4. Property accessor cap: _nestPropertyAccessors now limits to 2 accessors per property, matching PSI error recovery behavior. Match rate: 103/126 (81.7%) → 105/126 (83.3%)
13abffb to
78b9536
Compare
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
Four normalizer improvements for the cross-validation tooling:
prefix_expressionwith alabelchild is now transparent, matching PSI'sLABELED_EXPRESSIONwhich is skipped. FixesSimpleExpressions.control_structure_bodycontaining only comments now produces an emptyBLOCKinstead of being dropped entirely. FixesCommentsBindingInStatementBlock.DESTRUCTURING_DECLARATION_ENTRYadded toSKIP_PSI_NODES, andDESTRUCTURING_DECLARATIONchildren wrapped inVALUE_PARAMETERin lambda parameter lists. ReducesdestructuringInLambdasdiffs._nestPropertyAccessorsnow limits to 2 accessors per property, matching PSI error recovery.Parser size
No change to parser.c — normalizer-only changes.
Impact
Match rate: 103/126 (81.7%) → 105/126 (83.3%)
Test plan
npm run cross-validateshows 105/126 match rate