@lzehrung/codegraph 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (682) hide show
  1. package/README.md +19 -17
  2. package/codegraph-skill/codegraph/SKILL.md +3 -0
  3. package/dist/agent/artifact.d.ts.map +1 -1
  4. package/dist/agent/artifact.js +4 -9
  5. package/dist/agent/artifact.js.map +1 -1
  6. package/dist/agent/call-hierarchy.d.ts +4 -2
  7. package/dist/agent/call-hierarchy.d.ts.map +1 -1
  8. package/dist/agent/call-hierarchy.js +20 -29
  9. package/dist/agent/call-hierarchy.js.map +1 -1
  10. package/dist/agent/explain.d.ts.map +1 -1
  11. package/dist/agent/explain.js +12 -11
  12. package/dist/agent/explain.js.map +1 -1
  13. package/dist/agent/explore.d.ts.map +1 -1
  14. package/dist/agent/explore.js +2 -11
  15. package/dist/agent/explore.js.map +1 -1
  16. package/dist/agent/file-view.d.ts.map +1 -1
  17. package/dist/agent/file-view.js +4 -12
  18. package/dist/agent/file-view.js.map +1 -1
  19. package/dist/agent/normalize.d.ts +0 -3
  20. package/dist/agent/normalize.d.ts.map +1 -1
  21. package/dist/agent/normalize.js +1 -7
  22. package/dist/agent/normalize.js.map +1 -1
  23. package/dist/agent/orient.d.ts.map +1 -1
  24. package/dist/agent/orient.js +2 -6
  25. package/dist/agent/orient.js.map +1 -1
  26. package/dist/agent/packet.d.ts.map +1 -1
  27. package/dist/agent/packet.js +2 -5
  28. package/dist/agent/packet.js.map +1 -1
  29. package/dist/agent/query-index/content.d.ts.map +1 -1
  30. package/dist/agent/query-index/content.js +2 -6
  31. package/dist/agent/query-index/content.js.map +1 -1
  32. package/dist/agent/query-index/update.d.ts.map +1 -1
  33. package/dist/agent/query-index/update.js +8 -45
  34. package/dist/agent/query-index/update.js.map +1 -1
  35. package/dist/agent/query-index/worker-pool.d.ts.map +1 -1
  36. package/dist/agent/query-index/worker-pool.js +2 -1
  37. package/dist/agent/query-index/worker-pool.js.map +1 -1
  38. package/dist/agent/refactor-plan.d.ts +2 -2
  39. package/dist/agent/refactor-plan.d.ts.map +1 -1
  40. package/dist/agent/refactor-plan.js +11 -57
  41. package/dist/agent/refactor-plan.js.map +1 -1
  42. package/dist/agent/rename-preview.d.ts.map +1 -1
  43. package/dist/agent/rename-preview.js +218 -26
  44. package/dist/agent/rename-preview.js.map +1 -1
  45. package/dist/agent/search.d.ts.map +1 -1
  46. package/dist/agent/search.js +7 -22
  47. package/dist/agent/search.js.map +1 -1
  48. package/dist/agent/semantic-symbols.d.ts +1 -1
  49. package/dist/agent/semantic-symbols.d.ts.map +1 -1
  50. package/dist/agent/semantic-symbols.js +2 -5
  51. package/dist/agent/semantic-symbols.js.map +1 -1
  52. package/dist/agent/semantic.d.ts +5 -0
  53. package/dist/agent/semantic.d.ts.map +1 -1
  54. package/dist/agent/semantic.js +12 -1
  55. package/dist/agent/semantic.js.map +1 -1
  56. package/dist/agent/session.d.ts +9 -0
  57. package/dist/agent/session.d.ts.map +1 -1
  58. package/dist/agent/session.js +59 -41
  59. package/dist/agent/session.js.map +1 -1
  60. package/dist/agent/type-hierarchy.d.ts +4 -2
  61. package/dist/agent/type-hierarchy.d.ts.map +1 -1
  62. package/dist/agent/type-hierarchy.js +19 -31
  63. package/dist/agent/type-hierarchy.js.map +1 -1
  64. package/dist/agent/workspace-symbols.d.ts +1 -1
  65. package/dist/agent/workspace-symbols.d.ts.map +1 -1
  66. package/dist/agent/workspace-symbols.js +7 -15
  67. package/dist/agent/workspace-symbols.js.map +1 -1
  68. package/dist/analysis-summary.d.ts +1 -4
  69. package/dist/analysis-summary.d.ts.map +1 -1
  70. package/dist/analysis-summary.js +58 -19
  71. package/dist/analysis-summary.js.map +1 -1
  72. package/dist/bin/cli.js +36572 -22925
  73. package/dist/bin/query-index-worker.js +440 -261
  74. package/dist/bootstrap/tree-sitter-languages.d.ts +2 -0
  75. package/dist/bootstrap/tree-sitter-languages.d.ts.map +1 -1
  76. package/dist/bootstrap/tree-sitter-languages.js +6 -19
  77. package/dist/bootstrap/tree-sitter-languages.js.map +1 -1
  78. package/dist/chunking/chunk-matches.d.ts.map +1 -1
  79. package/dist/chunking/chunk-matches.js +6 -42
  80. package/dist/chunking/chunk-matches.js.map +1 -1
  81. package/dist/chunking/chunk-split.d.ts +7 -0
  82. package/dist/chunking/chunk-split.d.ts.map +1 -1
  83. package/dist/chunking/chunk-split.js +3 -3
  84. package/dist/chunking/chunk-split.js.map +1 -1
  85. package/dist/chunking/chunk-text-file.js +2 -30
  86. package/dist/chunking/chunk-text-file.js.map +1 -1
  87. package/dist/cli/affected.d.ts.map +1 -1
  88. package/dist/cli/affected.js +1 -9
  89. package/dist/cli/affected.js.map +1 -1
  90. package/dist/cli/call-hierarchy.js +3 -6
  91. package/dist/cli/call-hierarchy.js.map +1 -1
  92. package/dist/cli/chunk.d.ts.map +1 -1
  93. package/dist/cli/chunk.js +4 -11
  94. package/dist/cli/chunk.js.map +1 -1
  95. package/dist/cli/command-table.d.ts.map +1 -1
  96. package/dist/cli/command-table.js +3 -0
  97. package/dist/cli/command-table.js.map +1 -1
  98. package/dist/cli/context.d.ts +1 -0
  99. package/dist/cli/context.d.ts.map +1 -1
  100. package/dist/cli/context.js +1 -1
  101. package/dist/cli/context.js.map +1 -1
  102. package/dist/cli/doctor.d.ts.map +1 -1
  103. package/dist/cli/doctor.js +1 -11
  104. package/dist/cli/doctor.js.map +1 -1
  105. package/dist/cli/graph.d.ts +4 -12
  106. package/dist/cli/graph.d.ts.map +1 -1
  107. package/dist/cli/graph.js +17 -8
  108. package/dist/cli/graph.js.map +1 -1
  109. package/dist/cli/help.d.ts +4 -4
  110. package/dist/cli/help.d.ts.map +1 -1
  111. package/dist/cli/help.js +7 -5
  112. package/dist/cli/help.js.map +1 -1
  113. package/dist/cli/index.d.ts +2 -12
  114. package/dist/cli/index.d.ts.map +1 -1
  115. package/dist/cli/index.js +2 -5
  116. package/dist/cli/index.js.map +1 -1
  117. package/dist/cli/links.d.ts.map +1 -1
  118. package/dist/cli/links.js +4 -10
  119. package/dist/cli/links.js.map +1 -1
  120. package/dist/cli/mcp.d.ts.map +1 -1
  121. package/dist/cli/mcp.js +1 -0
  122. package/dist/cli/mcp.js.map +1 -1
  123. package/dist/cli/module-locals.d.ts +8 -0
  124. package/dist/cli/module-locals.d.ts.map +1 -0
  125. package/dist/cli/module-locals.js +9 -0
  126. package/dist/cli/module-locals.js.map +1 -0
  127. package/dist/cli/navigation.d.ts +2 -0
  128. package/dist/cli/navigation.d.ts.map +1 -1
  129. package/dist/cli/navigation.js +3 -5
  130. package/dist/cli/navigation.js.map +1 -1
  131. package/dist/cli/options.d.ts.map +1 -1
  132. package/dist/cli/options.js +2 -1
  133. package/dist/cli/options.js.map +1 -1
  134. package/dist/cli/pretty.d.ts +1 -0
  135. package/dist/cli/pretty.d.ts.map +1 -1
  136. package/dist/cli/pretty.js +6 -8
  137. package/dist/cli/pretty.js.map +1 -1
  138. package/dist/cli/refactor-plan.js +2 -5
  139. package/dist/cli/refactor-plan.js.map +1 -1
  140. package/dist/cli/rename-preview.js +2 -5
  141. package/dist/cli/rename-preview.js.map +1 -1
  142. package/dist/cli/review.d.ts +6 -16
  143. package/dist/cli/review.d.ts.map +1 -1
  144. package/dist/cli/review.js +2 -0
  145. package/dist/cli/review.js.map +1 -1
  146. package/dist/cli/server.d.ts.map +1 -1
  147. package/dist/cli/server.js +7 -10
  148. package/dist/cli/server.js.map +1 -1
  149. package/dist/cli/type-hierarchy.js +8 -8
  150. package/dist/cli/type-hierarchy.js.map +1 -1
  151. package/dist/document-links/asciidoc.d.ts.map +1 -1
  152. package/dist/document-links/asciidoc.js +4 -16
  153. package/dist/document-links/asciidoc.js.map +1 -1
  154. package/dist/document-links/check.d.ts.map +1 -1
  155. package/dist/document-links/check.js +1 -3
  156. package/dist/document-links/check.js.map +1 -1
  157. package/dist/document-links/html.d.ts.map +1 -1
  158. package/dist/document-links/html.js +6 -44
  159. package/dist/document-links/html.js.map +1 -1
  160. package/dist/document-links/markdown.d.ts.map +1 -1
  161. package/dist/document-links/markdown.js +4 -13
  162. package/dist/document-links/markdown.js.map +1 -1
  163. package/dist/document-links/rst.d.ts.map +1 -1
  164. package/dist/document-links/rst.js +7 -31
  165. package/dist/document-links/rst.js.map +1 -1
  166. package/dist/document-links/sfc.d.ts.map +1 -1
  167. package/dist/document-links/sfc.js +2 -5
  168. package/dist/document-links/sfc.js.map +1 -1
  169. package/dist/document-links/shared.d.ts +2 -0
  170. package/dist/document-links/shared.d.ts.map +1 -1
  171. package/dist/document-links/shared.js +13 -0
  172. package/dist/document-links/shared.js.map +1 -1
  173. package/dist/drift/artifact.d.ts.map +1 -1
  174. package/dist/drift/artifact.js +4 -27
  175. package/dist/drift/artifact.js.map +1 -1
  176. package/dist/drift/graph-edges.d.ts +4 -0
  177. package/dist/drift/graph-edges.d.ts.map +1 -0
  178. package/dist/drift/graph-edges.js +15 -0
  179. package/dist/drift/graph-edges.js.map +1 -0
  180. package/dist/drift/snapshot.d.ts.map +1 -1
  181. package/dist/drift/snapshot.js +2 -17
  182. package/dist/drift/snapshot.js.map +1 -1
  183. package/dist/duplicates/unit-cache.d.ts +11 -1
  184. package/dist/duplicates/unit-cache.d.ts.map +1 -1
  185. package/dist/duplicates/unit-cache.js +20 -2
  186. package/dist/duplicates/unit-cache.js.map +1 -1
  187. package/dist/duplicates/units.d.ts +2 -1
  188. package/dist/duplicates/units.d.ts.map +1 -1
  189. package/dist/duplicates/units.js +23 -22
  190. package/dist/duplicates/units.js.map +1 -1
  191. package/dist/graph-builder.d.ts +1 -1
  192. package/dist/graph-builder.d.ts.map +1 -1
  193. package/dist/graph-builder.js +3 -2
  194. package/dist/graph-builder.js.map +1 -1
  195. package/dist/graph-edge-collector.d.ts +3 -1
  196. package/dist/graph-edge-collector.d.ts.map +1 -1
  197. package/dist/graph-edge-collector.js +38 -6
  198. package/dist/graph-edge-collector.js.map +1 -1
  199. package/dist/graphs/angularjs.d.ts.map +1 -1
  200. package/dist/graphs/angularjs.js +2 -9
  201. package/dist/graphs/angularjs.js.map +1 -1
  202. package/dist/graphs/edge-resolution.d.ts +4 -0
  203. package/dist/graphs/edge-resolution.d.ts.map +1 -1
  204. package/dist/graphs/edge-resolution.js +2 -0
  205. package/dist/graphs/edge-resolution.js.map +1 -1
  206. package/dist/graphs/external/manifests.d.ts.map +1 -1
  207. package/dist/graphs/external/manifests.js +1 -6
  208. package/dist/graphs/external/manifests.js.map +1 -1
  209. package/dist/graphs/specifiers.d.ts.map +1 -1
  210. package/dist/graphs/specifiers.js +47 -26
  211. package/dist/graphs/specifiers.js.map +1 -1
  212. package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts +2 -0
  213. package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts.map +1 -1
  214. package/dist/graphs/symbol-graph-detailed/edge-passes.js +9 -3
  215. package/dist/graphs/symbol-graph-detailed/edge-passes.js.map +1 -1
  216. package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts +3 -3
  217. package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts.map +1 -1
  218. package/dist/graphs/symbol-graph-detailed/receiver-calls.js +2 -26
  219. package/dist/graphs/symbol-graph-detailed/receiver-calls.js.map +1 -1
  220. package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -1
  221. package/dist/graphs/symbol-graph-detailed.js +38 -1
  222. package/dist/graphs/symbol-graph-detailed.js.map +1 -1
  223. package/dist/graphs/symbol-graph.d.ts +1 -1
  224. package/dist/graphs/symbol-graph.d.ts.map +1 -1
  225. package/dist/graphs/symbol-graph.js +8 -0
  226. package/dist/graphs/symbol-graph.js.map +1 -1
  227. package/dist/impact/analyzer.d.ts.map +1 -1
  228. package/dist/impact/analyzer.js +116 -17
  229. package/dist/impact/analyzer.js.map +1 -1
  230. package/dist/impact/budgets.d.ts.map +1 -1
  231. package/dist/impact/budgets.js +3 -9
  232. package/dist/impact/budgets.js.map +1 -1
  233. package/dist/impact/call-compatibility.d.ts.map +1 -1
  234. package/dist/impact/call-compatibility.js +3 -12
  235. package/dist/impact/call-compatibility.js.map +1 -1
  236. package/dist/impact/context.d.ts +6 -0
  237. package/dist/impact/context.d.ts.map +1 -1
  238. package/dist/impact/context.js +2 -2
  239. package/dist/impact/context.js.map +1 -1
  240. package/dist/impact/direct.d.ts.map +1 -1
  241. package/dist/impact/direct.js +2 -6
  242. package/dist/impact/direct.js.map +1 -1
  243. package/dist/impact/map.d.ts +3 -1
  244. package/dist/impact/map.d.ts.map +1 -1
  245. package/dist/impact/map.js +12 -5
  246. package/dist/impact/map.js.map +1 -1
  247. package/dist/impact/reference-cache.d.ts.map +1 -1
  248. package/dist/impact/reference-cache.js +1 -24
  249. package/dist/impact/reference-cache.js.map +1 -1
  250. package/dist/impact/report-shared.d.ts +2 -1
  251. package/dist/impact/report-shared.d.ts.map +1 -1
  252. package/dist/impact/report-shared.js +10 -0
  253. package/dist/impact/report-shared.js.map +1 -1
  254. package/dist/impact/report-suggestions.d.ts.map +1 -1
  255. package/dist/impact/report-suggestions.js +2 -8
  256. package/dist/impact/report-suggestions.js.map +1 -1
  257. package/dist/impact/report.d.ts.map +1 -1
  258. package/dist/impact/report.js +2 -8
  259. package/dist/impact/report.js.map +1 -1
  260. package/dist/impact/streaming.d.ts.map +1 -1
  261. package/dist/impact/streaming.js +3 -8
  262. package/dist/impact/streaming.js.map +1 -1
  263. package/dist/impact/transitive.d.ts +6 -2
  264. package/dist/impact/transitive.d.ts.map +1 -1
  265. package/dist/impact/transitive.js +23 -11
  266. package/dist/impact/transitive.js.map +1 -1
  267. package/dist/indexer/build-cache/manifest.d.ts.map +1 -1
  268. package/dist/indexer/build-cache/manifest.js +10 -108
  269. package/dist/indexer/build-cache/manifest.js.map +1 -1
  270. package/dist/indexer/build-cache/module-cache.d.ts +6 -1
  271. package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
  272. package/dist/indexer/build-cache/module-cache.js +25 -2
  273. package/dist/indexer/build-cache/module-cache.js.map +1 -1
  274. package/dist/indexer/build-cache/options.d.ts +40 -1
  275. package/dist/indexer/build-cache/options.d.ts.map +1 -1
  276. package/dist/indexer/build-cache/options.js +40 -1
  277. package/dist/indexer/build-cache/options.js.map +1 -1
  278. package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
  279. package/dist/indexer/build-cache/project-snapshot.js +52 -99
  280. package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
  281. package/dist/indexer/build-cache/reports.d.ts +1 -0
  282. package/dist/indexer/build-cache/reports.d.ts.map +1 -1
  283. package/dist/indexer/build-cache/reports.js +10 -0
  284. package/dist/indexer/build-cache/reports.js.map +1 -1
  285. package/dist/indexer/build-index.d.ts +2 -0
  286. package/dist/indexer/build-index.d.ts.map +1 -1
  287. package/dist/indexer/build-index.js +187 -57
  288. package/dist/indexer/build-index.js.map +1 -1
  289. package/dist/indexer/build-workers.d.ts +7 -1
  290. package/dist/indexer/build-workers.d.ts.map +1 -1
  291. package/dist/indexer/build-workers.js +12 -0
  292. package/dist/indexer/build-workers.js.map +1 -1
  293. package/dist/indexer/call-hierarchy.d.ts.map +1 -1
  294. package/dist/indexer/call-hierarchy.js +5 -17
  295. package/dist/indexer/call-hierarchy.js.map +1 -1
  296. package/dist/indexer/compilation-units.d.ts +32 -20
  297. package/dist/indexer/compilation-units.d.ts.map +1 -1
  298. package/dist/indexer/compilation-units.js +139 -145
  299. package/dist/indexer/compilation-units.js.map +1 -1
  300. package/dist/indexer/cpp-callables.d.ts.map +1 -1
  301. package/dist/indexer/cpp-callables.js +2 -7
  302. package/dist/indexer/cpp-callables.js.map +1 -1
  303. package/dist/indexer/declarations.d.ts.map +1 -1
  304. package/dist/indexer/declarations.js +32 -7
  305. package/dist/indexer/declarations.js.map +1 -1
  306. package/dist/indexer/import-resolution-tables.d.ts.map +1 -1
  307. package/dist/indexer/import-resolution-tables.js +10 -0
  308. package/dist/indexer/import-resolution-tables.js.map +1 -1
  309. package/dist/indexer/import-types.d.ts +5 -0
  310. package/dist/indexer/import-types.d.ts.map +1 -1
  311. package/dist/indexer/import-types.js.map +1 -1
  312. package/dist/indexer/imports/binding-ranges.d.ts +5 -12
  313. package/dist/indexer/imports/binding-ranges.d.ts.map +1 -1
  314. package/dist/indexer/imports/binding-ranges.js +13 -19
  315. package/dist/indexer/imports/binding-ranges.js.map +1 -1
  316. package/dist/indexer/imports/context.d.ts +6 -0
  317. package/dist/indexer/imports/context.d.ts.map +1 -1
  318. package/dist/indexer/imports/import-binding-tables.d.ts +28 -13
  319. package/dist/indexer/imports/import-binding-tables.d.ts.map +1 -1
  320. package/dist/indexer/imports/import-binding-tables.js +182 -178
  321. package/dist/indexer/imports/import-binding-tables.js.map +1 -1
  322. package/dist/indexer/imports/js-text-imports.d.ts +0 -1
  323. package/dist/indexer/imports/js-text-imports.d.ts.map +1 -1
  324. package/dist/indexer/imports/js-text-imports.js +0 -176
  325. package/dist/indexer/imports/js-text-imports.js.map +1 -1
  326. package/dist/indexer/imports/language-specific.d.ts.map +1 -1
  327. package/dist/indexer/imports/language-specific.js +4 -8
  328. package/dist/indexer/imports/language-specific.js.map +1 -1
  329. package/dist/indexer/imports/python.d.ts +0 -1
  330. package/dist/indexer/imports/python.d.ts.map +1 -1
  331. package/dist/indexer/imports/python.js +1 -29
  332. package/dist/indexer/imports/python.js.map +1 -1
  333. package/dist/indexer/imports/text-import-extractors.d.ts +2 -9
  334. package/dist/indexer/imports/text-import-extractors.d.ts.map +1 -1
  335. package/dist/indexer/imports/text-import-extractors.js +0 -284
  336. package/dist/indexer/imports/text-import-extractors.js.map +1 -1
  337. package/dist/indexer/imports.d.ts +15 -0
  338. package/dist/indexer/imports.d.ts.map +1 -1
  339. package/dist/indexer/imports.js +82 -44
  340. package/dist/indexer/imports.js.map +1 -1
  341. package/dist/indexer/incremental-plan.d.ts +0 -1
  342. package/dist/indexer/incremental-plan.d.ts.map +1 -1
  343. package/dist/indexer/incremental-plan.js +6 -12
  344. package/dist/indexer/incremental-plan.js.map +1 -1
  345. package/dist/indexer/locals-and-exports.d.ts.map +1 -1
  346. package/dist/indexer/locals-and-exports.js +8 -0
  347. package/dist/indexer/locals-and-exports.js.map +1 -1
  348. package/dist/indexer/name-lookup-policies/implicit-self.d.ts.map +1 -1
  349. package/dist/indexer/name-lookup-policies/implicit-self.js +25 -4
  350. package/dist/indexer/name-lookup-policies/implicit-self.js.map +1 -1
  351. package/dist/indexer/name-resolution-types.d.ts +5 -0
  352. package/dist/indexer/name-resolution-types.d.ts.map +1 -1
  353. package/dist/indexer/name-resolution.d.ts.map +1 -1
  354. package/dist/indexer/name-resolution.js +2 -0
  355. package/dist/indexer/name-resolution.js.map +1 -1
  356. package/dist/indexer/navigation-cpp.d.ts.map +1 -1
  357. package/dist/indexer/navigation-cpp.js +3 -5
  358. package/dist/indexer/navigation-cpp.js.map +1 -1
  359. package/dist/indexer/navigation-goto.d.ts +49 -3
  360. package/dist/indexer/navigation-goto.d.ts.map +1 -1
  361. package/dist/indexer/navigation-goto.js +500 -106
  362. package/dist/indexer/navigation-goto.js.map +1 -1
  363. package/dist/indexer/navigation-local.d.ts +7 -0
  364. package/dist/indexer/navigation-local.d.ts.map +1 -1
  365. package/dist/indexer/navigation-local.js +22 -2
  366. package/dist/indexer/navigation-local.js.map +1 -1
  367. package/dist/indexer/navigation-php.d.ts +0 -1
  368. package/dist/indexer/navigation-php.d.ts.map +1 -1
  369. package/dist/indexer/navigation-php.js +1 -7
  370. package/dist/indexer/navigation-php.js.map +1 -1
  371. package/dist/indexer/navigation-references.d.ts +1 -0
  372. package/dist/indexer/navigation-references.d.ts.map +1 -1
  373. package/dist/indexer/navigation-references.js +134 -23
  374. package/dist/indexer/navigation-references.js.map +1 -1
  375. package/dist/indexer/navigation-resolve.d.ts +22 -0
  376. package/dist/indexer/navigation-resolve.d.ts.map +1 -1
  377. package/dist/indexer/navigation-resolve.js +73 -8
  378. package/dist/indexer/navigation-resolve.js.map +1 -1
  379. package/dist/indexer/navigation.d.ts +4 -1
  380. package/dist/indexer/navigation.d.ts.map +1 -1
  381. package/dist/indexer/navigation.js +429 -109
  382. package/dist/indexer/navigation.js.map +1 -1
  383. package/dist/indexer/python-property-decorator.d.ts +11 -0
  384. package/dist/indexer/python-property-decorator.d.ts.map +1 -0
  385. package/dist/indexer/python-property-decorator.js +30 -0
  386. package/dist/indexer/python-property-decorator.js.map +1 -0
  387. package/dist/indexer/reference-context.d.ts.map +1 -1
  388. package/dist/indexer/reference-context.js +4 -1
  389. package/dist/indexer/reference-context.js.map +1 -1
  390. package/dist/indexer/scope-nodes.d.ts.map +1 -1
  391. package/dist/indexer/scope-nodes.js +5 -0
  392. package/dist/indexer/scope-nodes.js.map +1 -1
  393. package/dist/indexer/shared-owner-identity.d.ts +3 -1
  394. package/dist/indexer/shared-owner-identity.d.ts.map +1 -1
  395. package/dist/indexer/shared-owner-identity.js +40 -12
  396. package/dist/indexer/shared-owner-identity.js.map +1 -1
  397. package/dist/indexer/shared.d.ts +10 -0
  398. package/dist/indexer/shared.d.ts.map +1 -1
  399. package/dist/indexer/shared.js +8 -0
  400. package/dist/indexer/shared.js.map +1 -1
  401. package/dist/indexer/star-import-precedence.d.ts +5 -1
  402. package/dist/indexer/star-import-precedence.d.ts.map +1 -1
  403. package/dist/indexer/star-import-precedence.js +12 -19
  404. package/dist/indexer/star-import-precedence.js.map +1 -1
  405. package/dist/indexer/type-hierarchy.d.ts.map +1 -1
  406. package/dist/indexer/type-hierarchy.js +8 -9
  407. package/dist/indexer/type-hierarchy.js.map +1 -1
  408. package/dist/indexer/types.d.ts +54 -2
  409. package/dist/indexer/types.d.ts.map +1 -1
  410. package/dist/indexer/types.js +4 -0
  411. package/dist/indexer/types.js.map +1 -1
  412. package/dist/indexer/workspace-symbols.d.ts.map +1 -1
  413. package/dist/indexer/workspace-symbols.js +3 -13
  414. package/dist/indexer/workspace-symbols.js.map +1 -1
  415. package/dist/installer/locks.d.ts +1 -0
  416. package/dist/installer/locks.d.ts.map +1 -1
  417. package/dist/installer/locks.js +4 -8
  418. package/dist/installer/locks.js.map +1 -1
  419. package/dist/installer/registry.d.ts.map +1 -1
  420. package/dist/installer/registry.js +9 -15
  421. package/dist/installer/registry.js.map +1 -1
  422. package/dist/languages/all.d.ts +1 -0
  423. package/dist/languages/all.d.ts.map +1 -1
  424. package/dist/languages/all.js +1 -0
  425. package/dist/languages/all.js.map +1 -1
  426. package/dist/languages/callable-arity.d.ts.map +1 -1
  427. package/dist/languages/callable-arity.js +1 -38
  428. package/dist/languages/callable-arity.js.map +1 -1
  429. package/dist/languages/definitions/csharp.d.ts.map +1 -1
  430. package/dist/languages/definitions/csharp.js +5 -13
  431. package/dist/languages/definitions/csharp.js.map +1 -1
  432. package/dist/languages/definitions/java.d.ts.map +1 -1
  433. package/dist/languages/definitions/java.js +4 -13
  434. package/dist/languages/definitions/java.js.map +1 -1
  435. package/dist/languages/definitions/kotlin.d.ts.map +1 -1
  436. package/dist/languages/definitions/kotlin.js +4 -8
  437. package/dist/languages/definitions/kotlin.js.map +1 -1
  438. package/dist/languages/definitions/python.d.ts.map +1 -1
  439. package/dist/languages/definitions/python.js +5 -3
  440. package/dist/languages/definitions/python.js.map +1 -1
  441. package/dist/languages/definitions/terraform.d.ts +9 -0
  442. package/dist/languages/definitions/terraform.d.ts.map +1 -0
  443. package/dist/languages/definitions/terraform.js +84 -0
  444. package/dist/languages/definitions/terraform.js.map +1 -0
  445. package/dist/languages/import-statement-parsers.d.ts +0 -30
  446. package/dist/languages/import-statement-parsers.d.ts.map +1 -1
  447. package/dist/languages/import-statement-parsers.js +1 -81
  448. package/dist/languages/import-statement-parsers.js.map +1 -1
  449. package/dist/languages/sfc.d.ts.map +1 -1
  450. package/dist/languages/sfc.js +8 -43
  451. package/dist/languages/sfc.js.map +1 -1
  452. package/dist/languages.d.ts +1 -0
  453. package/dist/languages.d.ts.map +1 -1
  454. package/dist/languages.js +1 -0
  455. package/dist/languages.js.map +1 -1
  456. package/dist/lifecycle/manifest.d.ts.map +1 -1
  457. package/dist/lifecycle/manifest.js +11 -29
  458. package/dist/lifecycle/manifest.js.map +1 -1
  459. package/dist/mcp/handlers.d.ts +21 -0
  460. package/dist/mcp/handlers.d.ts.map +1 -1
  461. package/dist/mcp/handlers.js +66 -20
  462. package/dist/mcp/handlers.js.map +1 -1
  463. package/dist/mcp/http-transport.d.ts.map +1 -1
  464. package/dist/mcp/http-transport.js +5 -1
  465. package/dist/mcp/http-transport.js.map +1 -1
  466. package/dist/mcp/project-watcher.d.ts +125 -0
  467. package/dist/mcp/project-watcher.d.ts.map +1 -0
  468. package/dist/mcp/project-watcher.js +643 -0
  469. package/dist/mcp/project-watcher.js.map +1 -0
  470. package/dist/mcp/server.d.ts.map +1 -1
  471. package/dist/mcp/server.js +5 -1
  472. package/dist/mcp/server.js.map +1 -1
  473. package/dist/native/byte-index.d.ts +1 -0
  474. package/dist/native/byte-index.d.ts.map +1 -1
  475. package/dist/native/byte-index.js +1 -1
  476. package/dist/native/byte-index.js.map +1 -1
  477. package/dist/native/contracts.d.ts +1 -0
  478. package/dist/native/contracts.d.ts.map +1 -1
  479. package/dist/native/native-backend-report.d.ts +2 -1
  480. package/dist/native/native-backend-report.d.ts.map +1 -1
  481. package/dist/native/native-backend-report.js +23 -0
  482. package/dist/native/native-backend-report.js.map +1 -1
  483. package/dist/native/tree-shape.d.ts +5 -7
  484. package/dist/native/tree-shape.d.ts.map +1 -1
  485. package/dist/native/tree-shape.js +11 -10
  486. package/dist/native/tree-shape.js.map +1 -1
  487. package/dist/presentation/bounds.d.ts +2 -0
  488. package/dist/presentation/bounds.d.ts.map +1 -1
  489. package/dist/presentation/bounds.js +8 -0
  490. package/dist/presentation/bounds.js.map +1 -1
  491. package/dist/review/candidates.d.ts.map +1 -1
  492. package/dist/review/candidates.js +4 -25
  493. package/dist/review/candidates.js.map +1 -1
  494. package/dist/review/report.d.ts.map +1 -1
  495. package/dist/review/report.js +4 -2
  496. package/dist/review/report.js.map +1 -1
  497. package/dist/review/summaries.d.ts.map +1 -1
  498. package/dist/review/summaries.js +14 -35
  499. package/dist/review/summaries.js.map +1 -1
  500. package/dist/review.d.ts.map +1 -1
  501. package/dist/review.js +4 -5
  502. package/dist/review.js.map +1 -1
  503. package/dist/scss/navigation.d.ts +13 -0
  504. package/dist/scss/navigation.d.ts.map +1 -0
  505. package/dist/scss/navigation.js +150 -0
  506. package/dist/scss/navigation.js.map +1 -0
  507. package/dist/scss/resolution.d.ts +190 -0
  508. package/dist/scss/resolution.d.ts.map +1 -0
  509. package/dist/scss/resolution.js +1802 -0
  510. package/dist/scss/resolution.js.map +1 -0
  511. package/dist/scss/syntax.d.ts +181 -0
  512. package/dist/scss/syntax.d.ts.map +1 -0
  513. package/dist/scss/syntax.js +1436 -0
  514. package/dist/scss/syntax.js.map +1 -0
  515. package/dist/sql/classify-sql-file.d.ts +7 -0
  516. package/dist/sql/classify-sql-file.d.ts.map +1 -1
  517. package/dist/sql/classify-sql-file.js +9 -0
  518. package/dist/sql/classify-sql-file.js.map +1 -1
  519. package/dist/sql/extract-facts.d.ts.map +1 -1
  520. package/dist/sql/extract-facts.js +517 -77
  521. package/dist/sql/extract-facts.js.map +1 -1
  522. package/dist/sql/lex.d.ts +100 -1
  523. package/dist/sql/lex.d.ts.map +1 -1
  524. package/dist/sql/lex.js +473 -11
  525. package/dist/sql/lex.js.map +1 -1
  526. package/dist/sql/lookup.d.ts +17 -0
  527. package/dist/sql/lookup.d.ts.map +1 -1
  528. package/dist/sql/lookup.js +21 -0
  529. package/dist/sql/lookup.js.map +1 -1
  530. package/dist/sql/navigation.d.ts +28 -1
  531. package/dist/sql/navigation.d.ts.map +1 -1
  532. package/dist/sql/navigation.js +474 -84
  533. package/dist/sql/navigation.js.map +1 -1
  534. package/dist/sql/object-mentions.d.ts +24 -0
  535. package/dist/sql/object-mentions.d.ts.map +1 -0
  536. package/dist/sql/object-mentions.js +233 -0
  537. package/dist/sql/object-mentions.js.map +1 -0
  538. package/dist/sql/review.d.ts +3 -0
  539. package/dist/sql/review.d.ts.map +1 -1
  540. package/dist/sql/review.js +15 -14
  541. package/dist/sql/review.js.map +1 -1
  542. package/dist/sql/routine-mentions.d.ts +61 -0
  543. package/dist/sql/routine-mentions.d.ts.map +1 -0
  544. package/dist/sql/routine-mentions.js +868 -0
  545. package/dist/sql/routine-mentions.js.map +1 -0
  546. package/dist/sql/source-graph.d.ts +18 -3
  547. package/dist/sql/source-graph.d.ts.map +1 -1
  548. package/dist/sql/source-graph.js +109 -32
  549. package/dist/sql/source-graph.js.map +1 -1
  550. package/dist/sqlite/raw-query-worker-pool.d.ts.map +1 -1
  551. package/dist/sqlite/raw-query-worker-pool.js +2 -0
  552. package/dist/sqlite/raw-query-worker-pool.js.map +1 -1
  553. package/dist/sqlite/types.d.ts +6 -5
  554. package/dist/sqlite/types.d.ts.map +1 -1
  555. package/dist/sqlite/write.d.ts.map +1 -1
  556. package/dist/sqlite/write.js.map +1 -1
  557. package/dist/sqlite-driver.d.ts +0 -1
  558. package/dist/sqlite-driver.d.ts.map +1 -1
  559. package/dist/sqlite-driver.js +0 -11
  560. package/dist/sqlite-driver.js.map +1 -1
  561. package/dist/terraform/navigation.d.ts +20 -0
  562. package/dist/terraform/navigation.d.ts.map +1 -0
  563. package/dist/terraform/navigation.js +140 -0
  564. package/dist/terraform/navigation.js.map +1 -0
  565. package/dist/terraform/resolution.d.ts +82 -0
  566. package/dist/terraform/resolution.d.ts.map +1 -0
  567. package/dist/terraform/resolution.js +324 -0
  568. package/dist/terraform/resolution.js.map +1 -0
  569. package/dist/terraform/syntax.d.ts +109 -0
  570. package/dist/terraform/syntax.d.ts.map +1 -0
  571. package/dist/terraform/syntax.js +438 -0
  572. package/dist/terraform/syntax.js.map +1 -0
  573. package/dist/util/ast.d.ts +5 -0
  574. package/dist/util/ast.d.ts.map +1 -1
  575. package/dist/util/ast.js +10 -0
  576. package/dist/util/ast.js.map +1 -1
  577. package/dist/util/atomic-file.d.ts +22 -0
  578. package/dist/util/atomic-file.d.ts.map +1 -0
  579. package/dist/util/atomic-file.js +106 -0
  580. package/dist/util/atomic-file.js.map +1 -0
  581. package/dist/util/collections.d.ts +5 -0
  582. package/dist/util/collections.d.ts.map +1 -1
  583. package/dist/util/collections.js +26 -0
  584. package/dist/util/collections.js.map +1 -1
  585. package/dist/util/concurrency.d.ts +1 -0
  586. package/dist/util/concurrency.d.ts.map +1 -1
  587. package/dist/util/concurrency.js +5 -0
  588. package/dist/util/concurrency.js.map +1 -1
  589. package/dist/util/confined-file.d.ts.map +1 -1
  590. package/dist/util/confined-file.js +1 -3
  591. package/dist/util/confined-file.js.map +1 -1
  592. package/dist/util/csharp-tree.d.ts +65 -0
  593. package/dist/util/csharp-tree.d.ts.map +1 -0
  594. package/dist/util/csharp-tree.js +266 -0
  595. package/dist/util/csharp-tree.js.map +1 -0
  596. package/dist/util/errors.d.ts +1 -0
  597. package/dist/util/errors.d.ts.map +1 -1
  598. package/dist/util/errors.js +3 -0
  599. package/dist/util/errors.js.map +1 -1
  600. package/dist/util/graph-edges.d.ts +2 -0
  601. package/dist/util/graph-edges.d.ts.map +1 -1
  602. package/dist/util/graph-edges.js +11 -0
  603. package/dist/util/graph-edges.js.map +1 -1
  604. package/dist/util/guards.d.ts +1 -0
  605. package/dist/util/guards.d.ts.map +1 -1
  606. package/dist/util/guards.js +6 -0
  607. package/dist/util/guards.js.map +1 -1
  608. package/dist/util/identifiers.d.ts +0 -24
  609. package/dist/util/identifiers.d.ts.map +1 -1
  610. package/dist/util/identifiers.js +0 -24
  611. package/dist/util/identifiers.js.map +1 -1
  612. package/dist/util/jvm-tree.d.ts +58 -0
  613. package/dist/util/jvm-tree.d.ts.map +1 -0
  614. package/dist/util/jvm-tree.js +153 -0
  615. package/dist/util/jvm-tree.js.map +1 -0
  616. package/dist/util/member-access-tables.d.ts.map +1 -1
  617. package/dist/util/member-access-tables.js +3 -0
  618. package/dist/util/member-access-tables.js.map +1 -1
  619. package/dist/util/package-exports.d.ts +0 -22
  620. package/dist/util/package-exports.d.ts.map +1 -1
  621. package/dist/util/package-exports.js +25 -5
  622. package/dist/util/package-exports.js.map +1 -1
  623. package/dist/util/paths.d.ts +1 -0
  624. package/dist/util/paths.d.ts.map +1 -1
  625. package/dist/util/paths.js +10 -4
  626. package/dist/util/paths.js.map +1 -1
  627. package/dist/util/project-files.d.ts.map +1 -1
  628. package/dist/util/project-files.js +3 -1
  629. package/dist/util/project-files.js.map +1 -1
  630. package/dist/util/resolution/csharp.d.ts +20 -8
  631. package/dist/util/resolution/csharp.d.ts.map +1 -1
  632. package/dist/util/resolution/csharp.js +126 -127
  633. package/dist/util/resolution/csharp.js.map +1 -1
  634. package/dist/util/resolution/files.d.ts +6 -0
  635. package/dist/util/resolution/files.d.ts.map +1 -1
  636. package/dist/util/resolution/files.js +74 -21
  637. package/dist/util/resolution/files.js.map +1 -1
  638. package/dist/util/resolution/jvm.d.ts +21 -1
  639. package/dist/util/resolution/jvm.d.ts.map +1 -1
  640. package/dist/util/resolution/jvm.js +168 -100
  641. package/dist/util/resolution/jvm.js.map +1 -1
  642. package/dist/util/resolution/project-symbols.d.ts +1 -1
  643. package/dist/util/resolution/project-symbols.d.ts.map +1 -1
  644. package/dist/util/resolution/project-symbols.js.map +1 -1
  645. package/dist/util/resolution/specifier-targets.d.ts +4 -0
  646. package/dist/util/resolution/specifier-targets.d.ts.map +1 -1
  647. package/dist/util/resolution/specifier-targets.js +16 -3
  648. package/dist/util/resolution/specifier-targets.js.map +1 -1
  649. package/dist/util/resolution/terraform.d.ts +18 -0
  650. package/dist/util/resolution/terraform.d.ts.map +1 -0
  651. package/dist/util/resolution/terraform.js +64 -0
  652. package/dist/util/resolution/terraform.js.map +1 -0
  653. package/dist/util/resolution.d.ts.map +1 -1
  654. package/dist/util/resolution.js +21 -7
  655. package/dist/util/resolution.js.map +1 -1
  656. package/dist/util/syntax-tree.d.ts +16 -0
  657. package/dist/util/syntax-tree.d.ts.map +1 -0
  658. package/dist/util/syntax-tree.js +34 -0
  659. package/dist/util/syntax-tree.js.map +1 -0
  660. package/dist/util/text-scanning.d.ts +6 -0
  661. package/dist/util/text-scanning.d.ts.map +1 -0
  662. package/dist/util/text-scanning.js +35 -0
  663. package/dist/util/text-scanning.js.map +1 -0
  664. package/dist/util/trivia-tables.d.ts +13 -8
  665. package/dist/util/trivia-tables.d.ts.map +1 -1
  666. package/dist/util/trivia-tables.js +13 -63
  667. package/dist/util/trivia-tables.js.map +1 -1
  668. package/dist/util/trivia.d.ts +10 -3
  669. package/dist/util/trivia.d.ts.map +1 -1
  670. package/dist/util/trivia.js +209 -79
  671. package/dist/util/trivia.js.map +1 -1
  672. package/dist/util/windows-process-drain.d.ts.map +1 -1
  673. package/dist/util/windows-process-drain.js.map +1 -1
  674. package/dist/util/worker-threads.d.ts +16 -0
  675. package/dist/util/worker-threads.d.ts.map +1 -1
  676. package/dist/util/worker-threads.js +118 -0
  677. package/dist/util/worker-threads.js.map +1 -1
  678. package/dist/worker/native-worker-pool.d.ts.map +1 -1
  679. package/dist/worker/native-worker-pool.js +2 -1
  680. package/dist/worker/native-worker-pool.js.map +1 -1
  681. package/docs/mcp.md +27 -2
  682. package/package.json +8 -8
