fix: group small C# nodes to meet minimum block size for indexing #6049
+363
−2
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
This PR fixes an issue where C# code indexing was only capturing using directives and not the actual code content (classes, methods, properties, etc.).
Problem
The code parser was filtering out individual tree-sitter nodes that were smaller than the minimum block size (50 characters). This meant that:
using System;
) were too small to be indexed on their ownSolution
Added a
_groupSmallNodes
method that:Testing
Related Issue
Fixes #6048
Important
Introduces
_groupSmallNodes
inparser.ts
to group small C# nodes, ensuring they meet the minimum block size for indexing, with tests inparser-csharp-fix.spec.ts
._groupSmallNodes
method inparser.ts
to group small nodes, ensuring they meet the minimum block size.using_directive
nodes within 2 lines in C# files.parser-csharp-fix.spec.ts
with tests for grouping behavior.This description was created by
for 0df020f. You can customize this summary. It will automatically update as commits are pushed.