Commit f478a5c
authored
* fix: resolve Go duplicate references in tree-sitter queries (#5367)
- Replace broad statement captures with function-scoped queries
- Eliminates overlapping captures that caused duplicate references
- Improves search quality and indexing performance for Go projects
- Add test to validate no duplicate line ranges are captured
- Maintains backward compatibility with existing functionality
Fixes #5367
* fix: resolve Go codebase indexing with language-specific thresholds
- Update Go tree-sitter queries to capture full declarations instead of just identifiers
- Implement language-specific character thresholds (50 chars for Go vs 100 default)
- Fix inspectGo.spec.ts test to match new query behavior
- Add comprehensive test coverage for Go indexing fix
This ensures Go files are properly indexed for semantic search while preventing
duplicate references. All tests now pass.
* fix: implement universal 50-character threshold for code indexing
- Changed MIN_BLOCK_CHARS from 100 to 50 in parser.ts
- Updated tests to expect single-block captures for small Go files
- Removed language-specific threshold logic
- Fixes Go files not being indexed due to high character threshold
Fixes #5367
* test: replace Go-specific test with generic MIN_BLOCK_CHARS test
- Remove go-indexing-fix.spec.ts as requested in PR feedback
- Add generic test in parser.spec.ts to verify 50-character threshold
- Test ensures content under 50 chars is filtered, 50+ chars is indexed
- Applies to all languages, not just Go
* fix: update markdown tests for MIN_BLOCK_CHARS change from 100 to 50
1 parent a83e8c0 commit f478a5c
File tree
6 files changed
+126
-111
lines changed- src/services
- code-index
- constants
- processors
- __tests__
- tree-sitter
- __tests__
- queries
6 files changed
+126
-111
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 54 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
191 | 235 | | |
192 | 236 | | |
193 | 237 | | |
| |||
217 | 261 | | |
218 | 262 | | |
219 | 263 | | |
220 | | - | |
| 264 | + | |
221 | 265 | | |
222 | 266 | | |
223 | 267 | | |
| |||
227 | 271 | | |
228 | 272 | | |
229 | 273 | | |
230 | | - | |
| 274 | + | |
231 | 275 | | |
232 | 276 | | |
233 | 277 | | |
| |||
544 | 588 | | |
545 | 589 | | |
546 | 590 | | |
547 | | - | |
| 591 | + | |
548 | 592 | | |
549 | 593 | | |
550 | 594 | | |
| |||
563 | 607 | | |
564 | 608 | | |
565 | 609 | | |
566 | | - | |
| 610 | + | |
567 | 611 | | |
568 | 612 | | |
569 | 613 | | |
| |||
595 | 639 | | |
596 | 640 | | |
597 | 641 | | |
598 | | - | |
599 | | - | |
| 642 | + | |
| 643 | + | |
600 | 644 | | |
601 | 645 | | |
602 | 646 | | |
| |||
943 | 987 | | |
944 | 988 | | |
945 | 989 | | |
946 | | - | |
| 990 | + | |
| 991 | + | |
947 | 992 | | |
948 | 993 | | |
949 | 994 | | |
950 | 995 | | |
951 | 996 | | |
952 | 997 | | |
953 | | - | |
| 998 | + | |
954 | 999 | | |
955 | | - | |
| 1000 | + | |
956 | 1001 | | |
957 | 1002 | | |
958 | 1003 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
204 | | - | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
217 | | - | |
218 | 216 | | |
219 | 217 | | |
220 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
23 | 65 | | |
Lines changed: 12 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
94 | 56 | | |
95 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
13 | 11 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 12 | + | |
| 13 | + | |
17 | 14 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
21 | 17 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 18 | + | |
| 19 | + | |
27 | 20 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 21 | + | |
| 22 | + | |
33 | 23 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 24 | + | |
| 25 | + | |
58 | 26 | | |
0 commit comments