@@ -11,7 +11,11 @@ import { DEFAULT_PROJECT_PATTERNS, createProjectDiscoveryContext, discoverProjec
11
11
  import { getGitHead, isGitRepo, getGitBlobHashes, listChangedFiles } from "../util/git.js";
12
12
  import { clearResolutionCaches, loadNearestTsconfigFor, resolveSpecifier, } from "../util/resolution.js";
13
13
  import { collectCppDeclaredModules, isCppNamedModuleSpecifier } from "../util/resolution/cpp.js";
14
- import { resolveJvmPackageImportPaths } from "../util/resolution/jvm.js";
14
+ import { collectCsharpNamespaceFacts } from "../util/csharp-tree.js";
15
+ import { collectJvmFileFacts } from "../util/jvm-tree.js";
16
+ import { isJvmLanguage, readsSyntaxTree } from "../util/syntax-tree.js";
17
+ import { primeCsharpNamespaceFacts } from "../util/resolution/csharp.js";
18
+ import { primeJvmFileFacts, resolveJvmPackageImportPaths } from "../util/resolution/jvm.js";
15
19
  import { loadTsconfigResolutionInputsFor } from "../util/resolution/tsconfig.js";
16
20
  import { resolveModuleSpecifierEdges } from "../graphs/edge-resolution.js";
17
21
  import { fileIdentityKey, initializeFileIdentityCaseSensitivity, isFilePathWithinRoot, normalizePath, } from "../util/paths.js";
@@ -30,7 +34,7 @@ import { collectLocalsAndExportsFromSource } from "./locals-and-exports.js";
30
34
  import { expandStarImports } from "./expand-star-imports.js";
31
35
  import { compareEdges, edgeKey, toRelativeEdge } from "./shared.js";
32
36
  import { BloomFilter, buildBloomFilterFromSource } from "../util/bloom-filter.js";
33
- import { initNativeBackendReport } from "../native/native-backend-report.js";
37
+ import { initNativeBackendReport, recordParserBackendDegradation } from "../native/native-backend-report.js";
34
38
  import { closeDuplicateUnitCacheDatabase } from "../duplicates.js";
35
39
  import { assertNativeRequiredAvailable, isNativeRequiredUnavailableError } from "../native/tree-sitter-native.js";
36
40
  import { isNodeSqliteUnavailableError } from "../sqlite-driver.js";
@@ -39,57 +43,80 @@ import { computeResolverEnvironmentFingerprint } from "./build-cache/resolver-en
39
43
  import { cacheRoot } from "./build-cache/location.js";
40
44
  import { SymbolKind, } from "./types.js";
41
45
  import { isUnsupportedParserInputError } from "../languages/file-prep.js";
46
+ import { isSqlFilePath } from "../sql/classify-sql-file.js";
42
47
  import { buildSqlFactCache, buildSqlModuleIndex, sqlCorpusSignature } from "../sql/source-graph.js";
43
48
  import { finalizeProjectIndex } from "./finalize.js";
44
49
  import { toManifestFileEntry, writeIndexManifestSnapshot } from "./build-manifest.js";
45
- import { prepareFileContextForBuild, countNativeWorkerEligibleFiles, emptyWorkerPoolSetup, setupWorkerPool, teardownWorkerPool, } from "./build-workers.js";
50
+ import { prepareFileContextForBuild, countNativeWorkerEligibleFiles, emptyWorkerPoolSetup, preparedNativeOutcome, setupWorkerPool, teardownWorkerPool, } from "./build-workers.js";
46
51
  import { buildIncrementalGitDiffOptions, canUseIncrementalDiscoveryFastPath, buildTrackedFileReverseDependencies, addedResolutionStems, collectDeletedTrackedFileDependents, collectTrackedFileDependents, collectSpecifierEdgeCandidates, collectPythonPackageImporters, pythonImportersOfPackageInits, externalSpecifierMatchesAddedStem, tsconfigAliasMappedTails, isMissingGitRevisionError, listUntrackedProjectFiles, partitionTrackedManifestFiles, probePathExistence, } from "./incremental-plan.js";
47
52
  import { parsedCacheMaxEntries, setParsedCacheEntry } from "./parsed-cache.js";
48
- function initParserBackendDegradationReport(report) {
49
- if (!report)
50
- return undefined;
51
- initNativeBackendReport(report);
52
- report.backend ??= {
53
- native: {
54
- available: false,
55
- enabled: false,
56
- supportedLanguageIds: [],
57
- filesUsed: 0,
58
- filesFellBack: 0,
59
- fallbackReasons: {
60
- unavailable: 0,
61
- unsupportedLanguage: 0,
62
- queryFailure: 0,
63
- sourceTooLarge: 0,
64
- },
65
- byLanguage: {},
66
- errors: [],
67
- },
68
- };
69
- report.backend.parser ??= {
70
- total: 0,
71
- byLanguage: {},
72
- files: [],
73
- };
74
- return report.backend.parser;
75
- }
76
- function recordParserBackendDegradation(report, entry) {
77
- const parserReport = initParserBackendDegradationReport(report);
78
- if (!parserReport)
79
- return;
80
- parserReport.total += 1;
81
- parserReport.byLanguage[entry.languageId] = (parserReport.byLanguage[entry.languageId] ?? 0) + 1;
82
- if (parserReport.files.length >= 20)
83
- return;
84
- parserReport.files.push(entry);
85
- }
86
53
  function isConfinedFileReadError(error) {
87
54
  return (error instanceof Error &&
88
55
  /outside project root|possible path confinement race|changed between verification and open|confined file target/u.test(error.message));
89
56
  }
57
+ /** A placeholder module. `parseErrorRanges` stays unset: no parser ran, so its parse state is unknown. */
90
58
  function createEmptyModuleIndex(file) {
91
59
  return { file, exports: [], imports: [], locals: [] };
92
60
  }
61
+ /** A file with no language support: nothing is parsed, so it has no parse errors. */
62
+ function unparsedModuleIndex(file) {
63
+ return { ...createEmptyModuleIndex(file), parseErrorRanges: [] };
64
+ }
65
+ /**
66
+ * A file whose processing failed. Its symbols are missing from the index, so it is flagged as parser-degraded: the flag
67
+ * keeps the analysis summary incomplete, and marks a module that is never written to the module cache, so the project
68
+ * snapshot embeds it instead of leaving its stale disk row to be restored.
69
+ */
70
+ function failedModuleIndex(file) {
71
+ return { ...createEmptyModuleIndex(file), parserDegraded: true };
72
+ }
73
+ function collectParseErrorRanges(tree) {
74
+ const columns = tree.columns;
75
+ const isParseErrorNode = (nodeId) => {
76
+ const kind = columns.kinds[columns.kindIds[nodeId]];
77
+ return kind === "ERROR" || columns.isMissing[nodeId] !== 0;
78
+ };
79
+ const ranges = [];
80
+ for (let nodeId = 0; nodeId < columns.nodeCount; nodeId += 1) {
81
+ if (!isParseErrorNode(nodeId))
82
+ continue;
83
+ let parentId = columns.parentIds[nodeId];
84
+ let hasErrorAncestor = false;
85
+ while (parentId >= 0) {
86
+ if (isParseErrorNode(parentId)) {
87
+ hasErrorAncestor = true;
88
+ break;
89
+ }
90
+ parentId = columns.parentIds[parentId];
91
+ }
92
+ if (hasErrorAncestor)
93
+ continue;
94
+ // MISSING nodes are zero-width; prefer a containing statement/declaration, then the nearest non-empty ancestor.
95
+ let rangeNodeId = nodeId;
96
+ if (columns.isMissing[nodeId] !== 0) {
97
+ let ancestorId = columns.parentIds[nodeId];
98
+ let nearestNonZeroAncestorId = -1;
99
+ while (ancestorId >= 0) {
100
+ if (columns.startIndex[ancestorId] !== columns.endIndex[ancestorId]) {
101
+ if (nearestNonZeroAncestorId < 0)
102
+ nearestNonZeroAncestorId = ancestorId;
103
+ const kind = columns.kinds[columns.kindIds[ancestorId]];
104
+ if (kind === "statement" || kind.endsWith("_statement") || kind.endsWith("_declaration")) {
105
+ rangeNodeId = ancestorId;
106
+ break;
107
+ }
108
+ }
109
+ ancestorId = columns.parentIds[ancestorId];
110
+ }
111
+ if (rangeNodeId === nodeId && nearestNonZeroAncestorId >= 0)
112
+ rangeNodeId = nearestNonZeroAncestorId;
113
+ }
114
+ const startIndex = tree.stringIndexForByte(columns.startIndex[rangeNodeId]);
115
+ const endIndex = tree.stringIndexForByte(columns.endIndex[rangeNodeId]);
116
+ ranges.push({ startIndex, endIndex });
117
+ }
118
+ return ranges;
119
+ }
93
120
  /**
94
121
  * Declared-container index (container name to declaring files) rebuilt from already-loaded
95
122
  * modules. Because `ModuleIndex.declaredContainers` is cached with the module, this reflects
@@ -216,6 +243,17 @@ function sortedDeclaredContainerIndex(byName) {
216
243
  function cachedModuleHasExternalImport(mod) {
217
244
  return mod.imports.some((binding) => typeof binding.resolved !== "string");
218
245
  }
246
+ /**
247
+ * Gives the C# namespace scan and the JVM package scan the facts a reused module holds, so they parse nothing for
248
+ * that file. They come from the file's own tree and depend on no other file, so the module's matching signature
249
+ * keeps them valid.
250
+ */
251
+ function primeReusedFileFacts(file, mod, opts) {
252
+ if (mod.csharpNamespaceFacts)
253
+ primeCsharpNamespaceFacts(file, mod.csharpNamespaceFacts, opts?.languageExtensions);
254
+ if (mod.jvmFacts)
255
+ primeJvmFileFacts(file, mod.jvmFacts);
256
+ }
219
257
  /**
220
258
  * Declaration-language files that have a cached row, are not in the build, and no longer exist.
221
259
  * A deleted file leaves no cache miss, so importers that it satisfied would stay stale.
@@ -288,6 +326,16 @@ async function buildIndexedModuleForFile(args) {
288
326
  const prepared = await prepareFileContextForBuild(args.file, args.support, args.opts, args.workerSetup, args.report, args.confinedRoot, args.projectRoot, args.trustedSource, !!args.bloomFilterCache);
289
327
  const { source, sup, nativeQueries, embeddedBlocks } = prepared;
290
328
  let tree;
329
+ // Every degradation recorded below also marks the module, including a failed import extraction of the file's source
330
+ // or of one of its embedded blocks. A later build that reuses the module from a cache has no report of this one, and
331
+ // still counts the file.
332
+ let parserDegraded = false;
333
+ // Set when a lookup over other files, not this file's own extraction, left part of its imports unresolved.
334
+ let importLookupIncomplete = false;
335
+ const recordTreeUnavailable = (entry) => {
336
+ parserDegraded = true;
337
+ recordParserBackendDegradation(args.report, entry);
338
+ };
291
339
  const graphOnlyLanguage = isGraphOnlyLanguage(sup.id), nativeSourceLimitSkip = prepared.nativeFallbackReason === "sourceTooLarge";
292
340
  if (prepared.syntaxTree) {
293
341
  const parsedTree = new ProjectedSyntaxTree(source, prepared.syntaxTree);
@@ -308,7 +356,7 @@ async function buildIndexedModuleForFile(args) {
308
356
  setParsedCacheEntry(args.parsedMap, args.file, parsed, args.parsedCacheMaxEntries);
309
357
  }
310
358
  else {
311
- recordParserBackendDegradation(args.report, {
359
+ recordTreeUnavailable({
312
360
  file: args.file,
313
361
  languageId: prepared.sup.id,
314
362
  ...(parseAttempt.nativeFallbackReason ? { nativeFallbackReason: parseAttempt.nativeFallbackReason } : {}),
@@ -325,7 +373,28 @@ async function buildIndexedModuleForFile(args) {
325
373
  tree = parsed.tree;
326
374
  setParsedCacheEntry(args.parsedMap, args.file, parsed, args.parsedCacheMaxEntries);
327
375
  }
376
+ else {
377
+ recordTreeUnavailable({
378
+ file: args.file,
379
+ languageId: sup.id,
380
+ ...(parseAttempt.nativeFallbackReason ? { nativeFallbackReason: parseAttempt.nativeFallbackReason } : {}),
381
+ ...(parseAttempt.nativeError ? { nativeError: parseAttempt.nativeError } : {}),
382
+ });
383
+ }
384
+ }
385
+ if (sup.id === "sql" && !tree) {
386
+ recordTreeUnavailable({
387
+ file: args.file,
388
+ languageId: sup.id,
389
+ ...(prepared.nativeFallbackReason ? { nativeFallbackReason: prepared.nativeFallbackReason } : {}),
390
+ ...(prepared.nativeError ? { nativeError: prepared.nativeError } : {}),
391
+ });
328
392
  }
393
+ // The package scan reads this file's facts when its own imports resolve, so they are known before then.
394
+ const jvmLanguageId = isJvmLanguage(sup.id) ? sup.id : undefined;
395
+ const jvmFacts = jvmLanguageId && tree ? collectJvmFileFacts(tree, jvmLanguageId) : undefined;
396
+ if (jvmFacts)
397
+ primeJvmFileFacts(args.file, jvmFacts);
329
398
  const lacksParserContext = !graphOnlyLanguage && !nativeQueries;
330
399
  if (args.bloomFilterCache && !nativeSourceLimitSkip) {
331
400
  const filter = prepared.workerBloomFilter
@@ -333,6 +402,12 @@ async function buildIndexedModuleForFile(args) {
333
402
  : buildBloomFilterFromSource(source, sup);
334
403
  args.bloomFilterCache.set(args.file, filter);
335
404
  }
405
+ // A failed extraction leaves this file's imports incomplete, so it marks the module like a missing syntax tree.
406
+ const onDegraded = (cause) => {
407
+ parserDegraded = true;
408
+ if (cause === "lookup")
409
+ importLookupIncomplete = true;
410
+ };
336
411
  // Single builder so an option added here always reaches both the primary source and
337
412
  // every embedded (SFC) block, instead of one path silently missing a future option.
338
413
  const sharedImportOptions = {
@@ -342,12 +417,15 @@ async function buildIndexedModuleForFile(args) {
342
417
  ...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
343
418
  ...(args.opts?.languageExtensions ? { languageExtensions: args.opts.languageExtensions } : {}),
344
419
  ...(args.report ? { report: args.report } : {}),
420
+ parsedFiles: args.parsedMap,
421
+ onDegraded,
345
422
  };
346
423
  const imports = nativeSourceLimitSkip || sup.id === "sql"
347
424
  ? []
348
425
  : await collectImportsForFile(args.file, args.projectRoot, {
349
426
  source,
350
427
  sup,
428
+ ...(readsSyntaxTree(sup.id) && tree ? { tree } : {}),
351
429
  ...(nativeQueries !== undefined ? { nativeQueries } : {}),
352
430
  ...sharedImportOptions,
353
431
  });
@@ -376,11 +454,28 @@ async function buildIndexedModuleForFile(args) {
376
454
  });
377
455
  }
378
456
  mod.imports = imports;
457
+ if (tree instanceof ProjectedSyntaxTree)
458
+ mod.parseErrorRanges = collectParseErrorRanges(tree);
459
+ else if (graphOnlyLanguage)
460
+ mod.parseErrorRanges = [];
461
+ else
462
+ delete mod.parseErrorRanges;
463
+ const nativeOutcome = preparedNativeOutcome(prepared);
464
+ if (nativeOutcome)
465
+ mod.nativeOutcome = nativeOutcome;
466
+ if (parserDegraded)
467
+ mod.parserDegraded = true;
468
+ if (importLookupIncomplete)
469
+ mod.importLookupIncomplete = true;
379
470
  if (sup.id === "cpp") {
380
471
  const declaredContainers = collectCppDeclaredModules(source);
381
472
  if (declaredContainers.length)
382
473
  mod.declaredContainers = declaredContainers;
383
474
  }
475
+ if (sup.id === "csharp" && tree)
476
+ mod.csharpNamespaceFacts = collectCsharpNamespaceFacts(tree);
477
+ if (jvmFacts)
478
+ mod.jvmFacts = jvmFacts;
384
479
  await resolveCrossModuleSymbolExports(args.file, mod, sup, args.projectRoot, args.graphOptions, args.workspaceConfig, args.matchPath);
385
480
  const sigInfo = args.fileSignatures.get(args.file);
386
481
  const cacheable = !prepared.nativeFallbackReason && !lacksParserContext;
@@ -432,6 +527,7 @@ function ensureJsonModule(modules, filePath) {
432
527
  file: normalized,
433
528
  exports: [{ type: "local", exportedAs: "default", target: symbol }],
434
529
  imports: [],
530
+ parseErrorRanges: [],
435
531
  locals: [symbol],
436
532
  });
437
533
  }
@@ -616,7 +712,7 @@ function emitIndexLifecycleProgress(opts, phase, mode, total, elapsedMs) {
616
712
  ...(elapsedMs !== undefined ? { elapsedMs } : {}),
617
713
  });
618
714
  }
619
- function emitIndexCheckStart(opts, activity = "Checking project index") {
715
+ export function emitIndexCheckStart(opts, activity = "Checking project index") {
620
716
  opts?.onProgress?.({
621
717
  type: "progress",
622
718
  phase: "start",
@@ -627,7 +723,7 @@ function emitIndexCheckStart(opts, activity = "Checking project index") {
627
723
  total: 0,
628
724
  });
629
725
  }
630
- function emitIndexCheckActivity(opts, activity, current = 0, total = 0) {
726
+ export function emitIndexCheckActivity(opts, activity, current = 0, total = 0) {
631
727
  opts?.onProgress?.({
632
728
  type: "progress",
633
729
  phase: "update",
@@ -762,7 +858,9 @@ async function buildProjectIndexFromExport(projectRoot, opts, helperOpts) {
762
858
  * - it changed;
763
859
  * - an import or re-export target no longer exists;
764
860
  * - an added file can satisfy one of its specifiers;
765
- * - it resolves imports through namespace or package declarations, and a file it depends on changed.
861
+ * - it resolves imports through namespace or package declarations, and a file it depends on changed;
862
+ * - a lookup of its imports over other files could not read one of them (`importLookupIncomplete`). Nothing records
863
+ * that file when no module covers it, so the file reading again changes no signature, manifest edge, or cache row.
766
864
  *
767
865
  * With a manifest, the manifest gives the previous files and edges.
768
866
  * Without one (a memory cache, or a disk cache that no manifest-writing build has seen),
@@ -773,6 +871,10 @@ async function collectStaleCachedModules(args) {
773
871
  if (!cachedModules.size)
774
872
  return { stale: new Set(), deletedDeclarationFiles: [] };
775
873
  const stale = await cachedModulesWithMissingTargets(cachedModules, args.concurrency);
874
+ for (const [file, { mod }] of cachedModules) {
875
+ if (mod.importLookupIncomplete)
876
+ stale.add(file);
877
+ }
776
878
  const resolvesFromDeclarations = (file) => DECLARATION_RESOLVED_IMPORT_LANGUAGES.has(supportForFileWithoutHeaderSample(file, args.opts?.languageExtensions)?.id ?? "");
777
879
  const loadTsconfigPaths = (importer) => loadTsconfigResolutionInputsFor(importer, args.projectRoot, args.opts?.logLevel).then((inputs) => inputs?.paths);
778
880
  // Deleted declaration files. Only the no-manifest path fills this list.
@@ -1139,11 +1241,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1139
1241
  const conc = edgeProbeConcurrency;
1140
1242
  const languageExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
1141
1243
  const sqlFiles = normalizedFiles
1142
- .filter((file) => {
1143
- if (!languageExtensions)
1144
- return path.extname(file).toLowerCase() === ".sql";
1145
- return supportForFileWithoutHeaderSample(file, languageExtensions)?.id === "sql";
1146
- })
1244
+ .filter((file) => isSqlFilePath(file, languageExtensions))
1147
1245
  .sort((left, right) => left.localeCompare(right));
1148
1246
  const fileSignatures = await prepareFileSignatures({
1149
1247
  projectRoot,
@@ -1161,7 +1259,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1161
1259
  return sqlFactCachePromise;
1162
1260
  };
1163
1261
  const shouldProvideSqlFactCache = (file, sigInfo, cachedEdgesEntry) => {
1164
- if (supportForFileWithoutHeaderSample(file, opts?.languageExtensions)?.id !== "sql")
1262
+ if (!isSqlFilePath(file, opts?.languageExtensions))
1165
1263
  return false;
1166
1264
  if (!cachedEdgesEntry || !sqlCorpusSig || cachedEdgesEntry.sqlCorpusSig !== sqlCorpusSig)
1167
1265
  return true;
@@ -1252,6 +1350,10 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1252
1350
  else
1253
1351
  cacheMissesByState.added.push(file);
1254
1352
  }
1353
+ // The stale check scans package and namespace declarations, so it reads each reused module's own facts
1354
+ // instead of parsing the file again. A module's facts depend only on its own source, which its signature proves.
1355
+ for (const [file, { mod }] of cachedModules)
1356
+ primeReusedFileFacts(file, mod, opts);
1255
1357
  const { stale: staleCachedModules, deletedDeclarationFiles: retiredDeletions } = await collectStaleCachedModules({
1256
1358
  files: normalizedFiles,
1257
1359
  cachedModules,
@@ -1345,6 +1447,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1345
1447
  ...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
1346
1448
  ...(onFileEdges ? { onFileEdges } : {}),
1347
1449
  allFiles: normalizedFiles,
1450
+ parsedFiles: parsedMap,
1348
1451
  ...(sqlFactCache ? { sqlFactCache } : {}),
1349
1452
  });
1350
1453
  if (bloomFilterCache) {
@@ -1364,7 +1467,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1364
1467
  fileReport.parsed = (fileReport.parsed ?? 0) + 1;
1365
1468
  const support = supportForFile(file, opts?.languageExtensions);
1366
1469
  if (!support)
1367
- return [file, createEmptyModuleIndex(file), [], undefined];
1470
+ return [file, unparsedModuleIndex(file), [], undefined];
1368
1471
  ensureBuildProgressStarted();
1369
1472
  let graphContext;
1370
1473
  let cacheWrite;
@@ -1409,6 +1512,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1409
1512
  ...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
1410
1513
  ...(onFileEdges ? { onFileEdges } : {}),
1411
1514
  allFiles: normalizedFiles,
1515
+ parsedFiles: parsedMap,
1412
1516
  ...(sqlFactCache ? { sqlFactCache } : {}),
1413
1517
  });
1414
1518
  return [file, mod ?? createEmptyModuleIndex(file), edges, cacheWrite];
@@ -1423,7 +1527,7 @@ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperO
1423
1527
  }
1424
1528
  recordFileFailure(report, file, error);
1425
1529
  logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
1426
- return [file, createEmptyModuleIndex(file), []];
1530
+ return [file, failedModuleIndex(file), []];
1427
1531
  }
1428
1532
  finally {
1429
1533
  processedFiles += 1;
@@ -2300,6 +2404,8 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2300
2404
  }
2301
2405
  }
2302
2406
  const reverseDeps = buildTrackedFileReverseDependencies(trackedEntries);
2407
+ // Dependents rebuilt only because a file they depend on changed: their own source may be unchanged.
2408
+ const dependentsToPrime = new Set();
2303
2409
  const invalidateCachedDependents = () => {
2304
2410
  const dependentFilesOfChanged = collectTrackedFileDependents(trackedEntries, changedFiles, reverseDeps);
2305
2411
  for (const file of dependentFilesOfChanged) {
@@ -2310,6 +2416,9 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2310
2416
  fileReport.cached = Math.max(0, (fileReport.cached ?? 0) - 1);
2311
2417
  }
2312
2418
  }
2419
+ else if (!changedFiles.has(file)) {
2420
+ dependentsToPrime.add(file);
2421
+ }
2313
2422
  markAsChanged(file);
2314
2423
  }
2315
2424
  };
@@ -2332,8 +2441,22 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2332
2441
  ? await tryLoadPersistedBloomFilters(projectRoot, opts, report)
2333
2442
  : null;
2334
2443
  for (const file of allFiles) {
2335
- if (changedFiles.has(file))
2444
+ if (changedFiles.has(file)) {
2445
+ const dependentLanguage = dependentsToPrime.has(file)
2446
+ ? supportForFileWithoutHeaderSample(file, opts?.languageExtensions)?.id
2447
+ : undefined;
2448
+ if (readsSyntaxTree(dependentLanguage)) {
2449
+ const key = fileIdentityKey(file);
2450
+ const sigInfo = fileSignatures.get(file);
2451
+ const reusable = snapshotModules?.get(key) ??
2452
+ (cacheEnabled
2453
+ ? tryLoadFromCache(projectRoot, file, await moduleCacheSignatureForFile(file, sigInfo, opts, resolverEnvironmentFingerprint), opts)
2454
+ : null);
2455
+ if (reusable)
2456
+ primeReusedFileFacts(file, reusable, opts);
2457
+ }
2336
2458
  continue;
2459
+ }
2337
2460
  const sigInfo = fileSignatures.get(file);
2338
2461
  let cached = null;
2339
2462
  const snapshotMod = snapshotModules?.get(fileIdentityKey(file));
@@ -2344,10 +2467,17 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2344
2467
  const cacheSig = await moduleCacheSignatureForFile(file, sigInfo, opts, resolverEnvironmentFingerprint);
2345
2468
  cached = tryLoadFromCache(projectRoot, file, cacheSig, opts, report);
2346
2469
  }
2347
- if (cached) {
2470
+ if (cached?.importLookupIncomplete) {
2471
+ // See collectStaleCachedModules: extract this importer again. Its own file facts stay valid, so the
2472
+ // project scan reads them from the cached module instead of parsing the file.
2473
+ primeReusedFileFacts(file, cached, opts);
2474
+ changedFiles.add(file);
2475
+ }
2476
+ else if (cached) {
2348
2477
  if (fileReport)
2349
2478
  fileReport.cached = (fileReport.cached ?? 0) + 1;
2350
2479
  modules.set(fileIdentityKey(file), cached);
2480
+ primeReusedFileFacts(file, cached, opts);
2351
2481
  collectJsonDependencies(cached.imports, jsonDependencies);
2352
2482
  if (bloomFilterCache) {
2353
2483
  const persistedFilter = persistedBloomFilters?.get(file, sigInfo);
@@ -2433,7 +2563,7 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2433
2563
  fileReport.parsed = (fileReport.parsed ?? 0) + 1;
2434
2564
  const support = supportForFile(file, opts?.languageExtensions);
2435
2565
  if (!support)
2436
- return [file, createEmptyModuleIndex(file)];
2566
+ return [file, unparsedModuleIndex(file)];
2437
2567
  const matchPath = support.id === "ts" || support.id === "tsx" ? await loadMatchPathForFile(file) : undefined;
2438
2568
  const built = await buildIndexedModuleForFile({
2439
2569
  file,
@@ -2463,7 +2593,7 @@ export async function buildProjectIndexIncremental(projectRoot, rawOpts) {
2463
2593
  }
2464
2594
  recordFileFailure(report, file, error);
2465
2595
  logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
2466
- return [file, createEmptyModuleIndex(file), undefined];
2596
+ return [file, failedModuleIndex(file), undefined];
2467
2597
  }
2468
2598
  finally {
2469
2599
  if (opts?.onProgress) {