@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
@@ -1,16 +1,20 @@
1
1
  import type { LanguageExtensionMap } from "../../languages.js";
2
+ import type { SyntaxNodeLike } from "../../languages/types.js";
3
+ import type { JvmImportDirective } from "../../util/jvm-tree.js";
2
4
  import type { Range } from "../../types.js";
3
5
  import type { CFamilyIncludeForm, RubyLoadForm } from "../../util/specifiers.js";
4
- import type { ImportBinding } from "../types.js";
5
- import type { ImportBindingSink, ImportResolver, ResolvedImportTarget } from "./context.js";
6
+ import type { BuildReport, ImportBinding } from "../types.js";
7
+ import type { ImportBindingSink, ImportDegradedHook, ImportResolver, ResolvedImportTarget } from "./context.js";
8
+ import type { ParsedFileContext } from "../parse-context.js";
6
9
  /**
7
10
  * Per-language import-binding registry for statement overrides and implicit native-capture
8
11
  * mapping. Rows are keyed by language id and live next to `language-specific.ts` because that
9
12
  * file is the only dispatch consumer this wave.
10
13
  *
11
14
  * One row owns the statement handler, the implicit mapper, and the flags those paths used to
12
- * spell as `languageId === "..."` chains: trivia masking, JVM/C# dot normalization, Rust
13
- * statement-key offsets, C# `alwaysAliased` range attribution, and Rust's reduced-mode rescan.
15
+ * spell as `languageId === "..."` chains: trivia masking, Rust statement-key offsets, and Rust's
16
+ * reduced-mode rescan. C# and the JVM languages bind their directives from syntax-tree nodes
17
+ * (`applyCsharpImportDirective`, `applyJvmImportDirective`), so their rows name no statement handler.
14
18
  * `text-import-extractors.ts` stays the shared discovery source; this table does not re-scan.
15
19
  *
16
20
  * `tests/import-binding-tables.test.ts` asserts every registered language has a row, that an
@@ -24,6 +28,10 @@ export type LanguageSpecificImportContext = ImportBindingSink & {
24
28
  resolveFrom: ImportResolver;
25
29
  /** Active extension-to-language mapping, so a resolved file is classified as the language that parses it. */
26
30
  languageExtensions?: LanguageExtensionMap;
31
+ parsedFiles?: ReadonlyMap<string, ParsedFileContext>;
32
+ report?: BuildReport;
33
+ /** Reports that this file's imports are incomplete, so the module that holds them is marked parser-degraded. */
34
+ onDegraded?: ImportDegradedHook;
27
35
  getBindings: () => ImportBinding[];
28
36
  replaceBindings: (bindings: ImportBinding[]) => void;
29
37
  };
@@ -38,17 +46,16 @@ export type ImplicitImportBindingArgs = {
38
46
  alias?: string;
39
47
  /** UTF-16 range of the captured alias token, when the native alias capture proved it. */
40
48
  localRange?: Range;
41
- wildcard?: boolean;
42
49
  includeForm?: CFamilyIncludeForm;
43
50
  rubyLoadForm?: RubyLoadForm;
44
51
  };
45
52
  export type ApplyStatementImportOverride = (context: LanguageSpecificImportContext, parserStmt: string, typeOnly: boolean, statementStartIndex?: number) => Promise<boolean>;
46
53
  export type AppendImplicitImportBinding = (context: LanguageSpecificImportContext, args: ImplicitImportBindingArgs) => void;
47
54
  /**
48
- * How a statement override prepares text before the parser: mask trivia, mask only PHP `use`
49
- * statements (includes keep string payloads), or leave the trimmed source untouched (Rust).
55
+ * How a statement override prepares text before the parser: mask only PHP `use` statements
56
+ * (includes keep string payloads), or leave the trimmed source untouched (Rust).
50
57
  */
