Fixed a critical functional bug where multiple subscripts with the same
parameter name (e.g., 'key') would create identifier collisions in the parsed
output, making them indistinguishable.
The fix changes the subscript capture pattern from capturing the parameter
name to capturing the entire subscript_declaration node with @name.definition.method
tags. This ensures each subscript is uniquely identified by its full signature
(e.g., "subscript(key: String) -> Value?") rather than just the parameter name.
Added comprehensive test cases:
- Swift protocol/class with multiple subscripts to validate the fix
- C# mixed inheritance (base class + multiple interfaces) for better coverage
All 869 tests pass with this change.
Enhanced test coverage and documentation based on code review feedback:
1. C# Multiple Interface Test Enhancement:
- Added explicit assertions for interface names (IDisposable, IComparable,
ICloneable) to verify base_list pattern correctly captures all interfaces
- This validates the query pattern handles comma-separated interfaces
2. Swift Subscript Documentation:
- Added comments documenting the current subscript parameter naming behavior
- Notes that parameter names (e.g., "key") are captured rather than subscript
signatures, which may cause non-unique identifiers
- Marked as future improvement consideration for semantic accuracy
Note: Static protocol method verification was already present in the test
expectations (line 244), so no changes needed there.
These changes address non-blocking suggestions from PR review to improve
test coverage and code documentation.
Added comprehensive test case to verify that the base_list query pattern
correctly handles comma-separated multiple interface implementations.
The test validates parsing of a class implementing IDisposable, IComparable,
and ICloneable interfaces, ensuring all methods are correctly captured.
This test was suggested in PR review feedback to strengthen test coverage
for the base_list query pattern.
Update tree-sitter-wasms package to version 0.1.15 to get latest language
grammar updates. Updated C# query patterns to match the new tree-sitter-c_sharp
grammar structure based on official tags.scm.
Changes:
- Update @repomix/tree-sitter-wasms from 0.1.14 to 0.1.15
- Fix C# query patterns for compatibility with new grammar:
- Remove field specifiers from base_list patterns
- Add type_parameter_constraints_clause pattern
- Add type_parameter_constraint pattern (correct node name)
- Restore type: field for object_creation_expression and variable_declaration
- Add comprehensive C# test cases for inheritance, interfaces, generics, etc.
All patterns now follow the official tree-sitter-c-sharp tags.scm specification.