Commit 86d1169
feat: support directory outline (#35)
* feat: support directory outline
* Address code review feedback for directory outline feature (#36)
* Initial plan
* fix: address code review feedback for directory outline
- Remove filesystem access from schema validator
- Add path validation and scope check in capability handler
- Add error handling for failed LSP symbol requests in directory mode
- Add validation for mutually exclusive OutlineResponse fields
- Add semaphore to limit concurrent directory file processing
- Exclude common directories (node_modules, .git, __pycache__, etc.)
- Use string-based sorting for cross-platform path consistency
- Improve OutlineFileItem docstring
- Add test for scope+directory validation
- Add test verifying non-code files are excluded
- Add is_directory assertions to directory tests
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>
* refactor: improve error handling and move constant to module level
- Move EXCLUDED_DIRS to module-level constant (_EXCLUDED_DIRS) for better performance
- Add logging for failed file processing in directory mode
- Import loguru logger for debug logging
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>
* refactor: improve exception handling and imports
- Use specific exceptions (OSError, PermissionError) instead of broad Exception catch
- Use logger format strings instead of f-strings for better performance
- Move tempfile import to top level in tests
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>
* perf: improve glob pattern and directory exclusion check
- Fix glob pattern to use `*.{suffix}` instead of `*{suffix}` for proper extension matching
- Use frozenset.isdisjoint() instead of any() for better performance on deeply nested paths
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>
* feat: add with_sem
* feat: add subdir tips
---------
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: observerw <20661574+observerw@users.noreply.github.com>1 parent fed55f6 commit 86d1169
File tree
4 files changed
+172
-35
lines changed- src/lsap
- capability
- schema
- utils
- tests
4 files changed
+172
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
42 | 43 | | |
43 | | - | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
57 | 53 | | |
58 | | - | |
| 54 | + | |
59 | 55 | | |
60 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
66 | 74 | | |
67 | 75 | | |
68 | | - | |
| 76 | + | |
69 | 77 | | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 86 | + | |
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| |||
112 | 120 | | |
113 | 121 | | |
114 | 122 | | |
115 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
| |||
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
132 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
133 | 145 | | |
134 | 146 | | |
135 | 147 | | |
| |||
181 | 193 | | |
182 | 194 | | |
183 | 195 | | |
184 | | - | |
| 196 | + | |
185 | 197 | | |
186 | 198 | | |
187 | 199 | | |
188 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
189 | 208 | | |
190 | 209 | | |
191 | 210 | | |
| |||
205 | 224 | | |
206 | 225 | | |
207 | 226 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
77 | 84 | | |
78 | 85 | | |
79 | 86 | | |
| |||
103 | 110 | | |
104 | 111 | | |
105 | 112 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 113 | + | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| |||
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
142 | 155 | | |
143 | 156 | | |
144 | 157 | | |
| |||
150 | 163 | | |
151 | 164 | | |
152 | 165 | | |
| 166 | + | |
153 | 167 | | |
154 | 168 | | |
155 | 169 | | |
156 | 170 | | |
| 171 | + | |
157 | 172 | | |
158 | 173 | | |
159 | 174 | | |
| |||
162 | 177 | | |
163 | 178 | | |
164 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
165 | 195 | | |
166 | 196 | | |
167 | 197 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
402 | 403 | | |
403 | 404 | | |
404 | 405 | | |
405 | | - | |
406 | | - | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
| |||
457 | 456 | | |
458 | 457 | | |
459 | 458 | | |
| 459 | + | |
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
479 | | - | |
480 | 478 | | |
481 | 479 | | |
482 | 480 | | |
| |||
546 | 544 | | |
547 | 545 | | |
548 | 546 | | |
| 547 | + | |
549 | 548 | | |
550 | 549 | | |
551 | 550 | | |
| |||
556 | 555 | | |
557 | 556 | | |
558 | 557 | | |
| 558 | + | |
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
0 commit comments