Commit Graph

7 Commits

Author SHA1 Message Date
Kazuki Yamada
ebe6ff2f3a fix(treeSitter): Fix Swift subscript parameter name collision bug
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.
2025-11-24 21:37:29 +09:00
Kazuki Yamada
b6cfefdb27 test(treeSitter): Address PR review feedback
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.
2025-11-24 21:26:01 +09:00
Kazuki Yamada
32d668f4f1 test(treeSitter): Add test for multiple interface implementation in C#
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.
2025-11-24 21:13:51 +09:00
Kazuki Yamada
ef98190151 chore(deps): Update @repomix/tree-sitter-wasms to 0.1.15
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.
2025-11-24 20:02:21 +09:00
Kazuki Yamada
b7fe6f25c5 fix(lint): resolve all oxlint warnings for code quality
- Remove unused imports across 67 files (RepomixConfigMerged, QueryCapture, etc.)
- Fix unused parameters by prefixing with underscore (_context, _index, etc.)
- Remove unused catch parameters using modern JavaScript syntax
- Fix require-yield warnings in generator functions
- Remove unused variables and interface declarations
- Add oxlint configuration to ignore integration test fixtures

Resolves 144 linting warnings while preserving all functionality.
All 743 tests continue to pass. Code quality significantly improved.
2025-08-24 18:25:08 +09:00
Devin AI
8ebb7c1c86 Replace type assertions with createMockConfig in treeSitter test files and fix outputSort test
Co-Authored-By: Kazuki Yamada <koukun0120@gmail.com>
2025-05-12 14:36:55 +00:00
yamadashy
d2f3820574 feat(compress): Add comments and import statements to compress. Also improve to include all type definitions such as interfaces in some languages 2025-03-02 00:32:47 +09:00