51
- export type StatementTriviaMask = true | false | "use-keyword";
58
+ export type StatementTriviaMask = false | "use-keyword";
52
59
  export type ImportBindingRow = {
53
60
  /** Why the language has no statement override and no implicit mapper. */
54
61
  omittedReason?: string;
@@ -56,15 +63,11 @@ export type ImportBindingRow = {
56
63
  appendImplicit?: AppendImplicitImportBinding;
57
64
  /** Present only with `applyStatement`. */
58
65
  maskTrivia?: StatementTriviaMask;
59
- /** Collapse whitespace around `.` after masking (C#, Java, Kotlin). */
60
- normalizeDots?: true;
61
66
  /**
62
- * Include the statement start offset in the override de-dupe key (C#, Rust). Required when the
67
+ * Include the statement start offset in the override de-dupe key (Rust). Required when the
63
68
  * same statement text can appear in several scopes and each must keep its own range.
64
69
  */
65
70
  statementKeyUsesOffset?: true;
66
- /** Named-range attribution treats unaliased `local === imported` as two tokens (C#). */
67
- alwaysAliased?: true;
68
71
  /** Reduced-mode text bindings re-run even when native already produced some (Rust). */
69
72
  rescanTextBindings?: true;
70
73
  /** Why the language declares no statement override. */
@@ -72,5 +75,17 @@ export type ImportBindingRow = {
72
75
  /** Why the language declares no implicit mapper. */
73
76
  implicitOmittedReason?: string;
74
77
  };
78
+ /**
79
+ * Binds one C# `using` or `extern alias` directive. The node comes from `collectCsharpImportDirectives`, so the
80
+ * directive is never found again by its text or offset. C# has no type-only imports.
81
+ */
82
+ export declare function applyCsharpImportDirective(context: LanguageSpecificImportContext, directive: SyntaxNodeLike): Promise<void>;
83
+ /**
84
+ * Binds one Java or Kotlin `import`. The directive comes from `collectJvmImportDirectives`, so its ranges are its
85
+ * nodes' own and it is never found again by its text or offset. Neither language has type-only imports. Every form
86
+ * resolves `directive.from`, the name its dependency edge resolves too: the type, the owner of a static member, or the
87
+ * package or type of a wildcard.
88
+ */
89
+ export declare function applyJvmImportDirective(context: LanguageSpecificImportContext, { from, leaf, isStatic, wildcard, alias }: JvmImportDirective): Promise<void>;
75
90
  export declare const IMPORT_BINDING_ROWS: Record<string, ImportBindingRow>;
76
91
  //# sourceMappingURL=import-binding-tables.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"import-binding-tables.d.ts","sourceRoot":"","sources":["../../../src/indexer/imports/import-binding-tables.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAO/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE5F;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,GAAG;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,cAAc,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,OAAO,EAAE,6BAA6B,EACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,mBAAmB,CAAC,EAAE,MAAM,KACzB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,yBAAyB,KAC5B,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,KAAK,GAAG,aAAa,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,0CAA0C;IAC1C,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,uEAAuE;IACvE,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC9B,wFAAwF;IACxF,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAwmBF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA2FhE,CAAC"}
1
+ {"version":3,"file":"import-binding-tables.d.ts","sourceRoot":"","sources":["../../../src/indexer/imports/import-binding-tables.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAUjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,GAAG;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,cAAc,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gHAAgH;IAChH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,OAAO,EAAE,6BAA6B,EACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,mBAAmB,CAAC,EAAE,MAAM,KACzB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,yBAAyB,KAC5B,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,aAAa,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,0CAA0C;IAC1C,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC9B,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AA8DF;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,6BAA6B,EACtC,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAoKf;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,EACtC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,GAC5D,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAiSD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAwFhE,CAAC"}
@@ -1,20 +1,52 @@
1
- import { parseCsharpUsingDirective, parseJavaImportStatement, parseKotlinImportStatement, parsePhpImportStatement, parseRustImportStatements, rustImportKeywordOffset, } from "../../languages/import-statement-parsers.js";
2
- import { CSHARP_IDENTIFIER_SOURCE, normalizeCsharpQualifiedName } from "../../util/identifiers.js";
1
+ import { parsePhpImportStatement, parseRustImportStatements, rustImportKeywordOffset, } from "../../languages/import-statement-parsers.js";
2
+ import { csharpExternAlias, csharpUsingDirective } from "../../util/csharp-tree.js";
3
+ import { isJvmLanguage } from "../../util/syntax-tree.js";
4
+ import { toRange } from "../../util/ast.js";
5
+ import { normalizeCsharpIdentifier, normalizeCsharpQualifiedName } from "../../util/identifiers.js";
3
6
  import { isRustCfgTestStatement } from "../../util/rust-test-modules.js";
4
7
  import { resolveCsharpDottedTypeImportPath, resolveCsharpNamespaceImportPaths } from "../../util/resolution/csharp.js";
8
+ import { lookupJvmImport } from "../../util/resolution/jvm.js";
5
9
  import { extractRustModPathAttribute } from "../../util/resolution/rust.js";
6
10
  import { collectLineStartOffsets } from "../../util/lines.js";
7
11
  import { attributeNamedBindingRanges, maskImportBindingTrivia, sourceRangeFromOffsets } from "./binding-ranges.js";
8
- function pushCsharpOverride(context, parsed, typeOnly, fromValue, resolved) {
12
+ function csharpNodeRange(node, source, lineStarts) {
13
+ let startIndex = node.startIndex;
14
+ if (startIndex && source[startIndex - 1] === "@")
15
+ startIndex -= 1;
16
+ return sourceRangeFromOffsets(lineStarts, startIndex, node.endIndex);
17
+ }
18
+ function csharpAliasTargetLeaf(node) {
19
+ if (node.type === "identifier" || node.type === "predefined_type")
20
+ return node;
21
+ // A generic name is its identifier followed by type arguments; only the identifier names the target.
22
+ if (node.type === "generic_name")
23
+ return node.namedChildren.find((child) => child.type === "identifier") ?? null;
24
+ if (node.type === "qualified_name" || node.type === "alias_qualified_name") {
25
+ const name = node.childForFieldName("name");
26
+ if (name)
27
+ return csharpAliasTargetLeaf(name);
28
+ }
29
+ for (let index = node.namedChildren.length - 1; index >= 0; index -= 1) {
30
+ const leaf = csharpAliasTargetLeaf(node.namedChildren[index]);
31
+ if (leaf)
32
+ return leaf;
33
+ }
34
+ return null;
35
+ }
36
+ function pushCsharpOverride(context, parsed, directiveStartIndex, typeOnly, fromValue, resolved, localRange, importedRange) {
9
37
  if (parsed.alias) {
10
- const fromParts = parsed.from.split(".");
11
- const imported = fromParts[fromParts.length - 1] ?? parsed.alias;
38
+ const localStart = localRange?.start.index;
39
+ const importedStart = importedRange?.start.index;
40
+ const local = localStart === undefined ? parsed.alias.text : context.source.slice(localStart, parsed.alias.endIndex);
41
+ const imported = importedStart === undefined ? parsed.leaf.text : context.source.slice(importedStart, parsed.leaf.endIndex);
12
42
  context.pushBinding({
13
43
  kind: "named",
14
- local: parsed.alias,
44
+ local,
15
45
  imported,
16
46
  from: fromValue,
17
47
  explicitAlias: true,
48
+ ...(localRange ? { localRange } : {}),
49
+ ...(importedRange ? { importedRange } : {}),
18
50
  resolved,
19
51
  typeOnly,
20
52
  });
@@ -25,112 +57,129 @@ function pushCsharpOverride(context, parsed, typeOnly, fromValue, resolved) {
25
57
  from: fromValue,
26
58
  resolved,
27
59
  typeOnly,
60
+ csharpDirectiveStartIndex: directiveStartIndex,
28
61
  });
29
62
  }
30
- const CSHARP_EXTERN_ALIAS_PATTERN = new RegExp(String.raw `^extern\s+alias\s+(${CSHARP_IDENTIFIER_SOURCE})\s*;$`, "u");
31
- function csharpUsingAliasLocalRange(source, statementStartIndex, alias) {
32
- if (statementStartIndex === undefined || !alias)
33
- return undefined;
34
- // Comments and string literals can carry `;` and sit between the alias and `=`
35
- // (`using X /* ; */ = P;`), so both the statement boundary and the alias match run over
36
- // trivia-masked text. Masking is one-for-one with the raw source (masked units become
37
- // spaces, newlines survive), so every match offset is the raw-source offset.
38
- const masked = maskImportBindingTrivia(source.slice(statementStartIndex), "csharp");
39
- const semicolon = masked.indexOf(";");
40
- const window = semicolon < 0 ? masked : masked.slice(0, semicolon + 1);
41
- const escaped = alias.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
42
- const match = window.match(new RegExp(`\\busing\\s+(${escaped})\\s*=`));
43
- if (!match || match.index === undefined)
44
- return undefined;
45
- const aliasOffset = match[0].lastIndexOf(alias);
46
- if (aliasOffset < 0)
47
- return undefined;
48
- const start = statementStartIndex + match.index + aliasOffset;
49
- return sourceRangeFromOffsets(collectLineStartOffsets(source), start, start + alias.length);
50
- }
51
- async function applyCsharpStatementOverride(context, normalizedStmt, typeOnly, statementStartIndex) {
52
- const externAlias = normalizedStmt.match(CSHARP_EXTERN_ALIAS_PATTERN)?.[1];
63
+ /**
64
+ * Binds one C# `using` or `extern alias` directive. The node comes from `collectCsharpImportDirectives`, so the
65
+ * directive is never found again by its text or offset. C# has no type-only imports.
66
+ */
67
+ export async function applyCsharpImportDirective(context, directive) {
68
+ const typeOnly = false;
69
+ const externAlias = csharpExternAlias(directive);
53
70
  if (externAlias) {
54
- // `extern alias X;` names a compiler-provided alias for an assembly's extern alias. It has no
55
- // first-party or package target, so it stays an unresolved namespace binding and produces no
56
- // dependency edge: the graph query does not treat it as an import specifier.
71
+ // An extern alias names a compiler-provided assembly alias, so it remains unresolved and
72
+ // does not produce a dependency edge: the graph query does not treat it as an import.
57
73
  context.pushBinding({ kind: "namespace", localNS: externAlias, from: externAlias });
58
- return true;
74
+ return;
59
75
  }
60
- const parsed = parseCsharpUsingDirective(normalizedStmt);
61
- if (!parsed)
62
- return false;
63
- // `using static N.T;` imports the static members and nested types of one type. Bind it to the
64
- // file that declares `T` only when exactly one file does; otherwise it stays external. A
65
- // `global using static` applies to every file of the project, which module-local bindings
66
- // cannot express, so it is not bound.
67
- if (parsed.isStatic && !/^global\s/u.test(normalizedStmt.trim())) {
68
- const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.from, context.file, context.languageExtensions);
69
- const qualifiedType = normalizeCsharpQualifiedName(parsed.from).replace(/^global::/u, "");
70
- if (typeMatch.status === "found" && qualifiedType.includes(".")) {
76
+ const parsed = csharpUsingDirective(directive);
77
+ if (!parsed) {
78
+ const alias = directive.childForFieldName("name");
79
+ if (alias?.type === "identifier") {
80
+ const target = directive.namedChildren.find((child) => child !== alias && child.type !== "comment");
81
+ if (target) {
82
+ const leaf = csharpAliasTargetLeaf(target) ?? target;
83
+ const unresolved = {
84
+ value: target.text,
85
+ leaf,
86
+ rawValue: target.text,
87
+ alias,
88
+ isStatic: false,
89
+ isGlobal: false,
90
+ };
91
+ const lineStarts = collectLineStartOffsets(context.source);
92
+ // The binding stays unresolved, so it cannot restore a target token it claims: only the alias
93
+ // name is a binding token, and every name in the target remains an ordinary reference.
94
+ pushCsharpOverride(context, unresolved, directive.startIndex, typeOnly, unresolved.value, { external: unresolved.value }, csharpNodeRange(alias, context.source, lineStarts));
95
+ }
96
+ return;
97
+ }
98
+ return;
99
+ }
100
+ const lineStarts = parsed.alias ? collectLineStartOffsets(context.source) : undefined;
101
+ const localRange = parsed.alias && lineStarts ? csharpNodeRange(parsed.alias, context.source, lineStarts) : undefined;
102
+ const importedRange = parsed.alias && lineStarts ? csharpNodeRange(parsed.leaf, context.source, lineStarts) : undefined;
103
+ // Static imports bind to a declaring type only when exactly one file owns that type. A global
104
+ // static using applies to the whole project, which module-local bindings cannot express.
105
+ if (parsed.isStatic && !parsed.isGlobal) {
106
+ const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
107
+ // `partial`: a C# file of the project could not be read, so it may declare the type too and the binding stays
108
+ // external. The module records that, so a later build resolves it again once every file reads.
109
+ if (typeMatch.status === "partial")
110
+ context.onDegraded?.("lookup");
111
+ const qualifiedType = normalizeCsharpQualifiedName(parsed.value).replace(/^global::/u, "");
112
+ if (typeMatch.status === "found" && !typeMatch.parts && qualifiedType.includes(".")) {
71
113
  context.pushBinding({
72
114
  kind: "star",
73
- from: parsed.from,
115
+ from: parsed.value,
74
116
  resolved: typeMatch.file.replace(/\\/g, "/"),
75
117
  typeOnly,
76
118
  staticMembersOf: qualifiedType,
77
119
  });
78
- return true;
120
+ return;
79
121
  }
122
+ context.pushBinding({
123
+ kind: "star",
124
+ from: parsed.rawValue,
125
+ resolved: { external: parsed.rawValue },
126
+ typeOnly,
127
+ });
128
+ return;
80
129
  }
81
- // A target that is itself a declared namespace is a namespace alias, even when the alias is
82
- // written in alias form. Resolving it here keeps the local name a namespace so member
83
- // navigation can reach the declaring file instead of treating the last segment as a type.
84
- // A namespace split across several files has no single target, so it keeps the local alias
85
- // as an unresolved namespace rather than claiming one of the declaring files.
86
- const namespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, parsed.from, context.file, context.languageExtensions);
130
+ // A target declared as a namespace remains a namespace alias, even when written with alias
131
+ // syntax. Ambiguous namespaces stay unresolved rather than claiming one declaring file.
132
+ const namespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
87
133
  if (parsed.alias && namespaceTargets.length) {
88
- const localRange = csharpUsingAliasLocalRange(context.source, statementStartIndex, parsed.alias);
89
134
  context.pushBinding({
90
135
  kind: "namespace",
91
- localNS: parsed.alias,
92
- from: parsed.from,
136
+ localNS: normalizeCsharpIdentifier(parsed.alias.text),
137
+ from: parsed.value,
93
138
  ...(namespaceTargets.length === 1 ? { resolved: namespaceTargets[0].replace(/\\/g, "/") } : {}),
94
139
  typeOnly,
95
140
  ...(localRange ? { localRange } : {}),
96
141
  });
97
- return true;
142
+ return;
143
+ }
144
+ let fromValue = parsed.value;
145
+ // A plain using names a namespace, which ordinary C# declares across many files. Bind it to a
146
+ // representative declaring file; namespace-qualified export lookup reaches all files through
147
+ // the compilation-unit relation. Path-like resolution applies only when no file declares it.
148
+ let resolved;
149
+ if (parsed.alias) {
150
+ resolved = await context.resolveFrom(fromValue);
151
+ }
152
+ else if (namespaceTargets.length) {
153
+ resolved = namespaceTargets[0].replace(/\\/g, "/");
154
+ }
155
+ else {
156
+ resolved = await context.resolveFrom(fromValue);
98
157
  }
99
- let fromValue = parsed.from;
100
- // `using N;` names a namespace, which ordinary C# declares across many files. Bind it to the
101
- // first declaring file: lookups through the binding qualify the name with `N`, and
102
- // namespace-qualified export lookup reaches every file that declares `N` through the
103
- // compilation-unit relation. Path-like resolution applies only when no file declares `N`, and
104
- // only to a C# file.
105
- let resolved = !parsed.alias && namespaceTargets.length
106
- ? namespaceTargets[0].replace(/\\/g, "/")
107
- : await context.resolveFrom(fromValue);
108
158
  if (parsed.alias) {
109
- const fromParts = parsed.from.split(".");
159
+ const fromParts = parsed.value.split(".");
110
160
  if (fromParts.length > 1) {
111
161
  const fallbackFrom = fromParts.slice(0, -1).join(".");
112
162
  if (fallbackFrom) {
113
- // The full path isn't itself a declared namespace (checked above): `using PT = N.Point;`
114
- // names a TYPE (`Point`) inside namespace `N`. A namespace that lives in one file can
115
- // use that file directly. When several files declare it, the type name is resolved
116
- // across all of them (partial parts share one owner). An ambiguous set stays external
117
- // instead of keeping a path-like first match such as `N/Point.cs`.
118
- const fallbackNamespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, fallbackFrom, context.file, context.languageExtensions);
119
- if (fallbackNamespaceTargets.length > 1) {
120
- const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.from, context.file, context.languageExtensions);
163
+ // A type alias names a type in a namespace. Resolve the type across every namespace file; any
164
+ // result but one proven declaration stays external instead of selecting a path-like first match
165
+ // or the namespace's file.
166
+ const fallbackNamespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, fallbackFrom, context.file, context.languageExtensions, context.report, context.parsedFiles);
167
+ const namespaceDeclared = fallbackNamespaceTargets.length > 1 ||
168
+ (fallbackNamespaceTargets.length === 1 && typeof resolved !== "string");
169
+ if (namespaceDeclared) {
170
+ const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
171
+ // `partial` leaves the alias external and marks the module, as for a static using.
172
+ if (typeMatch.status === "partial")
173
+ context.onDegraded?.("lookup");
121
174
  if (typeMatch.status === "found") {
122
175
  fromValue = fallbackFrom;
123
176
  resolved = typeMatch.file;
124
177
  }
125
178
  else {
126
- fromValue = parsed.from;
127
- resolved = { external: parsed.from };
179
+ fromValue = parsed.value;
180
+ resolved = { external: parsed.value };
128
181
  }
129
182
  }
130
- else if (typeof resolved !== "string" && fallbackNamespaceTargets.length === 1) {
131
- fromValue = fallbackFrom;
132
- resolved = fallbackNamespaceTargets[0].replace(/\\/g, "/");
133
- }
134
183
  else if (typeof resolved !== "string") {
135
184
  const fallbackResolved = await context.resolveFrom(fallbackFrom);
136
185
  if (typeof fallbackResolved === "string") {
@@ -141,56 +190,57 @@ async function applyCsharpStatementOverride(context, normalizedStmt, typeOnly, s
141
190
  }
142
191
  }
143
192
  }
144
- pushCsharpOverride(context, parsed, typeOnly, fromValue, resolved);
145
- return true;
193
+ pushCsharpOverride(context, parsed, directive.startIndex, typeOnly, fromValue, resolved, localRange, importedRange);
146
194
  }
147
- async function applyJavaStatementOverride(context, normalizedStmt, typeOnly) {
148
- return await applyJvmStatementOverride(context, normalizedStmt, typeOnly, parseJavaImportStatement, (parsed) => {
149
- if (parsed.kind === "named")
150
- return parsed.imported;
151
- return undefined;
152
- });
153
- }
154
- async function applyKotlinStatementOverride(context, normalizedStmt, typeOnly) {
155
- return await applyJvmStatementOverride(context, normalizedStmt, typeOnly, parseKotlinImportStatement, (parsed) => {
156
- if (parsed.kind === "named")
157
- return parsed.local;
158
- return undefined;
159
- });
160
- }
161
- async function applyJvmStatementOverride(context, normalizedStmt, typeOnly, parseStatement, localNameFor) {
162
- const parsed = parseStatement(normalizedStmt);
163
- if (!parsed)
164
- return false;
165
- return await pushJvmImportBinding(context, parsed, localNameFor(parsed), typeOnly);
166
- }
167
- async function pushJvmImportBinding(context, parsed, local, typeOnly) {
168
- const resolved = await context.resolveFrom(parsed.from, undefined, parsed.kind === "star" && !parsed.isStatic ? { jvmPackageWildcard: true } : undefined);
169
- if (parsed.kind === "star") {
195
+ /**
196
+ * Binds one Java or Kotlin `import`. The directive comes from `collectJvmImportDirectives`, so its ranges are its
197
+ * nodes' own and it is never found again by its text or offset. Neither language has type-only imports. Every form
198
+ * resolves `directive.from`, the name its dependency edge resolves too: the type, the owner of a static member, or the
199
+ * package or type of a wildcard.
200
+ */
201
+ export async function applyJvmImportDirective(context, { from, leaf, isStatic, wildcard, alias }) {
202
+ const packageWildcard = wildcard && !isStatic;
203
+ const resolved = await context.resolveFrom(from, undefined, packageWildcard ? { jvmPackageWildcard: true } : undefined);
204
+ // A file that was not read in full may declare what an import names, and a file whose package could not be read may
205
+ // be one of a package's files. The module records that, so a later build resolves the import again once every file
206
+ // reads. A resolved import names a file that proves it, except a package wildcard, which names every file of its
207
+ // package.
208
+ if (isJvmLanguage(context.languageId)) {
209
+ const lookupOptions = { languageId: context.languageId, fromFile: context.file };
210
+ let incomplete = false;
211
+ if (packageWildcard) {
212
+ incomplete = (await lookupJvmImport(context.projectRoot, `${from}.*`, lookupOptions)).incomplete;
213
+ }
214
+ if (!incomplete && typeof resolved !== "string") {
215
+ incomplete = (await lookupJvmImport(context.projectRoot, from, lookupOptions)).incomplete;
216
+ }
217
+ if (incomplete)
218
+ context.onDegraded?.("lookup");
219
+ }
220
+ const owner = from.slice(from.lastIndexOf(".") + 1);
221
+ if (wildcard) {
170
222
  context.pushBinding({
171
223
  kind: "star",
172
- from: parsed.from,
224
+ from,
173
225
  resolved,
174
- ...(parsed.isStatic
175
- ? { jvmStaticWildcardName: parsed.from.slice(parsed.from.lastIndexOf(".") + 1) }
176
- : { jvmTypeWildcardName: parsed.from.slice(parsed.from.lastIndexOf(".") + 1) }),
177
- typeOnly,
226
+ ...(isStatic ? { jvmStaticWildcardName: owner } : { jvmTypeWildcardName: owner }),
227
+ typeOnly: false,
178
228
  });
179
- return true;
229
+ return;
180
230
  }
231
+ const importedRange = toRange(leaf);
181
232
  context.pushBinding({
182
233
  kind: "named",
183
- local: local ?? parsed.imported,
184
- imported: parsed.imported,
185
- from: parsed.from,
186
- ...(parsed.isStatic && context.languageId === "java"
187
- ? { jvmStaticWildcardName: parsed.from.slice(parsed.from.lastIndexOf(".") + 1) }
188
- : {}),
189
- ...(parsed.explicitAlias ? { explicitAlias: true } : {}),
234
+ local: alias?.text ?? leaf.text,
235
+ imported: leaf.text,
236
+ from,
237
+ ...(isStatic ? { jvmStaticWildcardName: owner } : {}),
238
+ ...(alias ? { explicitAlias: true } : {}),
239
+ importedRange,
240
+ localRange: alias ? toRange(alias) : importedRange,
190
241
  resolved,
191
- typeOnly,
242
+ typeOnly: false,
192
243
  });
193
- return true;
194
244
  }
195
245
  async function applyRustStatementOverride(context, normalizedStmt, typeOnly, statementStartIndex) {
196
246
  if (isRustTestOnlyStatement(context, normalizedStmt, statementStartIndex))
@@ -290,7 +340,7 @@ async function applyPhpStatementOverride(context, normalizedStmt, typeOnly) {
290
340
  }
291
341
  return true;
292
342
  }
293
- function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, source, alwaysAliased) {
343
+ function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, source) {
294
344
  if (stmtStartIndex !== undefined && source !== undefined) {
295
345
  attributeNamedBindingRanges({
296
346
  bindings: [binding],
@@ -298,31 +348,10 @@ function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, so
298
348
  text: maskImportBindingTrivia(stmtText, context.languageId),
299
349
  textStartIndex: stmtStartIndex,
300
350
  source,
301
- ...(alwaysAliased !== undefined ? { alwaysAliased } : {}),
302
351
  });
303
352
  }
304
353
  context.pushBinding(binding);
305
354
  }
306
- function appendJavaImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source }) {
307
- const parts = from.split(".");
308
- const last = parts[parts.length - 1];
309
- if (last === "*") {
310
- context.pushBinding({ kind: "star", from, resolved, typeOnly });
311
- }
312
- else if (last) {
313
- pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source, undefined);
314
- }
315
- }
316
- function appendCsharpImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source, alias }) {
317
- if (alias) {
318
- const fromParts = from.split(".");
319
- const imported = fromParts[fromParts.length - 1] ?? alias;
320
- pushNamedImplicitBinding(context, { kind: "named", local: alias, imported, from, explicitAlias: true, resolved, typeOnly }, stmtText, stmtStartIndex, source, IMPORT_BINDING_ROWS.csharp.alwaysAliased);
321
- }
322
- else {
323
- context.pushBinding({ kind: "star", from, resolved, typeOnly });
324
- }
325
- }
326
355
  function appendRubyImplicitBinding(context, { from, resolved, rubyLoadForm }) {
327
356
  context.pushBinding({ kind: "star", from, resolved, ...(rubyLoadForm ? { rubyLoadForm } : {}) });
328
357
  }
@@ -355,29 +384,10 @@ function appendRustImplicitBinding(context, { from, resolved, stmtText, stmtStar
355
384
  context.pushBinding({ kind: "star", from, resolved });
356
385
  }
357
386
  else {
358
- pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved }, stmtText, stmtStartIndex, source, undefined);
387
+ pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved }, stmtText, stmtStartIndex, source);
359
388
  }
