Commit 3c8569d
intellij-backend: visibility-scoped search, parallel diagnostics, batched reads, telemetry (#106)
## Summary
Eight performance and correctness improvements to the IntelliJ plugin
backend:
1. **Visibility-scoped reference search** — `findReferences()` and
`rename()` now narrow the `GlobalSearchScope` based on symbol
visibility: `fileScope` for PRIVATE/LOCAL, `moduleScope` for INTERNAL,
`projectScope` for PUBLIC/PROTECTED/UNKNOWN. The `SearchScopeKind` in
the response reflects the actual scope used, and
`candidateFileCount`/`searchedFileCount` report real file counts instead
of result counts.
2. **Parallel diagnostics** — `diagnostics()` processes files
concurrently via `coroutineScope { async(readDispatcher) { ... } }`
instead of sequential `flatMap`.
3. **Batched workspaceSymbolSearch** — The three separate
`timedReadAction` calls (classes, methods, fields) are combined into a
single read action.
4. **Batched collectInShortReadActions** — Items are processed in
batches of 50 per read action instead of one item per read action,
reducing lock acquire/release overhead.
5. **Batched IntelliJTypeEdgeResolver.supertypeEdges** — Per-FQN read
actions are combined into a single read action that resolves all
supertypes at once.
6. **Shared ReadAccessScope** — A single `intellijReadAccess` field on
`KastPluginBackend` replaces anonymous instances in `callHierarchy` and
`typeHierarchy`.
7. **Missing telemetry scopes** — Added `TYPE_HIERARCHY`,
`IMPLEMENTATIONS`, `COMPLETIONS`, `SEMANTIC_INSERTION_POINT`,
`OPTIMIZE_IMPORTS`, and `WORKSPACE_SYMBOL_SEARCH` to the scope enum.
Wrapped `typeHierarchy`, `implementations`, `completions`,
`semanticInsertionPoint`, and `optimizeImports` with proper spans. Fixed
`optimizeImports` and `workspaceSymbolSearch` which incorrectly used
`DIAGNOSTICS` scope.
8. **Expanded performance test suite** — New
`IntelliJBackendOperationPerformanceTest` exercises `findReferences`
with private/public/internal symbols (validates scope narrowing),
parallel `diagnostics` across multiple files, and
`workspaceSymbolSearch` with timing budgets. All tests tagged
`@Tag("performance")`.
## Review & Testing Checklist for Human
- [ ] Verify `findReferences` for a private symbol returns
`SearchScopeKind.FILE` and only searches the declaring file
- [ ] Verify `findReferences` for an internal symbol returns
`SearchScopeKind.MODULE` when a module can be resolved
- [ ] Verify `rename` scope narrowing matches `findReferences` behavior
- [ ] Run `./gradlew :backend-intellij:test -PincludeTags=performance`
to validate the new performance baseline tests pass
- [ ] Confirm parallel diagnostics produces identical results to
sequential (no ordering or correctness regressions)
### Notes
- The `collectInShortReadActions` function signature changed from
`runPerItemReadAction` to `runBatchReadAction` to support batch
processing. The `ReadActionBatchingTest` is updated accordingly.
- Base branch is `devin/1777165956-remove-demo-code` (demo code
removal).
Link to Devin session:
https://app.devin.ai/sessions/a368089e609f4a3bae92d4113b646f39
Requested by: @amichne
---------
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: amichne <22558698+amichne@users.noreply.github.com>1 parent dcf9b09 commit 3c8569d
124 files changed
Lines changed: 1090 additions & 14933 deletions
File tree
- .agents/skills
- kast
- fixtures/maintenance
- evals
- references
- scripts
- references
- kotter-terminal-ui
- evals
- references
- .github/workflows
- backend-intellij
- src
- main/kotlin/io/github/amichne/kast/intellij
- test/kotlin/io/github/amichne/kast/intellij
- backend-standalone/src
- main/kotlin/io/github/amichne/kast/standalone
- test/kotlin/io/github/amichne/kast/standalone
- docs
- getting-started
- gradle
- kast-cli
- src
- main/kotlin/io/github/amichne/kast/cli
- demo
- test/kotlin/io/github/amichne/kast/cli
- demo
- kast-demo
- src
- main/kotlin/io/github/amichne/kast/demo
- test/kotlin/io/github/amichne/kast/demo
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | | - | |
21 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 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 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
34 | 72 | | |
35 | 73 | | |
36 | 74 | | |
| |||
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
82 | 154 | | |
83 | 155 | | |
84 | 156 | | |
Lines changed: 68 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 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 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
181 | 249 | | |
182 | 250 | | |
183 | 251 | | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
55 | 67 | | |
56 | 68 | | |
57 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
58 | 74 | | |
59 | 75 | | |
60 | 76 | | |
| |||
170 | 186 | | |
171 | 187 | | |
172 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
173 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
174 | 202 | | |
175 | 203 | | |
176 | 204 | | |
| |||
282 | 310 | | |
283 | 311 | | |
284 | 312 | | |
| 313 | + | |
| 314 | + | |
285 | 315 | | |
286 | 316 | | |
287 | 317 | | |
| |||
316 | 346 | | |
317 | 347 | | |
318 | 348 | | |
319 | | - | |
| 349 | + | |
320 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
321 | 355 | | |
322 | 356 | | |
323 | 357 | | |
324 | 358 | | |
325 | 359 | | |
326 | 360 | | |
327 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
328 | 366 | | |
329 | 367 | | |
330 | 368 | | |
| |||
340 | 378 | | |
341 | 379 | | |
342 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
343 | 385 | | |
344 | 386 | | |
345 | 387 | | |
| |||
360 | 402 | | |
361 | 403 | | |
362 | 404 | | |
| 405 | + | |
| 406 | + | |
363 | 407 | | |
364 | 408 | | |
365 | 409 | | |
| |||
0 commit comments