Repository navigation
feat: expose Java varargs parameter query fields - #59
Merged
Merged
Conversation
Co-authored-by: WillBooster (Codex) <[email protected]>
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.
Why
A variable-arity parameter parses its type, modifiers, and ellipsis annotations as unlabelled children. Queries such as
(spread_parameter type: (_) @type)are rejected, so consumers cannot select these parts by field as they can for an ordinary parameter's type.Requirements
spread_parameter, because those syntax roles otherwise require positional child inspection.variable_declarator, because its existingnamefield already provides a working query and this improvement needs no new binding structure.Customer Summary
Structural queries can select the type, modifiers, and ellipsis annotations of Java varargs parameters directly by field.
Technical Summary
spread_parameterlabels its existing children withtype,modifiers, and repeatedannotationsfields. A public WASM API regression parses plain and annotated variable-arity parameters and checks field access, query captures, binding names, and source ranges.Testing
The complete annotated fixture compiles cleanly with JDK 27. Baseline native and public WASM probes reject all three missing field queries; the binding-name query already works.
bun run build/ci,bun run verify, andbun wb test test/unit/varargsFields.test.ts test/unit/corpus.test.ts test/unit/wasm.test.tspass. Both native and WASM execution pass all 165 corpus cases. A public API probe inserts and removes an ellipsis annotation twice, comparing field values and query captures/ranges with fresh parsing. Full verification and robustness CI passed on all configured platforms on the reviewed head.