360
389
  }
361
390
  }
362
- function appendKotlinImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source, alias, wildcard }) {
363
- if (wildcard || from.endsWith(".*")) {
364
- context.pushBinding({ kind: "star", from, resolved, typeOnly });
365
- }
366
- else {
367
- const parts = from.split(".");
368
- const imported = parts[parts.length - 1];
369
- if (imported)
370
- pushNamedImplicitBinding(context, {
371
- kind: "named",
372
- local: alias ?? imported,
373
- imported,
374
- from,
375
- ...(alias !== undefined ? { explicitAlias: true } : {}),
376
- resolved,
377
- typeOnly,
378
- }, stmtText, stmtStartIndex, source, undefined);
379
- }
380
- }
381
391
  function swiftModuleLocalRange(source, statementStartIndex, statementText, name) {
382
392
  if (!source || statementStartIndex === undefined || !name)
383
393
  return undefined;
@@ -420,7 +430,7 @@ function appendSwiftImplicitBinding(context, { from, resolved, typeOnly, stmtTex
420
430
  context.pushBinding({ kind: "star", from, resolved, typeOnly });
421
431
  }
422
432
  else {
423
- pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source, undefined);
433
+ pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source);
424
434
  }
425
435
  }
426
436
  function appendZigImplicitBinding(context, { from, resolved, typeOnly, alias, localRange }) {
@@ -461,13 +471,8 @@ export const IMPORT_BINDING_ROWS = {
461
471
  },
462
472
  css: { omittedReason: STYLESHEET_OMITTED },
463
473
  csharp: {
464
- applyStatement: applyCsharpStatementOverride,
465
- appendImplicit: appendCsharpImplicitBinding,
466
- maskTrivia: true,
467
- normalizeDots: true,
468
- alwaysAliased: true,
469
- // `using X = P;` in two namespace blocks is two scoped aliases, each with its own range.
470
- statementKeyUsesOffset: true,
474
+ statementOmittedReason: "C# using directives are bound from syntax-tree nodes by applyCsharpImportDirective, not from statement text.",
475
+ implicitOmittedReason: "C# using directives are bound from syntax-tree nodes; no native capture is mapped.",
471
476
  },
472
477
  go: {
473
478
  appendImplicit: appendGoImplicitBinding,
@@ -476,20 +481,16 @@ export const IMPORT_BINDING_ROWS = {
476
481
  hbs: { omittedReason: "Handlebars document format; embedded scripts parse as their own language." },
477
482
  html: { omittedReason: "Document format; embedded scripts parse as their own language." },
478
483
  java: {
479
- applyStatement: applyJavaStatementOverride,
480
- appendImplicit: appendJavaImplicitBinding,
481
- maskTrivia: true,
482
- normalizeDots: true,
484
+ statementOmittedReason: "Java imports are bound from syntax-tree nodes by applyJvmImportDirective, not from statement text.",
485
+ implicitOmittedReason: "Java imports are bound from syntax-tree nodes; no native capture is mapped.",
483
486
  },
484
487
  js: {
485
488
  statementOmittedReason: ECMASCRIPT_STATEMENT_OMITTED,
486
489
  implicitOmittedReason: ECMASCRIPT_IMPLICIT_OMITTED,
487
490
  },
488
491
  kotlin: {
489
- applyStatement: applyKotlinStatementOverride,
490
- appendImplicit: appendKotlinImplicitBinding,
491
- maskTrivia: true,
492
- normalizeDots: true,
492
+ statementOmittedReason: "Kotlin imports are bound from syntax-tree nodes by applyJvmImportDirective, not from statement text.",
493
+ implicitOmittedReason: "Kotlin imports are bound from syntax-tree nodes; no native capture is mapped.",
493
494
  },
494
495
  less: { omittedReason: STYLESHEET_OMITTED },
495
496
  markdown: { omittedReason: "Document format; fenced code blocks parse as their own language." },
@@ -516,6 +517,9 @@ export const IMPORT_BINDING_ROWS = {
516
517
  },
517
518
  scss: { omittedReason: STYLESHEET_OMITTED },
518
519
  sql: { omittedReason: "Data language; no import-statement or implicit-binding dispatch." },
520
+ terraform: {
521
+ omittedReason: "A module call binds no local names; `module.<name>` resolves in src/terraform/.",
522
+ },
519
523
  svelte: { omittedReason: "Svelte component format; script blocks parse as js/ts and templates as html." },
520
524
  swift: {
521
525
  appendImplicit: appendSwiftImplicitBinding,