@colbymchenry/codegraph-win32-arm64 1.6.1 → 1.6.3

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 (1094) hide show
  1. package/bin/codegraph +1 -1
  2. package/bin/codegraph.cmd +1 -1
  3. package/lib/dist/.test-build-engine.json +1 -1
  4. package/lib/dist/.test-build-viewer.json +1 -1
  5. package/lib/dist/bin/codegraph.d.ts +3 -0
  6. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  7. package/lib/dist/bin/codegraph.js +427 -684
  8. package/lib/dist/bin/codegraph.js.map +1 -1
  9. package/lib/dist/bin/command-supervision.d.ts +7 -0
  10. package/lib/dist/bin/command-supervision.d.ts.map +1 -1
  11. package/lib/dist/bin/command-supervision.js +30 -74
  12. package/lib/dist/bin/command-supervision.js.map +1 -1
  13. package/lib/dist/bin/fatal-handler.js +0 -46
  14. package/lib/dist/bin/fatal-handler.js.map +1 -1
  15. package/lib/dist/bin/node-version-check.js +0 -33
  16. package/lib/dist/bin/node-version-check.js.map +1 -1
  17. package/lib/dist/bin/uninstall.js +0 -19
  18. package/lib/dist/bin/uninstall.js.map +1 -1
  19. package/lib/dist/bin/viewer-gate.js +0 -14
  20. package/lib/dist/bin/viewer-gate.js.map +1 -1
  21. package/lib/dist/compile-cache.d.ts +2 -0
  22. package/lib/dist/compile-cache.d.ts.map +1 -0
  23. package/lib/dist/compile-cache.js +45 -0
  24. package/lib/dist/compile-cache.js.map +1 -0
  25. package/lib/dist/context/formatter.js +3 -66
  26. package/lib/dist/context/formatter.js.map +1 -1
  27. package/lib/dist/context/index.d.ts +44 -1
  28. package/lib/dist/context/index.d.ts.map +1 -1
  29. package/lib/dist/context/index.js +123 -430
  30. package/lib/dist/context/index.js.map +1 -1
  31. package/lib/dist/context/markers.js +0 -17
  32. package/lib/dist/context/markers.js.map +1 -1
  33. package/lib/dist/db/index.d.ts +44 -1
  34. package/lib/dist/db/index.d.ts.map +1 -1
  35. package/lib/dist/db/index.js +123 -395
  36. package/lib/dist/db/index.js.map +1 -1
  37. package/lib/dist/db/migrations.d.ts +11 -1
  38. package/lib/dist/db/migrations.d.ts.map +1 -1
  39. package/lib/dist/db/migrations.js +71 -79
  40. package/lib/dist/db/migrations.js.map +1 -1
  41. package/lib/dist/db/name-substring-index.d.ts +63 -0
  42. package/lib/dist/db/name-substring-index.d.ts.map +1 -0
  43. package/lib/dist/db/name-substring-index.js +151 -0
  44. package/lib/dist/db/name-substring-index.js.map +1 -0
  45. package/lib/dist/db/node-sqlite.d.ts +19 -0
  46. package/lib/dist/db/node-sqlite.d.ts.map +1 -0
  47. package/lib/dist/db/node-sqlite.js +23 -0
  48. package/lib/dist/db/node-sqlite.js.map +1 -0
  49. package/lib/dist/db/open-error.d.ts +36 -0
  50. package/lib/dist/db/open-error.d.ts.map +1 -0
  51. package/lib/dist/db/open-error.js +63 -0
  52. package/lib/dist/db/open-error.js.map +1 -0
  53. package/lib/dist/db/parameter-flow-queries.d.ts +120 -0
  54. package/lib/dist/db/parameter-flow-queries.d.ts.map +1 -0
  55. package/lib/dist/db/parameter-flow-queries.js +168 -0
  56. package/lib/dist/db/parameter-flow-queries.js.map +1 -0
  57. package/lib/dist/db/queries.d.ts +641 -40
  58. package/lib/dist/db/queries.d.ts.map +1 -1
  59. package/lib/dist/db/queries.js +1370 -1398
  60. package/lib/dist/db/queries.js.map +1 -1
  61. package/lib/dist/db/reference-tail.d.ts +83 -0
  62. package/lib/dist/db/reference-tail.d.ts.map +1 -0
  63. package/lib/dist/db/reference-tail.js +68 -0
  64. package/lib/dist/db/reference-tail.js.map +1 -0
  65. package/lib/dist/db/schema.sql +18 -2
  66. package/lib/dist/db/sqlite-adapter.d.ts +18 -1
  67. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  68. package/lib/dist/db/sqlite-adapter.js +12 -62
  69. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  70. package/lib/dist/db/synthesis-stage.d.ts.map +1 -1
  71. package/lib/dist/db/synthesis-stage.js +2 -6
  72. package/lib/dist/db/synthesis-stage.js.map +1 -1
  73. package/lib/dist/db/wal-valve.js +1 -153
  74. package/lib/dist/db/wal-valve.js.map +1 -1
  75. package/lib/dist/db/wsl-shared-index.js +0 -37
  76. package/lib/dist/db/wsl-shared-index.js.map +1 -1
  77. package/lib/dist/directory.d.ts +81 -0
  78. package/lib/dist/directory.d.ts.map +1 -1
  79. package/lib/dist/directory.js +91 -500
  80. package/lib/dist/directory.js.map +1 -1
  81. package/lib/dist/engine.d.ts +15 -0
  82. package/lib/dist/engine.d.ts.map +1 -0
  83. package/lib/dist/engine.js +34 -0
  84. package/lib/dist/engine.js.map +1 -0
  85. package/lib/dist/errors.d.ts +10 -0
  86. package/lib/dist/errors.d.ts.map +1 -1
  87. package/lib/dist/errors.js +8 -101
  88. package/lib/dist/errors.js.map +1 -1
  89. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
  90. package/lib/dist/extraction/astro-extractor.js +15 -133
  91. package/lib/dist/extraction/astro-extractor.js.map +1 -1
  92. package/lib/dist/extraction/cfml-extractor.d.ts +102 -10
  93. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  94. package/lib/dist/extraction/cfml-extractor.js +260 -179
  95. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  96. package/lib/dist/extraction/commonjs-requires.d.ts +23 -0
  97. package/lib/dist/extraction/commonjs-requires.d.ts.map +1 -0
  98. package/lib/dist/extraction/commonjs-requires.js +37 -0
  99. package/lib/dist/extraction/commonjs-requires.js.map +1 -0
  100. package/lib/dist/extraction/dfm-extractor.js +0 -21
  101. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  102. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  103. package/lib/dist/extraction/extraction-version.js +1 -24
  104. package/lib/dist/extraction/extraction-version.js.map +1 -1
  105. package/lib/dist/extraction/function-ref.d.ts +40 -0
  106. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  107. package/lib/dist/extraction/function-ref.js +145 -206
  108. package/lib/dist/extraction/function-ref.js.map +1 -1
  109. package/lib/dist/extraction/generated-detection.d.ts +9 -0
  110. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  111. package/lib/dist/extraction/generated-detection.js +29 -154
  112. package/lib/dist/extraction/generated-detection.js.map +1 -1
  113. package/lib/dist/extraction/grammars.d.ts +47 -4
  114. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  115. package/lib/dist/extraction/grammars.js +91 -374
  116. package/lib/dist/extraction/grammars.js.map +1 -1
  117. package/lib/dist/extraction/index.d.ts +216 -11
  118. package/lib/dist/extraction/index.d.ts.map +1 -1
  119. package/lib/dist/extraction/index.js +703 -1368
  120. package/lib/dist/extraction/index.js.map +1 -1
  121. package/lib/dist/extraction/kernel/decode.js +0 -16
  122. package/lib/dist/extraction/kernel/decode.js.map +1 -1
  123. package/lib/dist/extraction/kernel/index.d.ts +3 -1
  124. package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
  125. package/lib/dist/extraction/kernel/index.js +29 -131
  126. package/lib/dist/extraction/kernel/index.js.map +1 -1
  127. package/lib/dist/extraction/kernel/layout.js +42 -76
  128. package/lib/dist/extraction/kernel/layout.js.map +1 -1
  129. package/lib/dist/extraction/kernel/loader.js +0 -37
  130. package/lib/dist/extraction/kernel/loader.js.map +1 -1
  131. package/lib/dist/extraction/languages/arkts.js +0 -59
  132. package/lib/dist/extraction/languages/arkts.js.map +1 -1
  133. package/lib/dist/extraction/languages/c-cpp.d.ts +140 -28
  134. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  135. package/lib/dist/extraction/languages/c-cpp.js +876 -823
  136. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  137. package/lib/dist/extraction/languages/cfquery.js +0 -9
  138. package/lib/dist/extraction/languages/cfquery.js.map +1 -1
  139. package/lib/dist/extraction/languages/cfscript.d.ts +20 -0
  140. package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -1
  141. package/lib/dist/extraction/languages/cfscript.js +80 -9
  142. package/lib/dist/extraction/languages/cfscript.js.map +1 -1
  143. package/lib/dist/extraction/languages/cobol.js +0 -114
  144. package/lib/dist/extraction/languages/cobol.js.map +1 -1
  145. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts +66 -0
  146. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts.map +1 -0
  147. package/lib/dist/extraction/languages/cpp-brace-scopes.js +343 -0
  148. package/lib/dist/extraction/languages/cpp-brace-scopes.js.map +1 -0
  149. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts +41 -0
  150. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts.map +1 -0
  151. package/lib/dist/extraction/languages/cpp-macro-methods.js +487 -0
  152. package/lib/dist/extraction/languages/cpp-macro-methods.js.map +1 -0
  153. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  154. package/lib/dist/extraction/languages/csharp.js +11 -54
  155. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  156. package/lib/dist/extraction/languages/dart.d.ts +84 -0
  157. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  158. package/lib/dist/extraction/languages/dart.js +335 -159
  159. package/lib/dist/extraction/languages/dart.js.map +1 -1
  160. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
  161. package/lib/dist/extraction/languages/erlang.js +15 -102
  162. package/lib/dist/extraction/languages/erlang.js.map +1 -1
  163. package/lib/dist/extraction/languages/go.d.ts +48 -0
  164. package/lib/dist/extraction/languages/go.d.ts.map +1 -1
  165. package/lib/dist/extraction/languages/go.js +102 -31
  166. package/lib/dist/extraction/languages/go.js.map +1 -1
  167. package/lib/dist/extraction/languages/index.js +0 -6
  168. package/lib/dist/extraction/languages/index.js.map +1 -1
  169. package/lib/dist/extraction/languages/java.d.ts.map +1 -1
  170. package/lib/dist/extraction/languages/java.js +67 -78
  171. package/lib/dist/extraction/languages/java.js.map +1 -1
  172. package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
  173. package/lib/dist/extraction/languages/javascript.js +2 -12
  174. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  175. package/lib/dist/extraction/languages/kotlin.d.ts +15 -0
  176. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  177. package/lib/dist/extraction/languages/kotlin.js +69 -150
  178. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  179. package/lib/dist/extraction/languages/lua.js +2 -39
  180. package/lib/dist/extraction/languages/lua.js.map +1 -1
  181. package/lib/dist/extraction/languages/luau.js +0 -14
  182. package/lib/dist/extraction/languages/luau.js.map +1 -1
  183. package/lib/dist/extraction/languages/nix.js +0 -16
  184. package/lib/dist/extraction/languages/nix.js.map +1 -1
  185. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  186. package/lib/dist/extraction/languages/objc.js +5 -16
  187. package/lib/dist/extraction/languages/objc.js.map +1 -1
  188. package/lib/dist/extraction/languages/pascal-preparse.d.ts +66 -0
  189. package/lib/dist/extraction/languages/pascal-preparse.d.ts.map +1 -0
  190. package/lib/dist/extraction/languages/pascal-preparse.js +958 -0
  191. package/lib/dist/extraction/languages/pascal-preparse.js.map +1 -0
  192. package/lib/dist/extraction/languages/pascal-system.d.ts +11 -0
  193. package/lib/dist/extraction/languages/pascal-system.d.ts.map +1 -0
  194. package/lib/dist/extraction/languages/pascal-system.js +23 -0
  195. package/lib/dist/extraction/languages/pascal-system.js.map +1 -0
  196. package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
  197. package/lib/dist/extraction/languages/pascal.js +3 -4
  198. package/lib/dist/extraction/languages/pascal.js.map +1 -1
  199. package/lib/dist/extraction/languages/php.js +5 -42
  200. package/lib/dist/extraction/languages/php.js.map +1 -1
  201. package/lib/dist/extraction/languages/python.js +2 -20
  202. package/lib/dist/extraction/languages/python.js.map +1 -1
  203. package/lib/dist/extraction/languages/r.js +8 -78
  204. package/lib/dist/extraction/languages/r.js.map +1 -1
  205. package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
  206. package/lib/dist/extraction/languages/ruby.js +17 -25
  207. package/lib/dist/extraction/languages/ruby.js.map +1 -1
  208. package/lib/dist/extraction/languages/rust.d.ts +10 -0
  209. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  210. package/lib/dist/extraction/languages/rust.js +15 -47
  211. package/lib/dist/extraction/languages/rust.js.map +1 -1
  212. package/lib/dist/extraction/languages/scala.js +5 -41
  213. package/lib/dist/extraction/languages/scala.js.map +1 -1
  214. package/lib/dist/extraction/languages/solidity.js +1 -82
  215. package/lib/dist/extraction/languages/solidity.js.map +1 -1
  216. package/lib/dist/extraction/languages/swift.d.ts +15 -0
  217. package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
  218. package/lib/dist/extraction/languages/swift.js +33 -27
  219. package/lib/dist/extraction/languages/swift.js.map +1 -1
  220. package/lib/dist/extraction/languages/terraform.js +6 -152
  221. package/lib/dist/extraction/languages/terraform.js.map +1 -1
  222. package/lib/dist/extraction/languages/typescript.d.ts +71 -0
  223. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  224. package/lib/dist/extraction/languages/typescript.js +86 -41
  225. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  226. package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -1
  227. package/lib/dist/extraction/languages/vbnet.js +9 -42
  228. package/lib/dist/extraction/languages/vbnet.js.map +1 -1
  229. package/lib/dist/extraction/lazy-frameworks.d.ts +15 -0
  230. package/lib/dist/extraction/lazy-frameworks.d.ts.map +1 -0
  231. package/lib/dist/extraction/lazy-frameworks.js +8 -0
  232. package/lib/dist/extraction/lazy-frameworks.js.map +1 -0
  233. package/lib/dist/extraction/liquid-extractor.d.ts +29 -3
  234. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  235. package/lib/dist/extraction/liquid-extractor.js +89 -148
  236. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  237. package/lib/dist/extraction/mybatis-extractor.js +0 -78
  238. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  239. package/lib/dist/extraction/parse-budget.d.ts +16 -0
  240. package/lib/dist/extraction/parse-budget.d.ts.map +1 -0
  241. package/lib/dist/extraction/parse-budget.js +11 -0
  242. package/lib/dist/extraction/parse-budget.js.map +1 -0
  243. package/lib/dist/extraction/parse-pool.d.ts +41 -5
  244. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  245. package/lib/dist/extraction/parse-pool.js +74 -158
  246. package/lib/dist/extraction/parse-pool.js.map +1 -1
  247. package/lib/dist/extraction/parse-worker.d.ts +1 -1
  248. package/lib/dist/extraction/parse-worker.d.ts.map +1 -1
  249. package/lib/dist/extraction/parse-worker.js +7 -58
  250. package/lib/dist/extraction/parse-worker.js.map +1 -1
  251. package/lib/dist/extraction/razor-extractor.d.ts +9 -0
  252. package/lib/dist/extraction/razor-extractor.d.ts.map +1 -1
  253. package/lib/dist/extraction/razor-extractor.js +45 -69
  254. package/lib/dist/extraction/razor-extractor.js.map +1 -1
  255. package/lib/dist/extraction/razor-script.d.ts +23 -0
  256. package/lib/dist/extraction/razor-script.d.ts.map +1 -0
  257. package/lib/dist/extraction/razor-script.js +244 -0
  258. package/lib/dist/extraction/razor-script.js.map +1 -0
  259. package/lib/dist/extraction/sfc-script.d.ts +85 -0
  260. package/lib/dist/extraction/sfc-script.d.ts.map +1 -0
  261. package/lib/dist/extraction/sfc-script.js +136 -0
  262. package/lib/dist/extraction/sfc-script.js.map +1 -0
  263. package/lib/dist/extraction/store-worker.d.ts +1 -1
  264. package/lib/dist/extraction/store-worker.d.ts.map +1 -1
  265. package/lib/dist/extraction/store-worker.js +5 -37
  266. package/lib/dist/extraction/store-worker.js.map +1 -1
  267. package/lib/dist/extraction/store-writer.d.ts +10 -2
  268. package/lib/dist/extraction/store-writer.d.ts.map +1 -1
  269. package/lib/dist/extraction/store-writer.js +8 -32
  270. package/lib/dist/extraction/store-writer.js.map +1 -1
  271. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  272. package/lib/dist/extraction/svelte-extractor.js +16 -122
  273. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  274. package/lib/dist/extraction/syntax-tokens.d.ts +6 -5
  275. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -1
  276. package/lib/dist/extraction/syntax-tokens.js +6 -153
  277. package/lib/dist/extraction/syntax-tokens.js.map +1 -1
  278. package/lib/dist/extraction/tree-sitter-helpers.d.ts +37 -1
  279. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  280. package/lib/dist/extraction/tree-sitter-helpers.js +76 -68
  281. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  282. package/lib/dist/extraction/tree-sitter-types.d.ts +102 -22
  283. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  284. package/lib/dist/extraction/tree-sitter-types.js +0 -7
  285. package/lib/dist/extraction/tree-sitter-types.js.map +1 -1
  286. package/lib/dist/extraction/tree-sitter.d.ts +455 -9
  287. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  288. package/lib/dist/extraction/tree-sitter.js +1998 -2517
  289. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  290. package/lib/dist/extraction/vue-extractor.d.ts +20 -0
  291. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  292. package/lib/dist/extraction/vue-extractor.js +113 -115
  293. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  294. package/lib/dist/extraction/vue-options-api.d.ts +28 -0
  295. package/lib/dist/extraction/vue-options-api.d.ts.map +1 -0
  296. package/lib/dist/extraction/vue-options-api.js +164 -0
  297. package/lib/dist/extraction/vue-options-api.js.map +1 -0
  298. package/lib/dist/extraction/vue-template-calls.d.ts +37 -0
  299. package/lib/dist/extraction/vue-template-calls.d.ts.map +1 -0
  300. package/lib/dist/extraction/vue-template-calls.js +497 -0
  301. package/lib/dist/extraction/vue-template-calls.js.map +1 -0
  302. package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  303. package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  304. package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  305. package/lib/dist/extraction/wasm-runtime-flags.d.ts +6 -0
  306. package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  307. package/lib/dist/extraction/wasm-runtime-flags.js +1 -88
  308. package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
  309. package/lib/dist/file-limits.d.ts +8 -0
  310. package/lib/dist/file-limits.d.ts.map +1 -1
  311. package/lib/dist/file-limits.js +13 -28
  312. package/lib/dist/file-limits.js.map +1 -1
  313. package/lib/dist/graph/branch-guards.d.ts +17 -0
  314. package/lib/dist/graph/branch-guards.d.ts.map +1 -1
  315. package/lib/dist/graph/branch-guards.js +98 -250
  316. package/lib/dist/graph/branch-guards.js.map +1 -1
  317. package/lib/dist/graph/call-sites.d.ts +12 -0
  318. package/lib/dist/graph/call-sites.d.ts.map +1 -0
  319. package/lib/dist/graph/call-sites.js +17 -0
  320. package/lib/dist/graph/call-sites.js.map +1 -0
  321. package/lib/dist/graph/cobol-copybooks.d.ts +75 -0
  322. package/lib/dist/graph/cobol-copybooks.d.ts.map +1 -0
  323. package/lib/dist/graph/cobol-copybooks.js +45 -0
  324. package/lib/dist/graph/cobol-copybooks.js.map +1 -0
  325. package/lib/dist/graph/dead-code.d.ts +26 -4
  326. package/lib/dist/graph/dead-code.d.ts.map +1 -1
  327. package/lib/dist/graph/dead-code.js +157 -311
  328. package/lib/dist/graph/dead-code.js.map +1 -1
  329. package/lib/dist/graph/dynamic-boundary-report.js +1 -88
  330. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -1
  331. package/lib/dist/graph/file-cycles.d.ts +20 -0
  332. package/lib/dist/graph/file-cycles.d.ts.map +1 -0
  333. package/lib/dist/graph/file-cycles.js +79 -0
  334. package/lib/dist/graph/file-cycles.js.map +1 -0
  335. package/lib/dist/graph/go-package.d.ts +27 -0
  336. package/lib/dist/graph/go-package.d.ts.map +1 -0
  337. package/lib/dist/graph/go-package.js +49 -0
  338. package/lib/dist/graph/go-package.js.map +1 -0
  339. package/lib/dist/graph/index.d.ts +2 -0
  340. package/lib/dist/graph/index.d.ts.map +1 -1
  341. package/lib/dist/graph/index.js +4 -6
  342. package/lib/dist/graph/index.js.map +1 -1
  343. package/lib/dist/graph/named-symbol-flow.d.ts +5 -1
  344. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -1
  345. package/lib/dist/graph/named-symbol-flow.js +85 -219
  346. package/lib/dist/graph/named-symbol-flow.js.map +1 -1
  347. package/lib/dist/graph/owning-package.d.ts +59 -0
  348. package/lib/dist/graph/owning-package.d.ts.map +1 -0
  349. package/lib/dist/graph/owning-package.js +120 -0
  350. package/lib/dist/graph/owning-package.js.map +1 -0
  351. package/lib/dist/graph/queries.d.ts +2 -2
  352. package/lib/dist/graph/queries.d.ts.map +1 -1
  353. package/lib/dist/graph/queries.js +2 -135
  354. package/lib/dist/graph/queries.js.map +1 -1
  355. package/lib/dist/graph/symbol-lookup.d.ts +15 -3
  356. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -1
  357. package/lib/dist/graph/symbol-lookup.js +47 -89
  358. package/lib/dist/graph/symbol-lookup.js.map +1 -1
  359. package/lib/dist/graph/synthesized-hop.d.ts +37 -0
  360. package/lib/dist/graph/synthesized-hop.d.ts.map +1 -0
  361. package/lib/dist/graph/synthesized-hop.js +62 -0
  362. package/lib/dist/graph/synthesized-hop.js.map +1 -0
  363. package/lib/dist/graph/test-code.d.ts +21 -0
  364. package/lib/dist/graph/test-code.d.ts.map +1 -0
  365. package/lib/dist/graph/test-code.js +50 -0
  366. package/lib/dist/graph/test-code.js.map +1 -0
  367. package/lib/dist/graph/traversal.d.ts +31 -2
  368. package/lib/dist/graph/traversal.d.ts.map +1 -1
  369. package/lib/dist/graph/traversal.js +98 -226
  370. package/lib/dist/graph/traversal.js.map +1 -1
  371. package/lib/dist/graph/type-hierarchy.js +0 -138
  372. package/lib/dist/graph/type-hierarchy.js.map +1 -1
  373. package/lib/dist/index.d.ts +195 -25
  374. package/lib/dist/index.d.ts.map +1 -1
  375. package/lib/dist/index.js +697 -1105
  376. package/lib/dist/index.js.map +1 -1
  377. package/lib/dist/installer/beta-signup.js +0 -39
  378. package/lib/dist/installer/beta-signup.js.map +1 -1
  379. package/lib/dist/installer/config-writer.js +0 -24
  380. package/lib/dist/installer/config-writer.js.map +1 -1
  381. package/lib/dist/installer/index.d.ts +9 -5
  382. package/lib/dist/installer/index.d.ts.map +1 -1
  383. package/lib/dist/installer/index.js +25 -159
  384. package/lib/dist/installer/index.js.map +1 -1
  385. package/lib/dist/installer/instructions-template.d.ts +1 -1
  386. package/lib/dist/installer/instructions-template.js +0 -37
  387. package/lib/dist/installer/instructions-template.js.map +1 -1
  388. package/lib/dist/installer/targets/antigravity.js +0 -113
  389. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  390. package/lib/dist/installer/targets/bob.d.ts +20 -0
  391. package/lib/dist/installer/targets/bob.d.ts.map +1 -0
  392. package/lib/dist/installer/targets/bob.js +83 -0
  393. package/lib/dist/installer/targets/bob.js.map +1 -0
  394. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  395. package/lib/dist/installer/targets/claude.js +1 -185
  396. package/lib/dist/installer/targets/claude.js.map +1 -1
  397. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  398. package/lib/dist/installer/targets/codex.js +17 -109
  399. package/lib/dist/installer/targets/codex.js.map +1 -1
  400. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  401. package/lib/dist/installer/targets/copilot-cli.js +2 -54
  402. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  403. package/lib/dist/installer/targets/copilot-jetbrains.js +0 -57
  404. package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -1
  405. package/lib/dist/installer/targets/copilot-vscode.js +0 -58
  406. package/lib/dist/installer/targets/copilot-vscode.js.map +1 -1
  407. package/lib/dist/installer/targets/cursor.js +7 -88
  408. package/lib/dist/installer/targets/cursor.js.map +1 -1
  409. package/lib/dist/installer/targets/droid.d.ts +18 -0
  410. package/lib/dist/installer/targets/droid.d.ts.map +1 -0
  411. package/lib/dist/installer/targets/droid.js +92 -0
  412. package/lib/dist/installer/targets/droid.js.map +1 -0
  413. package/lib/dist/installer/targets/dsh.d.ts +35 -0
  414. package/lib/dist/installer/targets/dsh.d.ts.map +1 -0
  415. package/lib/dist/installer/targets/dsh.js +267 -0
  416. package/lib/dist/installer/targets/dsh.js.map +1 -0
  417. package/lib/dist/installer/targets/gemini.js +0 -37
  418. package/lib/dist/installer/targets/gemini.js.map +1 -1
  419. package/lib/dist/installer/targets/grok.d.ts +25 -0
  420. package/lib/dist/installer/targets/grok.d.ts.map +1 -0
  421. package/lib/dist/installer/targets/grok.js +96 -0
  422. package/lib/dist/installer/targets/grok.js.map +1 -0
  423. package/lib/dist/installer/targets/hermes.d.ts +19 -7
  424. package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
  425. package/lib/dist/installer/targets/hermes.js +218 -214
  426. package/lib/dist/installer/targets/hermes.js.map +1 -1
  427. package/lib/dist/installer/targets/json-config.d.ts +45 -0
  428. package/lib/dist/installer/targets/json-config.d.ts.map +1 -0
  429. package/lib/dist/installer/targets/json-config.js +128 -0
  430. package/lib/dist/installer/targets/json-config.js.map +1 -0
  431. package/lib/dist/installer/targets/kimi.d.ts +21 -0
  432. package/lib/dist/installer/targets/kimi.d.ts.map +1 -0
  433. package/lib/dist/installer/targets/kimi.js +97 -0
  434. package/lib/dist/installer/targets/kimi.js.map +1 -0
  435. package/lib/dist/installer/targets/kiro.js +1 -41
  436. package/lib/dist/installer/targets/kiro.js.map +1 -1
  437. package/lib/dist/installer/targets/opencode.js +0 -102
  438. package/lib/dist/installer/targets/opencode.js.map +1 -1
  439. package/lib/dist/installer/targets/pi.d.ts +24 -0
  440. package/lib/dist/installer/targets/pi.d.ts.map +1 -0
  441. package/lib/dist/installer/targets/pi.js +100 -0
  442. package/lib/dist/installer/targets/pi.js.map +1 -0
  443. package/lib/dist/installer/targets/qoder.d.ts +23 -0
  444. package/lib/dist/installer/targets/qoder.d.ts.map +1 -0
  445. package/lib/dist/installer/targets/qoder.js +83 -0
  446. package/lib/dist/installer/targets/qoder.js.map +1 -0
  447. package/lib/dist/installer/targets/qwen.d.ts +21 -0
  448. package/lib/dist/installer/targets/qwen.d.ts.map +1 -0
  449. package/lib/dist/installer/targets/qwen.js +115 -0
  450. package/lib/dist/installer/targets/qwen.js.map +1 -0
  451. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  452. package/lib/dist/installer/targets/registry.js +18 -25
  453. package/lib/dist/installer/targets/registry.js.map +1 -1
  454. package/lib/dist/installer/targets/shared.d.ts +81 -11
  455. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  456. package/lib/dist/installer/targets/shared.js +183 -129
  457. package/lib/dist/installer/targets/shared.js.map +1 -1
  458. package/lib/dist/installer/targets/toml.d.ts +82 -6
  459. package/lib/dist/installer/targets/toml.d.ts.map +1 -1
  460. package/lib/dist/installer/targets/toml.js +318 -112
  461. package/lib/dist/installer/targets/toml.js.map +1 -1
  462. package/lib/dist/installer/targets/types.d.ts +1 -1
  463. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  464. package/lib/dist/installer/targets/types.js +0 -13
  465. package/lib/dist/installer/targets/types.js.map +1 -1
  466. package/lib/dist/installer/targets/windsurf.d.ts +22 -0
  467. package/lib/dist/installer/targets/windsurf.d.ts.map +1 -0
  468. package/lib/dist/installer/targets/windsurf.js +90 -0
  469. package/lib/dist/installer/targets/windsurf.js.map +1 -0
  470. package/lib/dist/lazy-engine.d.ts +22 -0
  471. package/lib/dist/lazy-engine.d.ts.map +1 -0
  472. package/lib/dist/lazy-engine.js +16 -0
  473. package/lib/dist/lazy-engine.js.map +1 -0
  474. package/lib/dist/mcp/answer-freshness.js +0 -6
  475. package/lib/dist/mcp/answer-freshness.js.map +1 -1
  476. package/lib/dist/mcp/daemon-manager.js +2 -23
  477. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  478. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  479. package/lib/dist/mcp/daemon-paths.js +2 -79
  480. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  481. package/lib/dist/mcp/daemon-registry.d.ts +44 -0
  482. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  483. package/lib/dist/mcp/daemon-registry.js +189 -118
  484. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  485. package/lib/dist/mcp/daemon.d.ts +23 -0
  486. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  487. package/lib/dist/mcp/daemon.js +89 -373
  488. package/lib/dist/mcp/daemon.js.map +1 -1
  489. package/lib/dist/mcp/dynamic-boundaries.js +4 -78
  490. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  491. package/lib/dist/mcp/early-ppid.js +0 -24
  492. package/lib/dist/mcp/early-ppid.js.map +1 -1
  493. package/lib/dist/mcp/engine.d.ts +10 -0
  494. package/lib/dist/mcp/engine.d.ts.map +1 -1
  495. package/lib/dist/mcp/engine.js +41 -152
  496. package/lib/dist/mcp/engine.js.map +1 -1
  497. package/lib/dist/mcp/explore-dedup.js +0 -108
  498. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  499. package/lib/dist/mcp/explore-diagnostics.js +0 -116
  500. package/lib/dist/mcp/explore-diagnostics.js.map +1 -1
  501. package/lib/dist/mcp/explore-session-state.js +0 -129
  502. package/lib/dist/mcp/explore-session-state.js.map +1 -1
  503. package/lib/dist/mcp/index-freshness-worker.js +5 -4
  504. package/lib/dist/mcp/index-freshness-worker.js.map +1 -1
  505. package/lib/dist/mcp/index-freshness.d.ts +7 -1
  506. package/lib/dist/mcp/index-freshness.d.ts.map +1 -1
  507. package/lib/dist/mcp/index-freshness.js +20 -12
  508. package/lib/dist/mcp/index-freshness.js.map +1 -1
  509. package/lib/dist/mcp/index-version-warning.d.ts +21 -0
  510. package/lib/dist/mcp/index-version-warning.d.ts.map +1 -0
  511. package/lib/dist/mcp/index-version-warning.js +38 -0
  512. package/lib/dist/mcp/index-version-warning.js.map +1 -0
  513. package/lib/dist/mcp/index.d.ts +19 -1
  514. package/lib/dist/mcp/index.d.ts.map +1 -1
  515. package/lib/dist/mcp/index.js +118 -293
  516. package/lib/dist/mcp/index.js.map +1 -1
  517. package/lib/dist/mcp/liveness-watchdog.d.ts +13 -3
  518. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  519. package/lib/dist/mcp/liveness-watchdog.js +106 -121
  520. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  521. package/lib/dist/mcp/ppid-watchdog.js +0 -24
  522. package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
  523. package/lib/dist/mcp/process-identity.d.ts +42 -0
  524. package/lib/dist/mcp/process-identity.d.ts.map +1 -0
  525. package/lib/dist/mcp/process-identity.js +130 -0
  526. package/lib/dist/mcp/process-identity.js.map +1 -0
  527. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -1
  528. package/lib/dist/mcp/project-lifecycle.js +55 -21
  529. package/lib/dist/mcp/project-lifecycle.js.map +1 -1
  530. package/lib/dist/mcp/proxy.d.ts +26 -8
  531. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  532. package/lib/dist/mcp/proxy.js +209 -223
  533. package/lib/dist/mcp/proxy.js.map +1 -1
  534. package/lib/dist/mcp/query-pool.d.ts +58 -3
  535. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  536. package/lib/dist/mcp/query-pool.js +140 -100
  537. package/lib/dist/mcp/query-pool.js.map +1 -1
  538. package/lib/dist/mcp/query-worker.js +24 -36
  539. package/lib/dist/mcp/query-worker.js.map +1 -1
  540. package/lib/dist/mcp/server-instructions.js +0 -31
  541. package/lib/dist/mcp/server-instructions.js.map +1 -1
  542. package/lib/dist/mcp/session.d.ts +27 -0
  543. package/lib/dist/mcp/session.d.ts.map +1 -1
  544. package/lib/dist/mcp/session.js +29 -130
  545. package/lib/dist/mcp/session.js.map +1 -1
  546. package/lib/dist/mcp/startup-handshake.js +1 -48
  547. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  548. package/lib/dist/mcp/stdin-teardown.js +0 -28
  549. package/lib/dist/mcp/stdin-teardown.js.map +1 -1
  550. package/lib/dist/mcp/stdout-teardown.d.ts +26 -0
  551. package/lib/dist/mcp/stdout-teardown.d.ts.map +1 -0
  552. package/lib/dist/mcp/stdout-teardown.js +20 -0
  553. package/lib/dist/mcp/stdout-teardown.js.map +1 -0
  554. package/lib/dist/mcp/tools.d.ts +159 -20
  555. package/lib/dist/mcp/tools.d.ts.map +1 -1
  556. package/lib/dist/mcp/tools.js +730 -3545
  557. package/lib/dist/mcp/tools.js.map +1 -1
  558. package/lib/dist/mcp/transport.d.ts.map +1 -1
  559. package/lib/dist/mcp/transport.js +4 -96
  560. package/lib/dist/mcp/transport.js.map +1 -1
  561. package/lib/dist/mcp/version.d.ts +13 -1
  562. package/lib/dist/mcp/version.d.ts.map +1 -1
  563. package/lib/dist/mcp/version.js +19 -21
  564. package/lib/dist/mcp/version.js.map +1 -1
  565. package/lib/dist/mcp/writer-lock.d.ts +11 -0
  566. package/lib/dist/mcp/writer-lock.d.ts.map +1 -1
  567. package/lib/dist/mcp/writer-lock.js +49 -46
  568. package/lib/dist/mcp/writer-lock.js.map +1 -1
  569. package/lib/dist/project-config.js +1 -138
  570. package/lib/dist/project-config.js.map +1 -1
  571. package/lib/dist/resolution/alias-binding.d.ts +7 -0
  572. package/lib/dist/resolution/alias-binding.d.ts.map +1 -1
  573. package/lib/dist/resolution/alias-binding.js +19 -52
  574. package/lib/dist/resolution/alias-binding.js.map +1 -1
  575. package/lib/dist/resolution/ambient-modules.d.ts +185 -0
  576. package/lib/dist/resolution/ambient-modules.d.ts.map +1 -0
  577. package/lib/dist/resolution/ambient-modules.js +732 -0
  578. package/lib/dist/resolution/ambient-modules.js.map +1 -0
  579. package/lib/dist/resolution/angular-template-synthesizer.d.ts +96 -0
  580. package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -0
  581. package/lib/dist/resolution/angular-template-synthesizer.js +695 -0
  582. package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -0
  583. package/lib/dist/resolution/c-feature-variants.d.ts +40 -0
  584. package/lib/dist/resolution/c-feature-variants.d.ts.map +1 -0
  585. package/lib/dist/resolution/c-feature-variants.js +249 -0
  586. package/lib/dist/resolution/c-feature-variants.js.map +1 -0
  587. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  588. package/lib/dist/resolution/c-fnptr-synthesizer.js +23 -391
  589. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  590. package/lib/dist/resolution/c-macro-renames.d.ts +25 -0
  591. package/lib/dist/resolution/c-macro-renames.d.ts.map +1 -0
  592. package/lib/dist/resolution/c-macro-renames.js +95 -0
  593. package/lib/dist/resolution/c-macro-renames.js.map +1 -0
  594. package/lib/dist/resolution/callback-synthesizer.d.ts +15 -1
  595. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  596. package/lib/dist/resolution/callback-synthesizer.js +1487 -1234
  597. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  598. package/lib/dist/resolution/const-alias-synthesizer.d.ts +48 -0
  599. package/lib/dist/resolution/const-alias-synthesizer.d.ts.map +1 -0
  600. package/lib/dist/resolution/const-alias-synthesizer.js +234 -0
  601. package/lib/dist/resolution/const-alias-synthesizer.js.map +1 -0
  602. package/lib/dist/resolution/cooperative-yield.js +0 -27
  603. package/lib/dist/resolution/cooperative-yield.js.map +1 -1
  604. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -1
  605. package/lib/dist/resolution/cpp-constructor.js +15 -17
  606. package/lib/dist/resolution/cpp-constructor.js.map +1 -1
  607. package/lib/dist/resolution/cpp-includers.d.ts +46 -0
  608. package/lib/dist/resolution/cpp-includers.d.ts.map +1 -0
  609. package/lib/dist/resolution/cpp-includers.js +153 -0
  610. package/lib/dist/resolution/cpp-includers.js.map +1 -0
  611. package/lib/dist/resolution/cpp-macro-visibility.d.ts +16 -0
  612. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -1
  613. package/lib/dist/resolution/cpp-macro-visibility.js +60 -61
  614. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -1
  615. package/lib/dist/resolution/cpp-namespaces.d.ts +54 -0
  616. package/lib/dist/resolution/cpp-namespaces.d.ts.map +1 -0
  617. package/lib/dist/resolution/cpp-namespaces.js +151 -0
  618. package/lib/dist/resolution/cpp-namespaces.js.map +1 -0
  619. package/lib/dist/resolution/cpp-raw-strings.d.ts +33 -0
  620. package/lib/dist/resolution/cpp-raw-strings.d.ts.map +1 -0
  621. package/lib/dist/resolution/cpp-raw-strings.js +167 -0
  622. package/lib/dist/resolution/cpp-raw-strings.js.map +1 -0
  623. package/lib/dist/resolution/cpp-supertypes.d.ts +118 -0
  624. package/lib/dist/resolution/cpp-supertypes.d.ts.map +1 -0
  625. package/lib/dist/resolution/cpp-supertypes.js +322 -0
  626. package/lib/dist/resolution/cpp-supertypes.js.map +1 -0
  627. package/lib/dist/resolution/cpp-template-instantiations.d.ts +83 -0
  628. package/lib/dist/resolution/cpp-template-instantiations.d.ts.map +1 -0
  629. package/lib/dist/resolution/cpp-template-instantiations.js +983 -0
  630. package/lib/dist/resolution/cpp-template-instantiations.js.map +1 -0
  631. package/lib/dist/resolution/cpp-type-aliases.d.ts +194 -0
  632. package/lib/dist/resolution/cpp-type-aliases.d.ts.map +1 -0
  633. package/lib/dist/resolution/cpp-type-aliases.js +648 -0
  634. package/lib/dist/resolution/cpp-type-aliases.js.map +1 -0
  635. package/lib/dist/resolution/dart-libraries.d.ts +75 -0
  636. package/lib/dist/resolution/dart-libraries.d.ts.map +1 -0
  637. package/lib/dist/resolution/dart-libraries.js +721 -0
  638. package/lib/dist/resolution/dart-libraries.js.map +1 -0
  639. package/lib/dist/resolution/dart-local-scope.d.ts +41 -0
  640. package/lib/dist/resolution/dart-local-scope.d.ts.map +1 -0
  641. package/lib/dist/resolution/dart-local-scope.js +565 -0
  642. package/lib/dist/resolution/dart-local-scope.js.map +1 -0
  643. package/lib/dist/resolution/expo-router-synthesizer.js +0 -52
  644. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -1
  645. package/lib/dist/resolution/frameworks/angular-router.d.ts +142 -0
  646. package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -0
  647. package/lib/dist/resolution/frameworks/angular-router.js +959 -0
  648. package/lib/dist/resolution/frameworks/angular-router.js.map +1 -0
  649. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
  650. package/lib/dist/resolution/frameworks/astro.js +30 -60
  651. package/lib/dist/resolution/frameworks/astro.js.map +1 -1
  652. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -1
  653. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -1
  654. package/lib/dist/resolution/frameworks/cargo-workspace.js +65 -15
  655. package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -1
  656. package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -1
  657. package/lib/dist/resolution/frameworks/cics.js +7 -33
  658. package/lib/dist/resolution/frameworks/cics.js.map +1 -1
  659. package/lib/dist/resolution/frameworks/codeigniter.d.ts +23 -0
  660. package/lib/dist/resolution/frameworks/codeigniter.d.ts.map +1 -0
  661. package/lib/dist/resolution/frameworks/codeigniter.js +271 -0
  662. package/lib/dist/resolution/frameworks/codeigniter.js.map +1 -0
  663. package/lib/dist/resolution/frameworks/component-folder.d.ts +17 -0
  664. package/lib/dist/resolution/frameworks/component-folder.d.ts.map +1 -0
  665. package/lib/dist/resolution/frameworks/component-folder.js +11 -0
  666. package/lib/dist/resolution/frameworks/component-folder.js.map +1 -0
  667. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  668. package/lib/dist/resolution/frameworks/csharp.js +106 -101
  669. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  670. package/lib/dist/resolution/frameworks/drupal.d.ts +17 -8
  671. package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -1
  672. package/lib/dist/resolution/frameworks/drupal.js +377 -142
  673. package/lib/dist/resolution/frameworks/drupal.js.map +1 -1
  674. package/lib/dist/resolution/frameworks/expo-modules.d.ts +10 -0
  675. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  676. package/lib/dist/resolution/frameworks/expo-modules.js +79 -65
  677. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  678. package/lib/dist/resolution/frameworks/expo-router.d.ts +6 -0
  679. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -1
  680. package/lib/dist/resolution/frameworks/expo-router.js +64 -183
  681. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -1
  682. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  683. package/lib/dist/resolution/frameworks/express.js +215 -173
  684. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  685. package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -1
  686. package/lib/dist/resolution/frameworks/fabric.js +11 -112
  687. package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
  688. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
  689. package/lib/dist/resolution/frameworks/go.js +15 -61
  690. package/lib/dist/resolution/frameworks/go.js.map +1 -1
  691. package/lib/dist/resolution/frameworks/goframe.js +1 -55
  692. package/lib/dist/resolution/frameworks/goframe.js.map +1 -1
  693. package/lib/dist/resolution/frameworks/index.d.ts +16 -2
  694. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  695. package/lib/dist/resolution/frameworks/index.js +20 -48
  696. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  697. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  698. package/lib/dist/resolution/frameworks/java.js +209 -147
  699. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  700. package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  701. package/lib/dist/resolution/frameworks/laravel.js +291 -71
  702. package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
  703. package/lib/dist/resolution/frameworks/name-heuristic.d.ts +35 -0
  704. package/lib/dist/resolution/frameworks/name-heuristic.d.ts.map +1 -0
  705. package/lib/dist/resolution/frameworks/name-heuristic.js +33 -0
  706. package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -0
  707. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  708. package/lib/dist/resolution/frameworks/nestjs.js +236 -192
  709. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  710. package/lib/dist/resolution/frameworks/next-proxy.d.ts +67 -0
  711. package/lib/dist/resolution/frameworks/next-proxy.d.ts.map +1 -0
  712. package/lib/dist/resolution/frameworks/next-proxy.js +239 -0
  713. package/lib/dist/resolution/frameworks/next-proxy.js.map +1 -0
  714. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -1
  715. package/lib/dist/resolution/frameworks/nextjs.js +11 -66
  716. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -1
  717. package/lib/dist/resolution/frameworks/object-literal.js +0 -21
  718. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -1
  719. package/lib/dist/resolution/frameworks/package-deps.d.ts +11 -7
  720. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -1
  721. package/lib/dist/resolution/frameworks/package-deps.js +35 -26
  722. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -1
  723. package/lib/dist/resolution/frameworks/page-component.d.ts +20 -0
  724. package/lib/dist/resolution/frameworks/page-component.d.ts.map +1 -0
  725. package/lib/dist/resolution/frameworks/page-component.js +31 -0
  726. package/lib/dist/resolution/frameworks/page-component.js.map +1 -0
  727. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
  728. package/lib/dist/resolution/frameworks/play.js +27 -33
  729. package/lib/dist/resolution/frameworks/play.js.map +1 -1
  730. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  731. package/lib/dist/resolution/frameworks/python.js +106 -116
  732. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  733. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  734. package/lib/dist/resolution/frameworks/react-native.js +1 -166
  735. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  736. package/lib/dist/resolution/frameworks/react-router.d.ts +17 -7
  737. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -1
  738. package/lib/dist/resolution/frameworks/react-router.js +21 -79
  739. package/lib/dist/resolution/frameworks/react-router.js.map +1 -1
  740. package/lib/dist/resolution/frameworks/react.d.ts +68 -1
  741. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  742. package/lib/dist/resolution/frameworks/react.js +1721 -114
  743. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  744. package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -1
  745. package/lib/dist/resolution/frameworks/ruby.js +152 -52
  746. package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
  747. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
  748. package/lib/dist/resolution/frameworks/rust.js +51 -70
  749. package/lib/dist/resolution/frameworks/rust.js.map +1 -1
  750. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  751. package/lib/dist/resolution/frameworks/svelte.js +9 -74
  752. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  753. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -1
  754. package/lib/dist/resolution/frameworks/sveltekit-router.js +8 -46
  755. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -1
  756. package/lib/dist/resolution/frameworks/swift-objc.js +0 -97
  757. package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -1
  758. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
  759. package/lib/dist/resolution/frameworks/swift.js +199 -167
  760. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  761. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -1
  762. package/lib/dist/resolution/frameworks/tanstack-router.js +9 -130
  763. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -1
  764. package/lib/dist/resolution/frameworks/terraform.js +1 -85
  765. package/lib/dist/resolution/frameworks/terraform.js.map +1 -1
  766. package/lib/dist/resolution/frameworks/vue-router.d.ts +26 -10
  767. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -1
  768. package/lib/dist/resolution/frameworks/vue-router.js +147 -147
  769. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -1
  770. package/lib/dist/resolution/frameworks/vue.d.ts +9 -2
  771. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
  772. package/lib/dist/resolution/frameworks/vue.js +69 -107
  773. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  774. package/lib/dist/resolution/go-func-field-synthesizer.d.ts +58 -0
  775. package/lib/dist/resolution/go-func-field-synthesizer.d.ts.map +1 -0
  776. package/lib/dist/resolution/go-func-field-synthesizer.js +696 -0
  777. package/lib/dist/resolution/go-func-field-synthesizer.js.map +1 -0
  778. package/lib/dist/resolution/go-module.d.ts +23 -7
  779. package/lib/dist/resolution/go-module.d.ts.map +1 -1
  780. package/lib/dist/resolution/go-module.js +21 -24
  781. package/lib/dist/resolution/go-module.js.map +1 -1
  782. package/lib/dist/resolution/go-stdlib-methods.d.ts +9 -0
  783. package/lib/dist/resolution/go-stdlib-methods.d.ts.map +1 -0
  784. package/lib/dist/resolution/go-stdlib-methods.js +224 -0
  785. package/lib/dist/resolution/go-stdlib-methods.js.map +1 -0
  786. package/lib/dist/resolution/goframe-synthesizer.js +2 -53
  787. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
  788. package/lib/dist/resolution/import-resolver.d.ts +298 -23
  789. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  790. package/lib/dist/resolution/import-resolver.js +1802 -1280
  791. package/lib/dist/resolution/import-resolver.js.map +1 -1
  792. package/lib/dist/resolution/index.d.ts +449 -5
  793. package/lib/dist/resolution/index.d.ts.map +1 -1
  794. package/lib/dist/resolution/index.js +1477 -981
  795. package/lib/dist/resolution/index.js.map +1 -1
  796. package/lib/dist/resolution/js-builtins.d.ts +14 -0
  797. package/lib/dist/resolution/js-builtins.d.ts.map +1 -1
  798. package/lib/dist/resolution/js-builtins.js +15 -13
  799. package/lib/dist/resolution/js-builtins.js.map +1 -1
  800. package/lib/dist/resolution/js-class-expressions.d.ts +48 -0
  801. package/lib/dist/resolution/js-class-expressions.d.ts.map +1 -0
  802. package/lib/dist/resolution/js-class-expressions.js +25 -0
  803. package/lib/dist/resolution/js-class-expressions.js.map +1 -0
  804. package/lib/dist/resolution/js-super-calls.d.ts +18 -0
  805. package/lib/dist/resolution/js-super-calls.d.ts.map +1 -0
  806. package/lib/dist/resolution/js-super-calls.js +94 -0
  807. package/lib/dist/resolution/js-super-calls.js.map +1 -0
  808. package/lib/dist/resolution/jsx-code.d.ts +28 -0
  809. package/lib/dist/resolution/jsx-code.d.ts.map +1 -0
  810. package/lib/dist/resolution/jsx-code.js +459 -0
  811. package/lib/dist/resolution/jsx-code.js.map +1 -0
  812. package/lib/dist/resolution/lru-cache.d.ts +5 -13
  813. package/lib/dist/resolution/lru-cache.d.ts.map +1 -1
  814. package/lib/dist/resolution/lru-cache.js +43 -32
  815. package/lib/dist/resolution/lru-cache.js.map +1 -1
  816. package/lib/dist/resolution/memory-budget.js +0 -52
  817. package/lib/dist/resolution/memory-budget.js.map +1 -1
  818. package/lib/dist/resolution/module-importers.d.ts +185 -0
  819. package/lib/dist/resolution/module-importers.d.ts.map +1 -0
  820. package/lib/dist/resolution/module-importers.js +588 -0
  821. package/lib/dist/resolution/module-importers.js.map +1 -0
  822. package/lib/dist/resolution/name-matcher.d.ts +891 -8
  823. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  824. package/lib/dist/resolution/name-matcher.js +25013 -2928
  825. package/lib/dist/resolution/name-matcher.js.map +1 -1
  826. package/lib/dist/resolution/next-router-synthesizer.d.ts +19 -0
  827. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -1
  828. package/lib/dist/resolution/next-router-synthesizer.js +46 -28
  829. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -1
  830. package/lib/dist/resolution/override-parameters.d.ts +40 -0
  831. package/lib/dist/resolution/override-parameters.d.ts.map +1 -0
  832. package/lib/dist/resolution/override-parameters.js +339 -0
  833. package/lib/dist/resolution/override-parameters.js.map +1 -0
  834. package/lib/dist/resolution/parameter-flow.d.ts +218 -0
  835. package/lib/dist/resolution/parameter-flow.d.ts.map +1 -0
  836. package/lib/dist/resolution/parameter-flow.js +474 -0
  837. package/lib/dist/resolution/parameter-flow.js.map +1 -0
  838. package/lib/dist/resolution/pascal-scope.d.ts +91 -0
  839. package/lib/dist/resolution/pascal-scope.d.ts.map +1 -0
  840. package/lib/dist/resolution/pascal-scope.js +961 -0
  841. package/lib/dist/resolution/pascal-scope.js.map +1 -0
  842. package/lib/dist/resolution/path-aliases.d.ts +32 -4
  843. package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
  844. package/lib/dist/resolution/path-aliases.js +43 -110
  845. package/lib/dist/resolution/path-aliases.js.map +1 -1
  846. package/lib/dist/resolution/project-scans.d.ts +38 -0
  847. package/lib/dist/resolution/project-scans.d.ts.map +1 -0
  848. package/lib/dist/resolution/project-scans.js +30 -0
  849. package/lib/dist/resolution/project-scans.js.map +1 -0
  850. package/lib/dist/resolution/react-router-synthesizer.d.ts +2 -0
  851. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -1
  852. package/lib/dist/resolution/react-router-synthesizer.js +67 -48
  853. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -1
  854. package/lib/dist/resolution/resolver-pool.d.ts +43 -3
  855. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  856. package/lib/dist/resolution/resolver-pool.js +55 -97
  857. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  858. package/lib/dist/resolution/resolver-worker.d.ts +1 -1
  859. package/lib/dist/resolution/resolver-worker.d.ts.map +1 -1
  860. package/lib/dist/resolution/resolver-worker.js +10 -36
  861. package/lib/dist/resolution/resolver-worker.js.map +1 -1
  862. package/lib/dist/resolution/resurrect-ref.d.ts +25 -0
  863. package/lib/dist/resolution/resurrect-ref.d.ts.map +1 -0
  864. package/lib/dist/resolution/resurrect-ref.js +19 -0
  865. package/lib/dist/resolution/resurrect-ref.js.map +1 -0
  866. package/lib/dist/resolution/ruby-constant-paths.d.ts +56 -0
  867. package/lib/dist/resolution/ruby-constant-paths.d.ts.map +1 -0
  868. package/lib/dist/resolution/ruby-constant-paths.js +255 -0
  869. package/lib/dist/resolution/ruby-constant-paths.js.map +1 -0
  870. package/lib/dist/resolution/ruby-parameter-flow.d.ts +10 -0
  871. package/lib/dist/resolution/ruby-parameter-flow.d.ts.map +1 -0
  872. package/lib/dist/resolution/ruby-parameter-flow.js +801 -0
  873. package/lib/dist/resolution/ruby-parameter-flow.js.map +1 -0
  874. package/lib/dist/resolution/rust-scopes.d.ts +120 -0
  875. package/lib/dist/resolution/rust-scopes.d.ts.map +1 -0
  876. package/lib/dist/resolution/rust-scopes.js +730 -0
  877. package/lib/dist/resolution/rust-scopes.js.map +1 -0
  878. package/lib/dist/resolution/shopify-themes.d.ts +10 -0
  879. package/lib/dist/resolution/shopify-themes.d.ts.map +1 -0
  880. package/lib/dist/resolution/shopify-themes.js +19 -0
  881. package/lib/dist/resolution/shopify-themes.js.map +1 -0
  882. package/lib/dist/resolution/strip-comments.d.ts +20 -1
  883. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  884. package/lib/dist/resolution/strip-comments.js +164 -119
  885. package/lib/dist/resolution/strip-comments.js.map +1 -1
  886. package/lib/dist/resolution/sveltekit-synthesizer.js +0 -64
  887. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -1
  888. package/lib/dist/resolution/swift-objc-bridge.js +0 -160
  889. package/lib/dist/resolution/swift-objc-bridge.js.map +1 -1
  890. package/lib/dist/resolution/swift-type-visibility.d.ts +68 -0
  891. package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  892. package/lib/dist/resolution/swift-type-visibility.js +355 -0
  893. package/lib/dist/resolution/swift-type-visibility.js.map +1 -0
  894. package/lib/dist/resolution/synth-utils.js +1 -22
  895. package/lib/dist/resolution/synth-utils.js.map +1 -1
  896. package/lib/dist/resolution/tanstack-router-synthesizer.js +0 -32
  897. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -1
  898. package/lib/dist/resolution/tauri-synthesizer.d.ts +37 -0
  899. package/lib/dist/resolution/tauri-synthesizer.d.ts.map +1 -0
  900. package/lib/dist/resolution/tauri-synthesizer.js +1038 -0
  901. package/lib/dist/resolution/tauri-synthesizer.js.map +1 -0
  902. package/lib/dist/resolution/tier-synthesizer.d.ts +7 -2
  903. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -1
  904. package/lib/dist/resolution/tier-synthesizer.js +318 -121
  905. package/lib/dist/resolution/tier-synthesizer.js.map +1 -1
  906. package/lib/dist/resolution/type-parameters.d.ts +34 -0
  907. package/lib/dist/resolution/type-parameters.d.ts.map +1 -0
  908. package/lib/dist/resolution/type-parameters.js +285 -0
  909. package/lib/dist/resolution/type-parameters.js.map +1 -0
  910. package/lib/dist/resolution/types.d.ts +209 -10
  911. package/lib/dist/resolution/types.d.ts.map +1 -1
  912. package/lib/dist/resolution/types.js +0 -47
  913. package/lib/dist/resolution/types.js.map +1 -1
  914. package/lib/dist/resolution/vbnet-receivers.d.ts +92 -0
  915. package/lib/dist/resolution/vbnet-receivers.d.ts.map +1 -0
  916. package/lib/dist/resolution/vbnet-receivers.js +1482 -0
  917. package/lib/dist/resolution/vbnet-receivers.js.map +1 -0
  918. package/lib/dist/resolution/vue-router-synthesizer.js +0 -31
  919. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -1
  920. package/lib/dist/resolution/workspace-packages.d.ts +206 -15
  921. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
  922. package/lib/dist/resolution/workspace-packages.js +570 -152
  923. package/lib/dist/resolution/workspace-packages.js.map +1 -1
  924. package/lib/dist/search/identifier-segments.js +2 -93
  925. package/lib/dist/search/identifier-segments.js.map +1 -1
  926. package/lib/dist/search/query-parser.js +0 -54
  927. package/lib/dist/search/query-parser.js.map +1 -1
  928. package/lib/dist/search/query-paths.js +0 -167
  929. package/lib/dist/search/query-paths.js.map +1 -1
  930. package/lib/dist/search/query-utils.d.ts +44 -0
  931. package/lib/dist/search/query-utils.d.ts.map +1 -1
  932. package/lib/dist/search/query-utils.js +120 -198
  933. package/lib/dist/search/query-utils.js.map +1 -1
  934. package/lib/dist/sync/git-hooks.d.ts +14 -5
  935. package/lib/dist/sync/git-hooks.d.ts.map +1 -1
  936. package/lib/dist/sync/git-hooks.js +118 -65
  937. package/lib/dist/sync/git-hooks.js.map +1 -1
  938. package/lib/dist/sync/index.js +0 -14
  939. package/lib/dist/sync/index.js.map +1 -1
  940. package/lib/dist/sync/watch-policy.js +0 -45
  941. package/lib/dist/sync/watch-policy.js.map +1 -1
  942. package/lib/dist/sync/watcher.d.ts +29 -11
  943. package/lib/dist/sync/watcher.d.ts.map +1 -1
  944. package/lib/dist/sync/watcher.js +83 -487
  945. package/lib/dist/sync/watcher.js.map +1 -1
  946. package/lib/dist/sync/worktree.d.ts +29 -2
  947. package/lib/dist/sync/worktree.d.ts.map +1 -1
  948. package/lib/dist/sync/worktree.js +59 -78
  949. package/lib/dist/sync/worktree.js.map +1 -1
  950. package/lib/dist/telemetry/index.d.ts.map +1 -1
  951. package/lib/dist/telemetry/index.js +68 -146
  952. package/lib/dist/telemetry/index.js.map +1 -1
  953. package/lib/dist/types.d.ts +46 -0
  954. package/lib/dist/types.d.ts.map +1 -1
  955. package/lib/dist/types.js +15 -44
  956. package/lib/dist/types.js.map +1 -1
  957. package/lib/dist/ui/color.js +0 -19
  958. package/lib/dist/ui/color.js.map +1 -1
  959. package/lib/dist/ui/glyphs.js +2 -45
  960. package/lib/dist/ui/glyphs.js.map +1 -1
  961. package/lib/dist/ui/shimmer-progress.js +0 -21
  962. package/lib/dist/ui/shimmer-progress.js.map +1 -1
  963. package/lib/dist/ui/shimmer-worker.js +0 -22
  964. package/lib/dist/ui/shimmer-worker.js.map +1 -1
  965. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -1
  966. package/lib/dist/ui-server/api/deadcode.js +2 -31
  967. package/lib/dist/ui-server/api/deadcode.js.map +1 -1
  968. package/lib/dist/ui-server/api/effects.d.ts +7 -0
  969. package/lib/dist/ui-server/api/effects.d.ts.map +1 -1
  970. package/lib/dist/ui-server/api/effects.js +20 -103
  971. package/lib/dist/ui-server/api/effects.js.map +1 -1
  972. package/lib/dist/ui-server/api/entrypoints.d.ts +6 -0
  973. package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -1
  974. package/lib/dist/ui-server/api/entrypoints.js +73 -130
  975. package/lib/dist/ui-server/api/entrypoints.js.map +1 -1
  976. package/lib/dist/ui-server/api/events.js +0 -145
  977. package/lib/dist/ui-server/api/events.js.map +1 -1
  978. package/lib/dist/ui-server/api/file.js +0 -80
  979. package/lib/dist/ui-server/api/file.js.map +1 -1
  980. package/lib/dist/ui-server/api/filecode.js +0 -95
  981. package/lib/dist/ui-server/api/filecode.js.map +1 -1
  982. package/lib/dist/ui-server/api/flow.js +0 -149
  983. package/lib/dist/ui-server/api/flow.js.map +1 -1
  984. package/lib/dist/ui-server/api/hierarchy.js +0 -28
  985. package/lib/dist/ui-server/api/hierarchy.js.map +1 -1
  986. package/lib/dist/ui-server/api/index.js +0 -88
  987. package/lib/dist/ui-server/api/index.js.map +1 -1
  988. package/lib/dist/ui-server/api/map.d.ts +41 -6
  989. package/lib/dist/ui-server/api/map.d.ts.map +1 -1
  990. package/lib/dist/ui-server/api/map.js +95 -308
  991. package/lib/dist/ui-server/api/map.js.map +1 -1
  992. package/lib/dist/ui-server/api/node.d.ts.map +1 -1
  993. package/lib/dist/ui-server/api/node.js +4 -109
  994. package/lib/dist/ui-server/api/node.js.map +1 -1
  995. package/lib/dist/ui-server/api/nodes.js +0 -16
  996. package/lib/dist/ui-server/api/nodes.js.map +1 -1
  997. package/lib/dist/ui-server/api/program.js +0 -90
  998. package/lib/dist/ui-server/api/program.js.map +1 -1
  999. package/lib/dist/ui-server/api/respond.js +0 -60
  1000. package/lib/dist/ui-server/api/respond.js.map +1 -1
  1001. package/lib/dist/ui-server/api/route-roots.d.ts +6 -0
  1002. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -1
  1003. package/lib/dist/ui-server/api/route-roots.js +18 -39
  1004. package/lib/dist/ui-server/api/route-roots.js.map +1 -1
  1005. package/lib/dist/ui-server/api/routes.d.ts +2 -0
  1006. package/lib/dist/ui-server/api/routes.d.ts.map +1 -1
  1007. package/lib/dist/ui-server/api/routes.js +47 -47
  1008. package/lib/dist/ui-server/api/routes.js.map +1 -1
  1009. package/lib/dist/ui-server/api/screens.d.ts.map +1 -1
  1010. package/lib/dist/ui-server/api/screens.js +16 -171
  1011. package/lib/dist/ui-server/api/screens.js.map +1 -1
  1012. package/lib/dist/ui-server/api/search.js +0 -62
  1013. package/lib/dist/ui-server/api/search.js.map +1 -1
  1014. package/lib/dist/ui-server/api/session.js +0 -58
  1015. package/lib/dist/ui-server/api/session.js.map +1 -1
  1016. package/lib/dist/ui-server/api/source.d.ts.map +1 -1
  1017. package/lib/dist/ui-server/api/source.js +0 -161
  1018. package/lib/dist/ui-server/api/source.js.map +1 -1
  1019. package/lib/dist/ui-server/api/stats.js +0 -58
  1020. package/lib/dist/ui-server/api/stats.js.map +1 -1
  1021. package/lib/dist/ui-server/api/steps.d.ts.map +1 -1
  1022. package/lib/dist/ui-server/api/steps.js +105 -373
  1023. package/lib/dist/ui-server/api/steps.js.map +1 -1
  1024. package/lib/dist/ui-server/api/trail-store.d.ts +3 -3
  1025. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -1
  1026. package/lib/dist/ui-server/api/trail-store.js +24 -106
  1027. package/lib/dist/ui-server/api/trail-store.js.map +1 -1
  1028. package/lib/dist/ui-server/api/trails.d.ts.map +1 -1
  1029. package/lib/dist/ui-server/api/trails.js +20 -94
  1030. package/lib/dist/ui-server/api/trails.js.map +1 -1
  1031. package/lib/dist/ui-server/api/when.d.ts +10 -2
  1032. package/lib/dist/ui-server/api/when.d.ts.map +1 -1
  1033. package/lib/dist/ui-server/api/when.js +32 -44
  1034. package/lib/dist/ui-server/api/when.js.map +1 -1
  1035. package/lib/dist/ui-server/api/wire.js +0 -58
  1036. package/lib/dist/ui-server/api/wire.js.map +1 -1
  1037. package/lib/dist/ui-server/assets.js +0 -35
  1038. package/lib/dist/ui-server/assets.js.map +1 -1
  1039. package/lib/dist/ui-server/constants.js +0 -26
  1040. package/lib/dist/ui-server/constants.js.map +1 -1
  1041. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts +28 -0
  1042. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts.map +1 -0
  1043. package/lib/dist/ui-server/highlight/bounded-tokenize.js +114 -0
  1044. package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -0
  1045. package/lib/dist/ui-server/highlight/index.d.ts.map +1 -1
  1046. package/lib/dist/ui-server/highlight/index.js +7 -133
  1047. package/lib/dist/ui-server/highlight/index.js.map +1 -1
  1048. package/lib/dist/ui-server/highlight/languages.d.ts +3 -3
  1049. package/lib/dist/ui-server/highlight/languages.js +0 -31
  1050. package/lib/dist/ui-server/highlight/languages.js.map +1 -1
  1051. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts +7 -0
  1052. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts.map +1 -0
  1053. package/lib/dist/ui-server/highlight/tokenize-worker.js +15 -0
  1054. package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -0
  1055. package/lib/dist/ui-server/index.d.ts +25 -0
  1056. package/lib/dist/ui-server/index.d.ts.map +1 -1
  1057. package/lib/dist/ui-server/index.js +35 -103
  1058. package/lib/dist/ui-server/index.js.map +1 -1
  1059. package/lib/dist/ui-server/open-browser.js +0 -34
  1060. package/lib/dist/ui-server/open-browser.js.map +1 -1
  1061. package/lib/dist/ui-server/security.d.ts +5 -0
  1062. package/lib/dist/ui-server/security.d.ts.map +1 -1
  1063. package/lib/dist/ui-server/security.js +11 -147
  1064. package/lib/dist/ui-server/security.js.map +1 -1
  1065. package/lib/dist/ui-server/static.js +0 -41
  1066. package/lib/dist/ui-server/static.js.map +1 -1
  1067. package/lib/dist/upgrade/index.d.ts +61 -10
  1068. package/lib/dist/upgrade/index.d.ts.map +1 -1
  1069. package/lib/dist/upgrade/index.js +191 -225
  1070. package/lib/dist/upgrade/index.js.map +1 -1
  1071. package/lib/dist/upgrade/remove-binary.js +2 -67
  1072. package/lib/dist/upgrade/remove-binary.js.map +1 -1
  1073. package/lib/dist/upgrade/update-check.js +1 -81
  1074. package/lib/dist/upgrade/update-check.js.map +1 -1
  1075. package/lib/dist/utils.d.ts +69 -1
  1076. package/lib/dist/utils.d.ts.map +1 -1
  1077. package/lib/dist/utils.js +224 -266
  1078. package/lib/dist/utils.js.map +1 -1
  1079. package/lib/dist/viewer/assets/{index-D4S7YUPf.js → index-BSGpxBr9.js} +60 -58
  1080. package/lib/dist/viewer/index.html +1 -1
  1081. package/lib/dist/worker-teardown.d.ts +48 -0
  1082. package/lib/dist/worker-teardown.d.ts.map +1 -0
  1083. package/lib/dist/worker-teardown.js +53 -0
  1084. package/lib/dist/worker-teardown.js.map +1 -0
  1085. package/lib/kernel/codegraph-kernel.node +2 -2
  1086. package/lib/node_modules/.package-lock.json +4 -4
  1087. package/lib/node_modules/ignore/README.md +138 -8
  1088. package/lib/node_modules/ignore/index.d.ts +56 -20
  1089. package/lib/node_modules/ignore/index.js +1033 -221
  1090. package/lib/node_modules/ignore/legacy.js +871 -178
  1091. package/lib/node_modules/ignore/package.json +10 -4
  1092. package/lib/package.json +14 -8
  1093. package/node.exe +2 -2
  1094. package/package.json +1 -1
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Reference Resolution Orchestrator
4
- *
5
- * Coordinates all reference resolution strategies.
6
- */
7
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
3
  if (k2 === undefined) k2 = k;
9
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -42,6 +37,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
42
37
  };
43
38
  Object.defineProperty(exports, "__esModule", { value: true });
44
39
  exports.ReferenceResolver = void 0;
40
+ exports.parseModuleConfigSnapshot = parseModuleConfigSnapshot;
41
+ exports.changedModuleConfigs = changedModuleConfigs;
42
+ exports.moduleConfigLanguages = moduleConfigLanguages;
43
+ exports.changedRoutes = changedRoutes;
45
44
  exports.createResolver = createResolver;
46
45
  const fs = __importStar(require("fs"));
47
46
  const path = __importStar(require("path"));
@@ -50,54 +49,58 @@ const types_1 = require("./types");
50
49
  const name_matcher_1 = require("./name-matcher");
51
50
  const cpp_macro_visibility_1 = require("./cpp-macro-visibility");
52
51
  const cpp_constructor_1 = require("./cpp-constructor");
52
+ const cpp_supertypes_1 = require("./cpp-supertypes");
53
+ const swift_type_visibility_1 = require("./swift-type-visibility");
54
+ const dart_libraries_1 = require("./dart-libraries");
55
+ const vbnet_receivers_1 = require("./vbnet-receivers");
56
+ const pascal_scope_1 = require("./pascal-scope");
57
+ const type_parameters_1 = require("./type-parameters");
58
+ const dart_local_scope_1 = require("./dart-local-scope");
59
+ const cpp_type_aliases_1 = require("./cpp-type-aliases");
60
+ const project_scans_1 = require("./project-scans");
61
+ const cpp_includers_1 = require("./cpp-includers");
62
+ const c_macro_renames_1 = require("./c-macro-renames");
63
+ const name_matcher_2 = require("./name-matcher");
64
+ const c_feature_variants_1 = require("./c-feature-variants");
65
+ const ambient_modules_1 = require("./ambient-modules");
66
+ const shopify_themes_1 = require("./shopify-themes");
67
+ const js_super_calls_1 = require("./js-super-calls");
68
+ const js_class_expressions_1 = require("./js-class-expressions");
69
+ const ruby_constant_paths_1 = require("./ruby-constant-paths");
53
70
  const import_resolver_1 = require("./import-resolver");
54
71
  const resolver_pool_1 = require("./resolver-pool");
55
72
  const alias_binding_1 = require("./alias-binding");
73
+ const cargo_workspace_1 = require("./frameworks/cargo-workspace");
56
74
  const frameworks_1 = require("./frameworks");
75
+ const package_deps_1 = require("./frameworks/package-deps");
57
76
  const callback_synthesizer_1 = require("./callback-synthesizer");
58
77
  const cooperative_yield_1 = require("./cooperative-yield");
78
+ const parameter_flow_1 = require("./parameter-flow");
59
79
  const file_limits_1 = require("../file-limits");
80
+ const crypto_1 = require("crypto");
60
81
  const path_aliases_1 = require("./path-aliases");
61
82
  const go_module_1 = require("./go-module");
62
83
  const workspace_packages_1 = require("./workspace-packages");
63
84
  const errors_1 = require("../errors");
85
+ const strip_comments_1 = require("./strip-comments");
64
86
  const utils_1 = require("../utils");
87
+ const resurrect_ref_1 = require("./resurrect-ref");
65
88
  const lru_cache_1 = require("./lru-cache");
89
+ const query_utils_1 = require("../search/query-utils");
66
90
  const js_builtins_1 = require("./js-builtins");
67
- /** Node kinds that can declare supertypes (extends/implements). */
91
+ const module_1 = require("module");
92
+ const jsonc_parser_1 = require("jsonc-parser");
93
+ const NODE_BUILTINS = new Set(module_1.builtinModules);
68
94
  const SUPERTYPE_BEARING_KINDS = new Set([
69
95
  'class', 'struct', 'interface', 'trait', 'protocol', 'enum',
70
96
  ]);
71
- /**
72
- * The only edges resolving a reference reads (getSupertypes' walk). The batch
73
- * loop commits a batch that made any of these before the next batch fans out;
74
- * its other edges land while that batch resolves. A resolution strategy that
75
- * reads another edge kind must be added here.
76
- */
77
97
  const RESOLUTION_READ_EDGE_KINDS = ['implements', 'extends'];
78
- // SUPERTYPE_TARGET_KINDS (the kinds an extends/implements edge may TARGET)
79
- // lives in ./types — the name-matcher needs the same set to restrict its
80
- // candidate pool before ranking. It is deliberately wider than
81
- // SUPERTYPE_BEARING_KINDS above, which is about the DECLARING side.
82
- /**
83
- * Languages whose chained static-factory/fluent calls defer to the conformance
84
- * second pass. Dotted-receiver languages resolve via matchDottedCallChain; the
85
- * `::`-receiver ones (Rust) via matchScopedCallChain.
86
- */
87
98
  const CHAIN_LANGUAGES = new Set(['java', 'kotlin', 'csharp', 'swift', 'rust', 'go', 'scala', 'dart', 'objc', 'pascal']);
88
99
  const SCOPED_CHAIN_LANGUAGES = new Set(['rust']);
89
- /** The extractor's chained-receiver encoding: `<inner>().<method>`. */
90
100
  const CHAIN_SHAPE = /^(.+)\(\)\.(\w+)$/;
91
- /** PHP `$this->prop->method()` encoded as `this->prop.method` — no `()`, so CHAIN_SHAPE misses it. */
92
101
  const PHP_PROP_SHAPE = /^this->\w+\.\w+$/;
93
- /**
94
- * Cache size limits. Each per-resolver cache is bounded so memory
95
- * stays flat on large codebases (20k+ files). Sizes were chosen to
96
- * cover the working set for typical resolution batches without
97
- * exceeding a few hundred MB worst-case. Override via the env var
98
- * `CODEGRAPH_RESOLVER_CACHE_SIZE` (single integer applied to all
99
- * caches) when tuning for very large or very small projects.
100
- */
102
+ const CFML_CONSTRUCTED_CALL = /^([A-Za-z_$][\w$.-]*)\(\)\.([A-Za-z_$][\w$]*)$/;
103
+ const DEFAULT_READER_SAMPLE_FILES = 8;
101
104
  const DEFAULT_CACHE_LIMIT = 5_000;
102
105
  function resolveCacheLimit() {
103
106
  const raw = process.env.CODEGRAPH_RESOLVER_CACHE_SIZE;
@@ -108,9 +111,7 @@ function resolveCacheLimit() {
108
111
  return parsed;
109
112
  return DEFAULT_CACHE_LIMIT;
110
113
  }
111
- // Re-export types
112
114
  __exportStar(require("./types"), exports);
113
- // Pre-built Sets for O(1) built-in lookups (allocated once, shared across all instances)
114
115
  const REACT_HOOKS = new Set([
115
116
  'useState', 'useEffect', 'useContext', 'useReducer', 'useCallback',
116
117
  'useMemo', 'useRef', 'useLayoutEffect', 'useImperativeHandle', 'useDebugValue',
@@ -133,19 +134,6 @@ const PYTHON_BUILT_IN_METHODS = new Set([
133
134
  'format', 'isdigit', 'isalpha', 'isalnum',
134
135
  'read', 'write', 'readline', 'readlines', 'close', 'flush', 'seek',
135
136
  ]);
136
- const GO_STDLIB_PACKAGES = new Set([
137
- 'fmt', 'os', 'io', 'net', 'http', 'log', 'math', 'sort', 'sync',
138
- 'time', 'path', 'bytes', 'strings', 'strconv', 'errors', 'context',
139
- 'json', 'xml', 'csv', 'html', 'template', 'regexp', 'reflect',
140
- 'runtime', 'testing', 'flag', 'bufio', 'crypto', 'encoding',
141
- 'filepath', 'hash', 'mime', 'rand', 'signal', 'sql', 'syscall',
142
- 'unicode', 'unsafe', 'atomic', 'binary', 'debug', 'exec', 'heap',
143
- 'ring', 'scanner', 'tar', 'zip', 'gzip', 'zlib', 'tls', 'url',
144
- 'user', 'pprof', 'trace', 'ast', 'build', 'parser', 'printer',
145
- 'token', 'types', 'cgo', 'plugin', 'race', 'ioutil',
146
- // Kubernetes-common stdlib aliases
147
- 'utilruntime', 'utilwait', 'utilnet',
148
- ]);
149
137
  const GO_BUILT_INS = new Set([
150
138
  'make', 'new', 'len', 'cap', 'append', 'copy', 'delete', 'close',
151
139
  'panic', 'recover', 'print', 'println', 'complex', 'real', 'imag',
@@ -155,6 +143,8 @@ const GO_BUILT_INS = new Set([
155
143
  'float32', 'float64', 'complex64', 'complex128',
156
144
  'string', 'bool', 'byte', 'rune', 'any',
157
145
  ]);
146
+ const PASCAL_CAST_TARGET_KINDS = new Set(['class', 'struct', 'interface', 'enum', 'type_alias']);
147
+ const TYPE_COMPANION_VALUE_KINDS = new Set(['function', 'class', 'component', 'constant', 'variable']);
158
148
  const PASCAL_UNIT_PREFIXES = [
159
149
  'System.', 'Winapi.', 'Vcl.', 'Fmx.', 'Data.', 'Datasnap.',
160
150
  'Soap.', 'Xml.', 'Web.', 'REST.', 'FireDAC.', 'IBX.',
@@ -178,9 +168,8 @@ const PASCAL_BUILT_INS = new Set([
178
168
  'TList', 'TStringList', 'TStrings', 'TStream', 'TMemoryStream', 'TFileStream',
179
169
  'Exception', 'EAbort', 'EConvertError', 'EAccessViolation',
180
170
  'IInterface', 'IUnknown',
181
- ]);
171
+ ].map((name) => name.toLowerCase()));
182
172
  const C_BUILT_INS = new Set([
183
- // Standard C library functions
184
173
  'printf', 'fprintf', 'sprintf', 'snprintf', 'scanf', 'fscanf', 'sscanf',
185
174
  'malloc', 'calloc', 'realloc', 'free',
186
175
  'memcpy', 'memmove', 'memset', 'memcmp', 'memchr',
@@ -204,121 +193,144 @@ const C_BUILT_INS = new Set([
204
193
  'int8_t', 'int16_t', 'int32_t', 'int64_t',
205
194
  'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
206
195
  'FILE',
207
- // POSIX additions commonly seen
208
196
  'stat', 'lstat', 'fstat', 'open', 'close', 'read', 'write', 'pipe',
209
197
  'fork', 'exec', 'waitpid', 'getpid', 'getppid', 'kill', 'sleep', 'usleep',
210
198
  'pthread_create', 'pthread_join', 'pthread_mutex_lock', 'pthread_mutex_unlock',
211
199
  'dlopen', 'dlsym', 'dlclose',
212
200
  ]);
213
201
  const CPP_BUILT_INS = new Set([
214
- // iostream objects (often used without std:: prefix via using)
215
202
  'cout', 'cin', 'cerr', 'clog', 'endl', 'flush', 'ws',
216
- 'std', // the namespace itself when used as std::something
217
- // Common C++ keywords that leak as references
203
+ 'std',
218
204
  'nullptr', 'true', 'false', 'this', 'sizeof', 'alignof', 'typeid',
219
205
  'static_cast', 'dynamic_cast', 'reinterpret_cast', 'const_cast',
220
206
  'make_unique', 'make_shared', 'make_pair',
221
207
  'move', 'forward', 'swap',
222
208
  ]);
223
- /**
224
- * Reference Resolver
225
- *
226
- * Orchestrates reference resolution using multiple strategies.
227
- */
209
+ const MODULE_CONFIG_ROOT_FILES = ['tsconfig.json', 'jsconfig.json', 'tsconfig.base.json', 'go.mod', 'Cargo.toml', ...import_resolver_1.CPP_COMPILE_DB_FILES];
210
+ function parseModuleConfigSnapshot(stored) {
211
+ if (!stored)
212
+ return {};
213
+ try {
214
+ const parsed = JSON.parse(stored);
215
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
216
+ return {};
217
+ return Object.fromEntries(Object.entries(parsed).filter(([, v]) => typeof v === 'string'));
218
+ }
219
+ catch {
220
+ return {};
221
+ }
222
+ }
223
+ function moduleConfigSnapshot(projectRoot, files, previous) {
224
+ const snapshot = {};
225
+ for (const abs of files) {
226
+ const rel = path.relative(projectRoot, abs).replace(/\\/g, '/');
227
+ snapshot[rel] = moduleConfigEntry(abs, previous[rel], projectRoot);
228
+ }
229
+ return snapshot;
230
+ }
231
+ function moduleConfigEntry(abs, previous, projectRoot) {
232
+ let stat;
233
+ try {
234
+ stat = fs.statSync(abs, { throwIfNoEntry: false });
235
+ }
236
+ catch { }
237
+ if (!stat?.isFile())
238
+ return 'absent';
239
+ const stamp = `${stat.mtimeMs}:${stat.size}`;
240
+ return previous?.endsWith(`@${stamp}`) ? previous : `${moduleConfigDigest(abs, projectRoot)}@${stamp}`;
241
+ }
242
+ function moduleConfigDigest(abs, projectRoot) {
243
+ const file = path.basename(abs);
244
+ const read = file === 'go.mod' ? (0, go_module_1.loadGoModule)(path.dirname(abs))?.modulePath ?? ''
245
+ : file === 'Cargo.toml' ? cargoManifestDigestText(abs)
246
+ : file === 'compile_commands.json' ? ((0, import_resolver_1.readCompileDbIncludeDirs)(abs, projectRoot) ?? []).join('\n')
247
+ : (0, path_aliases_1.aliasConfigFields)(abs) ?? '';
248
+ return (0, crypto_1.createHash)('sha256').update(read).digest('hex').slice(0, 16);
249
+ }
250
+ function cargoManifestDigestText(abs) {
251
+ try {
252
+ return (0, name_matcher_1.cargoManifestFields)(fs.readFileSync(abs, 'utf-8'));
253
+ }
254
+ catch {
255
+ return '';
256
+ }
257
+ }
258
+ function changedModuleConfigs(was, now) {
259
+ const digest = (entry) => entry.split('@')[0];
260
+ const buildFilesKnown = 'Cargo.toml' in was;
261
+ return Object.keys(now).filter((rel) => (buildFilesKnown || !/(?:^|\/)(?:Cargo\.toml|compile_commands\.json)$/.test(rel)) &&
262
+ digest(was[rel] ?? 'absent') !== digest(now[rel]));
263
+ }
264
+ function moduleConfigLanguages(changed) {
265
+ const languages = new Set();
266
+ for (const rel of changed) {
267
+ if (/(?:^|\/)go\.mod$/.test(rel))
268
+ languages.add('go');
269
+ else if (/(?:^|\/)Cargo\.toml$/.test(rel))
270
+ languages.add('rust');
271
+ else if (/(?:^|\/)compile_commands\.json$/.test(rel))
272
+ for (const language of ['c', 'cpp'])
273
+ languages.add(language);
274
+ else
275
+ for (const language of import_resolver_1.ESM_IMPORT_LANGUAGES)
276
+ languages.add(language);
277
+ }
278
+ return languages;
279
+ }
228
280
  class ReferenceResolver {
229
281
  projectRoot;
230
282
  queries;
231
283
  context;
232
284
  frameworks = [];
233
- // Chained static-factory/fluent call refs the first pass couldn't resolve,
234
- // collected in-memory and left pending in the DB until the post-pass
235
- // finishes, so a restart can recover the queue (#1577). Drained by
236
- // resolveChainedCallsViaConformance
237
- // once implements/extends edges exist, to resolve methods on a supertype the
238
- // receiver conforms to (#750).
285
+ frameworksByLanguage = new Map();
239
286
  deferredChainRefs = [];
240
- // `this.<member>` function-as-value refs whose member is NOT on the
241
- // enclosing class itself — possibly inherited. Collected in-memory for the
242
- // same reason as deferredChainRefs and drained by
243
- // resolveDeferredThisMemberRefs once implements/extends edges exist (#808).
244
287
  deferredThisMemberRefs = [];
245
288
  deferredRowIds = new Set();
246
- // Per-`.razor`/`.cshtml`-file `@using` namespace set (own directives + folder
247
- // `_Imports.razor`, cascading to the project root). Used to disambiguate a
248
- // markup type ref to the right C# namespace.
249
289
  razorUsingsCache = new Map();
250
- // All per-resolver caches are LRU-bounded. Previously these were
251
- // unbounded Maps that grew with every distinct lookup and OOM'd on
252
- // codebases with 20k+ files (see issue: unbounded cache growth).
253
- nodeCache; // per-file node cache
254
- fileCache; // per-file content cache
290
+ nodeCache;
291
+ fileCache;
255
292
  importMappingCache;
256
293
  reExportCache;
257
- nameCache; // name → nodes cache
258
- lowerNameCache; // lower(name) → nodes cache
259
- qualifiedNameCache; // qualified_name → nodes cache
260
- fileLinesCache; // file → split lines cache
261
- // id → node for the resolver's own point reads. Every resolved reference
262
- // re-reads its target a few times (kind gate, language gate, alias
263
- // following, edge creation) and targets recur ~5× on large repos; the query
264
- // layer's cache is too small for that working set. Same stable window as the
265
- // name caches above; absent ids are not cached.
294
+ nameCache;
295
+ lowerNameCache;
296
+ qualifiedNameCache;
297
+ fileLinesCache;
266
298
  nodeByIdCache;
267
- methodMatchCache; // lang\0Type::method → matching method nodes
268
- // Per-(language, methodName) owner index for getMethodMatches: buckets a
269
- // method name's candidates by their qualifiedName's last two segments so a
270
- // (type, method) query is a lookup instead of an O(candidates) filter per
271
- // methodMatchCache miss. Derived purely from node rows (stable through the
272
- // resolution loop, same window nameCache relies on); dropped in clearCaches.
299
+ methodMatchCache;
273
300
  methodOwnerIndexCache = new Map();
274
- // Generation-tagged memo for getSupertypes. Supertype edges GROW during the
275
- // resolution loop (batch k persists its implements/extends edges BEFORE
276
- // batch k+1 fans out — the #1320 ordering), so a plain cache would freeze an
277
- // early batch's emptier answer and change later batches' outcomes. Within
278
- // one batch the edge state is fixed by that same ordering, so entries are
279
- // tagged with a generation that advances at every batch entry point
280
- // (resolveBatchYielding / resolveListForAdmission) — a stale-gen entry is
281
- // recomputed, making the memo behavior-identical to no memo at every point
282
- // in time. On the Swift compiler the unmemoized walk ran 971k times for
283
- // 565s of combined worker time (~581µs each, recursion-multiplied).
284
301
  supertypeGen = 0;
285
302
  supertypeMemo = new Map();
286
- /** Invalidate the getSupertypes memo — call when resolved edges may have advanced. */
303
+ supertypeNodeMemo = new Map();
304
+ superclassNodeMemo = new Map();
287
305
  advanceSupertypeGeneration() {
288
306
  this.supertypeGen++;
289
- // Lazy invalidation via the gen tag; bound the map so a long run over many
290
- // batches doesn't accrete dead entries.
291
307
  if (this.supertypeMemo.size > 50_000)
292
308
  this.supertypeMemo.clear();
309
+ if (this.supertypeNodeMemo.size > 50_000)
310
+ this.supertypeNodeMemo.clear();
311
+ if (this.superclassNodeMemo.size > 50_000)
312
+ this.superclassNodeMemo.clear();
293
313
  }
294
- // Node kinds are a small fixed set (~24), so this is a plain Map, not an LRU.
295
- // getNodesByKind returns the FULL node list for a kind; it was previously
296
- // uncached — a per-ref `SELECT * FROM nodes WHERE kind=?` + row-mapping. Called
297
- // for every dotted call ref by the Spring resolver (constants) and every
298
- // `hook_` ref by the Drupal resolver (functions), that scan dominated
299
- // resolution on large repos (#1180). The node set is stable within a
300
- // resolution pass (same lifetime assumption as nameCache); clearCaches() resets
301
- // it between passes. Callers must treat the returned array as read-only.
302
314
  nodesByKindCache = new Map();
303
- // Filesystem existence probes behind context.fileExists (paths not in knownFiles).
304
315
  fileExistsMemo = new Map();
305
- knownNames = null; // all known symbol names for fast pre-filtering
316
+ knownNames = null;
306
317
  knownFiles = null;
307
318
  cachesWarmed = false;
308
- // tsconfig/jsconfig path-alias map. `undefined` = not yet computed,
309
- // `null` = computed and absent. Treated as immutable for the
310
- // resolver's lifetime; callers re-create the resolver if config changes.
311
319
  projectAliases = undefined;
312
- // go.mod module path. Same lazy/immutable convention as projectAliases.
313
- goModule = undefined;
314
- // Monorepo workspace member packages. Same lazy/immutable convention.
320
+ dirAliases = new Map();
321
+ cargoCrates = undefined;
322
+ compileDbIncludeDirs = undefined;
323
+ layoutIncludeDirs = undefined;
324
+ goModuleByDir = new Map();
325
+ goModules = null;
326
+ goPackageDirs = new Map();
315
327
  workspacePackages = undefined;
328
+ workspaceDiscovery = null;
329
+ moduleConfigFiles = new Set();
316
330
  constructor(projectRoot, queries) {
317
331
  this.projectRoot = projectRoot;
318
332
  this.queries = queries;
319
333
  const limit = resolveCacheLimit();
320
- // The content cache is heavier (full file text), so we give it a
321
- // smaller budget than the metadata caches.
322
334
  const contentLimit = Math.max(64, Math.floor(limit / 5));
323
335
  this.nodeCache = new lru_cache_1.LRUCache(limit);
324
336
  this.fileCache = new lru_cache_1.LRUCache(contentLimit);
@@ -327,28 +339,31 @@ class ReferenceResolver {
327
339
  this.nameCache = new lru_cache_1.LRUCache(limit);
328
340
  this.lowerNameCache = new lru_cache_1.LRUCache(limit);
329
341
  this.qualifiedNameCache = new lru_cache_1.LRUCache(limit);
330
- // Split-lines arrays are heavier than content strings; refs arrive
331
- // file-ordered, so a small cache still hits nearly always.
332
342
  this.fileLinesCache = new lru_cache_1.LRUCache(contentLimit);
333
343
  this.nodeByIdCache = new lru_cache_1.LRUCache(Math.max(limit * 4, 20_000));
334
344
  this.methodMatchCache = new lru_cache_1.LRUCache(limit);
335
345
  this.context = this.createContext();
336
346
  }
337
- /**
338
- * Initialize the resolver (detect frameworks, etc.)
339
- */
340
- initialize() {
341
- this.frameworks = (0, frameworks_1.detectFrameworks)(this.context);
347
+ initialize(frameworks) {
348
+ this.workspacePackages = undefined;
349
+ this.workspaceDiscovery = null;
350
+ this.cargoCrates = undefined;
351
+ this.compileDbIncludeDirs = undefined;
352
+ this.layoutIncludeDirs = undefined;
342
353
  this.clearCaches();
354
+ this.frameworks = frameworks
355
+ ? (0, frameworks_1.getAllFrameworkResolvers)().filter((f) => frameworks.includes(f.name))
356
+ : (0, frameworks_1.detectFrameworks)(this.context);
357
+ this.frameworksByLanguage.clear();
358
+ }
359
+ frameworksFor(language) {
360
+ let frameworks = this.frameworksByLanguage.get(language);
361
+ if (!frameworks) {
362
+ frameworks = (0, frameworks_1.getResolvingFrameworks)(this.frameworks, language);
363
+ this.frameworksByLanguage.set(language, frameworks);
364
+ }
365
+ return frameworks;
343
366
  }
344
- /**
345
- * Run each framework resolver's cross-file finalization pass and persist
346
- * the returned node updates. Idempotent — safe to call after every indexAll
347
- * and every incremental sync. Returns the number of nodes updated.
348
- *
349
- * Caches are cleared before/after so the post-extract pass sees fresh DB
350
- * state and downstream queries see the updated names.
351
- */
352
367
  runPostExtract() {
353
368
  let updated = 0;
354
369
  this.clearCaches();
@@ -368,33 +383,91 @@ class ReferenceResolver {
368
383
  });
369
384
  }
370
385
  }
386
+ for (const fw of this.frameworks) {
387
+ if (!fw.crossFileNodes)
388
+ continue;
389
+ try {
390
+ updated += this.reconcileCrossFileNodes(fw.crossFileNodes(this.context));
391
+ }
392
+ catch (err) {
393
+ (0, errors_1.logDebug)(`Framework '${fw.name}' crossFileNodes failed`, {
394
+ error: err instanceof Error ? err.message : String(err),
395
+ });
396
+ }
397
+ }
371
398
  if (updated > 0)
372
399
  this.clearCaches();
373
400
  return updated;
374
401
  }
375
- /**
376
- * Pre-build lightweight caches for resolution.
377
- * Node lookups are now handled by indexed SQLite queries instead of
378
- * loading all nodes into memory (which caused OOM on large codebases).
379
- * We cache the set of known symbol names for fast pre-filtering.
380
- */
402
+ reconcileCrossFileNodes(result) {
403
+ const wanted = new Map();
404
+ for (const node of result.nodes)
405
+ if (result.owns(node))
406
+ wanted.set(node.id, node);
407
+ const existing = new Map();
408
+ for (const node of this.queries.getNodesByKind(result.kind))
409
+ if (result.owns(node))
410
+ existing.set(node.id, node);
411
+ let changed = 0;
412
+ for (const [id, old] of existing) {
413
+ if (wanted.has(id))
414
+ continue;
415
+ const refs = this.queries.getCrossFileIncomingEdgesWithTarget(old.filePath)
416
+ .filter((e) => e.target === id)
417
+ .map((e) => (0, resurrect_ref_1.resurrectRefFromDroppedEdge)(e))
418
+ .filter((r) => r !== null);
419
+ if (refs.length > 0)
420
+ this.queries.insertUnresolvedRefsBatch(refs);
421
+ this.queries.deleteNode(id);
422
+ changed++;
423
+ }
424
+ const added = [];
425
+ for (const [id, node] of wanted) {
426
+ const old = existing.get(id);
427
+ if (!old)
428
+ added.push(node);
429
+ else if (old.name !== node.name || old.qualifiedName !== node.qualifiedName) {
430
+ this.queries.updateNode(node);
431
+ changed++;
432
+ }
433
+ }
434
+ if (added.length > 0) {
435
+ this.queries.insertNodes(added);
436
+ const ids = new Set(added.map((n) => n.id));
437
+ this.queries.insertUnresolvedRefsBatch(result.references.filter((r) => ids.has(r.fromNodeId)));
438
+ changed += added.length;
439
+ }
440
+ return changed;
441
+ }
442
+ reopenRouteModuleReaders(changedFilePaths) {
443
+ const readers = this.frameworks.filter((f) => f.lazyModules);
444
+ if (readers.length === 0 || changedFilePaths.length === 0)
445
+ return 0;
446
+ const changed = new Set(changedFilePaths);
447
+ const edgeIds = [];
448
+ const refs = [];
449
+ for (const edge of this.queries.getRouteEdgesMovedBy(changedFilePaths)) {
450
+ const ref = (0, resurrect_ref_1.resurrectRefFromDroppedEdge)(edge);
451
+ if (!ref)
452
+ continue;
453
+ const asked = { ...ref, filePath: edge.sourceFilePath, language: edge.sourceLanguage };
454
+ const reads = readers.some((f) => f.lazyModules(asked, this.context).some((file) => changed.has(file)));
455
+ if (!reads)
456
+ continue;
457
+ edgeIds.push(edge.edgeId);
458
+ refs.push(ref);
459
+ }
460
+ if (refs.length > 0)
461
+ this.queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs);
462
+ return refs.length;
463
+ }
381
464
  warmCaches() {
382
465
  if (this.cachesWarmed)
383
466
  return;
384
- // Only cache the set of known file paths (lightweight string set)
385
467
  this.knownFiles = new Set(this.queries.getAllFilePaths());
386
- // Cache all distinct symbol names for fast pre-filtering (just strings, not full nodes)
387
468
  this.knownNames = new Set(this.queries.getAllNodeNames());
388
469
  this.cachesWarmed = true;
389
470
  }
390
- /**
391
- * warmCaches for the async resolution entry points: streams the distinct
392
- * name set with periodic yields instead of one synchronous `.all()`. On a
393
- * multi-million-node index the DISTINCT scan is a solid multi-second block
394
- * (measured up to 28s inside `codegraph sync` on the Linux kernel index),
395
- * long enough to matter to the #850 watchdog on slower hardware. Same
396
- * result, same memory — only the event loop keeps turning.
397
- */
398
471
  async warmCachesYielding(onYield) {
399
472
  if (this.cachesWarmed)
400
473
  return;
@@ -409,7 +482,12 @@ class ReferenceResolver {
409
482
  this.knownNames = names;
410
483
  this.cachesWarmed = true;
411
484
  }
412
- /** `queries.getNodeById` through the resolver's own id → node cache. */
485
+ projectScans() {
486
+ return (0, project_scans_1.readProjectScans)(this.context, this.queries, this.fileExistsMemo);
487
+ }
488
+ adoptProjectScans(scans) {
489
+ (0, project_scans_1.adoptProjectScans)(this.context, scans, this.fileExistsMemo);
490
+ }
413
491
  nodeById(id) {
414
492
  const cached = this.nodeByIdCache.get(id);
415
493
  if (cached !== undefined)
@@ -419,10 +497,14 @@ class ReferenceResolver {
419
497
  this.nodeByIdCache.set(id, node);
420
498
  return node;
421
499
  }
422
- /**
423
- * Clear internal caches
424
- */
425
500
  clearCaches() {
501
+ this.mocklessContext = null;
502
+ this.mocklessBase = null;
503
+ this.manualMocks = undefined;
504
+ this.classExpressionFreeViews = new WeakMap();
505
+ this.classExpressionFreeBases = new WeakMap();
506
+ this.classExpressionIndex = undefined;
507
+ this.classExpressionOnlyNameSet = null;
426
508
  this.nodeCache.clear();
427
509
  this.fileCache.clear();
428
510
  this.importMappingCache.clear();
@@ -435,36 +517,82 @@ class ReferenceResolver {
435
517
  this.methodMatchCache.clear();
436
518
  this.methodOwnerIndexCache.clear();
437
519
  this.supertypeMemo.clear();
520
+ this.supertypeNodeMemo.clear();
521
+ this.superclassNodeMemo.clear();
438
522
  this.supertypeGen++;
439
523
  this.nodesByKindCache.clear();
440
524
  this.fileExistsMemo.clear();
525
+ this.manifestScopes.clear();
441
526
  this.knownNames = null;
527
+ this.knownLowerNames = null;
442
528
  this.knownFiles = null;
529
+ this.goModules = null;
530
+ this.goPackageDirs.clear();
443
531
  this.cachesWarmed = false;
444
- // The import-resolver's and name-matcher's per-context memos assume the
445
- // same stable window as the caches above — drop them together.
446
532
  if (this.context) {
447
533
  (0, import_resolver_1.clearImportResolverMemos)(this.context);
448
534
  (0, name_matcher_1.clearNameMatcherMemos)(this.context);
535
+ (0, ruby_constant_paths_1.clearRubyConstantPathMemos)(this.context);
449
536
  (0, cpp_macro_visibility_1.clearCppMacroVisibility)(this.context);
537
+ (0, swift_type_visibility_1.clearSwiftTypeVisibility)(this.context);
538
+ (0, dart_libraries_1.clearDartLibraryMemos)(this.context);
539
+ (0, vbnet_receivers_1.clearVbnetReceiverMemos)(this.context);
540
+ (0, pascal_scope_1.clearPascalScopeMemos)(this.context);
541
+ (0, type_parameters_1.clearTypeParameterMemos)(this.context);
542
+ (0, dart_local_scope_1.clearDartLocalScopeMemos)(this.context);
543
+ (0, cpp_type_aliases_1.clearCppTypeAliasMemos)(this.context);
544
+ (0, cpp_supertypes_1.clearCppSupertypeMemos)(this.context);
545
+ (0, cpp_includers_1.clearCppIncluderMemos)(this.context);
546
+ (0, c_macro_renames_1.clearCMacroRenames)(this.context);
547
+ (0, c_feature_variants_1.clearCFeatureVariantMemos)(this.context);
548
+ (0, ambient_modules_1.clearAmbientModuleMemos)(this.context);
549
+ (0, package_deps_1.clearDeclaredDependencies)(this.context);
550
+ }
551
+ }
552
+ nearestGoModule(dir) {
553
+ const walked = [];
554
+ let found;
555
+ for (;;) {
556
+ found = this.goModuleByDir.get(dir);
557
+ if (found !== undefined)
558
+ break;
559
+ walked.push(dir);
560
+ found = (0, go_module_1.loadGoModule)(path.join(this.projectRoot, dir));
561
+ if (found)
562
+ this.moduleConfigFiles.add(path.join(this.projectRoot, dir, 'go.mod'));
563
+ if (found || dir === '')
564
+ break;
565
+ dir = goDirOf(dir);
450
566
  }
567
+ for (const d of walked)
568
+ this.goModuleByDir.set(d, found);
569
+ return found;
570
+ }
571
+ getGoModules() {
572
+ if (this.goModules)
573
+ return this.goModules;
574
+ const dirs = new Set(['']);
575
+ for (const file of this.knownFiles ?? this.queries.getAllFilePaths()) {
576
+ if (file.endsWith('.go'))
577
+ dirs.add(goDirOf(file));
578
+ }
579
+ const modules = new Set();
580
+ for (const dir of dirs) {
581
+ const mod = this.nearestGoModule(dir);
582
+ const modDir = mod ? path.relative(this.projectRoot, mod.rootDir).split(path.sep).join('/') : '';
583
+ if (mod && !/(?:^|\/)(?:testdata|[_.][^/]*)(?:\/|$)/.test(modDir))
584
+ modules.add(mod);
585
+ }
586
+ this.goModules = [...modules];
587
+ return this.goModules;
451
588
  }
452
- /** `readFile` through the LRU content cache (null = read failed, also cached). */
453
589
  readFileCached(filePath) {
454
590
  if (this.fileCache.has(filePath)) {
455
591
  return this.fileCache.get(filePath);
456
592
  }
457
593
  const fullPath = path.join(this.projectRoot, filePath);
458
594
  try {
459
- // Import resolvers may follow package metadata to an archive (`file:*.har`,
460
- // for example). Reject anything extraction would not accept before UTF-8
461
- // decoding can multiply a large binary blob into gigabytes of V8 heap.
462
- const stats = fs.statSync(fullPath);
463
- if (!stats.isFile() || stats.size > file_limits_1.MAX_SOURCE_FILE_SIZE_BYTES) {
464
- this.fileCache.set(filePath, null);
465
- return null;
466
- }
467
- const content = fs.readFileSync(fullPath, 'utf-8');
595
+ const content = (0, file_limits_1.readSourceText)(fullPath);
468
596
  this.fileCache.set(filePath, content);
469
597
  return content;
470
598
  }
@@ -474,11 +602,6 @@ class ReferenceResolver {
474
602
  return null;
475
603
  }
476
604
  }
477
- /**
478
- * `readFileCached(filePath)?.includes(needle)` for an ASCII needle, searched
479
- * in the raw bytes: an ASCII byte sequence survives UTF-8 decoding
480
- * unchanged, and decoding is most of reading a file nobody keeps.
481
- */
482
605
  fileContains(filePath, needle) {
483
606
  if (this.fileCache.has(filePath))
484
607
  return this.fileCache.get(filePath)?.includes(needle) ?? false;
@@ -493,12 +616,32 @@ class ReferenceResolver {
493
616
  return false;
494
617
  }
495
618
  }
496
- /**
497
- * Create the resolution context
498
- */
619
+ scanFile(filePath) {
620
+ if (this.fileCache.has(filePath))
621
+ return this.fileCache.get(filePath) ?? null;
622
+ try {
623
+ return (0, file_limits_1.readSourceText)(path.join(this.projectRoot, filePath), 'latin1');
624
+ }
625
+ catch {
626
+ return null;
627
+ }
628
+ }
499
629
  createContext() {
500
630
  return {
501
- resolveImport: (ref) => (0, import_resolver_1.resolveViaImport)(ref, this.context),
631
+ resolveImport: (ref) => (0, import_resolver_1.resolveViaImport)(ref, this.context) ??
632
+ ((ref.language === 'c' || ref.language === 'cpp') && ref.referenceKind === 'imports' &&
633
+ !(0, import_resolver_1.isExternalImport)(ref.referenceName, ref.language, this.context) ? (0, name_matcher_1.matchByFilePath)(ref, this.context) : null),
634
+ isOutOfRepoImport: (source, fromFile, language) => {
635
+ if (!(0, import_resolver_1.isExternalImport)(source, language, this.context, { aliasPrefixes: false, fromFile }))
636
+ return false;
637
+ const resolved = (0, import_resolver_1.resolveImportPath)(source, fromFile, language, this.context);
638
+ if (resolved !== null && this.isIndexedFile(resolved))
639
+ return false;
640
+ return this.isDeclaredOutsidePackage(source, fromFile);
641
+ },
642
+ resolveModuleFile: (source, fromFile, language) => (0, import_resolver_1.resolveImportPath)(source, fromFile, language, this.context),
643
+ isDeclaredPackage: (source, fromFile) => this.isDeclaredOutsidePackage(source, fromFile),
644
+ isIndexedFile: (filePath) => this.isIndexedFile(filePath),
502
645
  getNodesInFile: (filePath) => {
503
646
  if (!this.nodeCache.has(filePath)) {
504
647
  this.nodeCache.set(filePath, this.queries.getNodesByFile(filePath));
@@ -525,6 +668,7 @@ class ReferenceResolver {
525
668
  this.nameCache.set(name, result);
526
669
  return result;
527
670
  },
671
+ isAbsentName: (name) => this.knownNames !== null && !this.knownNames.has(name),
528
672
  getMethodMatches: (typeName, methodName, language) => {
529
673
  const key = `${language} ${typeName}::${methodName}`;
530
674
  const cached = this.methodMatchCache.get(key);
@@ -538,11 +682,6 @@ class ReferenceResolver {
538
682
  const want = `${typeName}::${methodName}`;
539
683
  let matches;
540
684
  if (typeName.includes('::') || methodName.includes(':')) {
541
- // Legacy linear filter for the shapes the owner index below can't
542
- // key exactly: a multi-segment typeName (the endsWith test then
543
- // spans more than two `::` segments) and ObjC selectors (whose
544
- // single/empty-keyword colons defeat the segment split). Tiny
545
- // populations; the per-key memo above still amortizes them.
546
685
  matches = [];
547
686
  for (const m of candidates) {
548
687
  if (m.kind !== 'method')
@@ -555,18 +694,6 @@ class ReferenceResolver {
555
694
  }
556
695
  }
557
696
  else {
558
- // Owner index: the linear filter above is O(all same-named methods)
559
- // per CACHE MISS, and on overload-heavy landscapes the distinct
560
- // (type, method) key space is so large the per-key memo never
561
- // amortizes — Swift's `init` has tens of thousands of candidates
562
- // and the compiler repo measured 732µs per failing call, most of it
563
- // this scan (re-entered once per supertype recursion level, too).
564
- // Bucket each (language, methodName)'s candidates ONCE by the
565
- // qualifiedName's last two `::` segments — exactly the span the
566
- // `qn === want || qn.endsWith('::' + want)` predicate tests for a
567
- // segment-clean typeName — then every query is a map lookup.
568
- // Bucket insertion follows candidate order, so each bucket is
569
- // byte-identical to what the linear filter produced.
570
697
  const idxKey = `${language} ${methodName}`;
571
698
  let ownerIndex = this.methodOwnerIndexCache.get(idxKey);
572
699
  if (!ownerIndex) {
@@ -579,7 +706,7 @@ class ReferenceResolver {
579
706
  const qn = m.qualifiedName;
580
707
  const i2 = qn.lastIndexOf('::');
581
708
  if (i2 < 0)
582
- continue; // single-segment qn can never match `T::m`
709
+ continue;
583
710
  const i1 = qn.lastIndexOf('::', i2 - 1);
584
711
  const bucketKey = i1 < 0 ? qn : qn.slice(i1 + 2);
585
712
  const bucket = ownerIndex.get(bucketKey);
@@ -611,33 +738,14 @@ class ReferenceResolver {
611
738
  this.nodesByKindCache.set(kind, result);
612
739
  return result;
613
740
  },
614
- // Streamed, uncached — synthesizers scan-and-filter whole kinds, and
615
- // both the materialized array AND the per-kind cache retention are
616
- // O(nodes) memory (#1212). Per-ref resolvers keep the cached array
617
- // variant above.
618
741
  iterateNodesByKind: (kind) => this.queries.iterateNodesByKind(kind),
619
742
  fileExists: (filePath) => {
620
- // Check pre-built known files set first (O(1))
621
743
  if (this.knownFiles) {
622
- const normalized = filePath.replace(/\\/g, '/');
623
- if (this.knownFiles.has(filePath) || this.knownFiles.has(normalized)) {
744
+ if (this.knownFiles.has(filePath))
745
+ return true;
746
+ if (filePath.includes('\\') && this.knownFiles.has(filePath.replace(/\\/g, '/')))
624
747
  return true;
625
- }
626
748
  }
627
- // Fall back to filesystem for files not yet indexed. `path.join` does
628
- // not clamp, and relative-import resolution hands us paths carrying
629
- // `../` segments, so the probe has to be contained (#1631): a path
630
- // outside the root can never be an indexed project file, and the
631
- // `knownFiles` check above already answered for everything that is.
632
- // Lexical containment only: this is a per-candidate hot path, and the
633
- // symlink half of `validatePathWithinRoot` costs two `realpathSync`
634
- // calls per probe (~70x slower here). It would also be wrong to apply
635
- // — indexing deliberately follows in-root symlinks whose targets live
636
- // outside the root (#935), so only the `../` escape is refused.
637
- // Memoized: import resolution probes the same candidate paths (every
638
- // extension of a specifier) from every file that imports it, and the
639
- // tree does not change within a resolution pass (same window as the
640
- // file-content cache; dropped by clearCaches).
641
749
  const probed = this.fileExistsMemo.get(filePath);
642
750
  if (probed !== undefined)
643
751
  return probed;
@@ -658,6 +766,7 @@ class ReferenceResolver {
658
766
  },
659
767
  readFile: (filePath) => this.readFileCached(filePath),
660
768
  fileContains: (filePath, needle) => this.fileContains(filePath, needle),
769
+ scanFile: (filePath) => this.scanFile(filePath),
661
770
  getFileLines: (filePath) => {
662
771
  const cached = this.fileLinesCache.get(filePath);
663
772
  if (cached !== undefined)
@@ -697,25 +806,21 @@ class ReferenceResolver {
697
806
  this.lowerNameCache.set(lowerName, result);
698
807
  return result;
699
808
  },
809
+ getNodeNamesOfKinds: (language, kinds) => this.queries.getNodeNamesOfKinds(language, kinds),
810
+ rememberNode: (node) => {
811
+ if (!this.nodeByIdCache.has(node.id))
812
+ this.nodeByIdCache.set(node.id, node);
813
+ },
700
814
  getNodeById: (id) => {
701
815
  return this.nodeById(id);
702
816
  },
703
817
  getSupertypes: (typeName, language) => {
704
- // Union the `implements`/`extends` targets of every same-named type node.
705
- // Matching by simple name (not id) reconciles a type declared in one node
706
- // (`KF::Builder`) with conformance declared in a separate extension node
707
- // (`KF.Builder: KFOptionSetter`) — both have name `Builder`.
708
- // Memoized per batch generation (see supertypeMemo): within a batch the
709
- // edge state is fixed, and the conformance walk re-queries the same
710
- // popular supertypes (Swift stdlib protocols especially) thousands of
711
- // times per batch.
712
818
  const memoKey = `${language} ${typeName}`;
713
819
  const hit = this.supertypeMemo.get(memoKey);
714
820
  if (hit && hit.gen === this.supertypeGen)
715
821
  return hit.supers;
716
822
  const typeNodes = this.context
717
823
  .getNodesByName(typeName)
718
- // Scala singletons can inherit members even though they cannot be parents.
719
824
  .filter((n) => n.language === language && (SUPERTYPE_BEARING_KINDS.has(n.kind) ||
720
825
  (n.language === 'scala' && n.kind === 'module')));
721
826
  let supers;
@@ -730,12 +835,44 @@ class ReferenceResolver {
730
835
  if (target?.name && target.name !== typeName)
731
836
  supertypes.add(target.name);
732
837
  }
838
+ if (language === 'swift') {
839
+ for (const name of (0, swift_type_visibility_1.swiftExtendedConformances)(tn, this.context)) {
840
+ if (name !== typeName)
841
+ supertypes.add(name);
842
+ }
843
+ }
733
844
  }
734
845
  supers = [...supertypes];
735
846
  }
736
847
  this.supertypeMemo.set(memoKey, { gen: this.supertypeGen, supers });
737
848
  return supers;
738
849
  },
850
+ getSupertypeNodes: (id) => {
851
+ const hit = this.supertypeNodeMemo.get(id);
852
+ if (hit && hit.gen === this.supertypeGen)
853
+ return hit.nodes;
854
+ const nodes = [];
855
+ for (const edge of this.queries.getOutgoingEdges(id, RESOLUTION_READ_EDGE_KINDS)) {
856
+ const target = this.nodeById(edge.target);
857
+ if (target)
858
+ nodes.push(target);
859
+ }
860
+ this.supertypeNodeMemo.set(id, { gen: this.supertypeGen, nodes });
861
+ return nodes;
862
+ },
863
+ getSuperclassNodes: (id) => {
864
+ const hit = this.superclassNodeMemo.get(id);
865
+ if (hit && hit.gen === this.supertypeGen)
866
+ return hit.nodes;
867
+ const nodes = [];
868
+ for (const edge of this.queries.getOutgoingEdges(id, ['extends'])) {
869
+ const target = this.nodeById(edge.target);
870
+ if (target)
871
+ nodes.push(target);
872
+ }
873
+ this.superclassNodeMemo.set(id, { gen: this.supertypeGen, nodes });
874
+ return nodes;
875
+ },
739
876
  getImportMappings: (filePath, language) => {
740
877
  const cacheKey = filePath;
741
878
  const cached = this.importMappingCache.get(cacheKey);
@@ -752,19 +889,51 @@ class ReferenceResolver {
752
889
  },
753
890
  getProjectAliases: () => {
754
891
  if (this.projectAliases === undefined) {
755
- this.projectAliases = (0, path_aliases_1.loadProjectAliases)(this.projectRoot);
892
+ this.projectAliases = (0, path_aliases_1.loadProjectAliases)(this.projectRoot, this.moduleConfigFiles);
756
893
  }
757
894
  return this.projectAliases;
758
895
  },
759
- getGoModule: () => {
760
- if (this.goModule === undefined) {
761
- this.goModule = (0, go_module_1.loadGoModule)(this.projectRoot);
896
+ getNearestAliases: (fromFile) => {
897
+ let dir = path.posix.dirname(fromFile.replace(/\\/g, '/'));
898
+ const walked = [];
899
+ let found = null;
900
+ while (dir && dir !== '.' && dir !== '/') {
901
+ const hit = this.dirAliases.get(dir);
902
+ if (hit !== undefined) {
903
+ found = hit;
904
+ break;
905
+ }
906
+ walked.push(dir);
907
+ const abs = path.join(this.projectRoot, dir);
908
+ if (['tsconfig.json', 'jsconfig.json'].some((name) => fs.existsSync(path.join(abs, name)))) {
909
+ const aliases = (0, path_aliases_1.loadProjectAliases)(abs, this.moduleConfigFiles);
910
+ if (aliases) {
911
+ found = aliases;
912
+ break;
913
+ }
914
+ }
915
+ dir = path.posix.dirname(dir);
762
916
  }
763
- return this.goModule;
917
+ for (const d of walked)
918
+ this.dirAliases.set(d, found);
919
+ return found;
920
+ },
921
+ getGoPackageDir: (importPath, fromFile) => {
922
+ const own = fromFile === undefined ? null : this.nearestGoModule(goDirOf(fromFile));
923
+ const key = `${importPath}\0${own?.rootDir ?? ''}`;
924
+ const hit = this.goPackageDirs.get(key);
925
+ if (hit !== undefined)
926
+ return hit;
927
+ const mod = (0, go_module_1.findGoModuleForImport)(importPath, this.getGoModules(), own);
928
+ const dir = mod ? (0, go_module_1.goModulePackageDir)(importPath, mod, this.projectRoot) : null;
929
+ this.goPackageDirs.set(key, dir);
930
+ return dir;
764
931
  },
765
932
  getWorkspacePackages: () => {
766
933
  if (this.workspacePackages === undefined) {
767
- this.workspacePackages = (0, workspace_packages_1.loadWorkspacePackages)(this.projectRoot);
934
+ const { packages, discovery } = (0, workspace_packages_1.loadWorkspacePackagesAndManifests)(this.projectRoot);
935
+ this.workspacePackages = packages;
936
+ this.workspaceDiscovery = discovery;
768
937
  }
769
938
  return this.workspacePackages;
770
939
  },
@@ -777,34 +946,27 @@ class ReferenceResolver {
777
946
  this.reExportCache.set(filePath, []);
778
947
  return [];
779
948
  }
780
- // Re-exports are a JS/TS-only construct, and what matters is the
781
- // BARREL file's own language — not the consuming reference's. A
782
- // `.svelte`/`.vue` consumer threads its own language down the
783
- // re-export chase, which would make extractReExports() bail on a
784
- // `.ts` index barrel and silently break the chain (#629). Re-key
785
- // the parse on the barrel's extension so the chase works no matter
786
- // what kind of file imports through it.
787
949
  const isJsFamily = /\.(?:d\.ts|[cm]?tsx?|[cm]?jsx?|ets)$/i.test(filePath);
788
- const reExports = (0, import_resolver_1.extractReExports)(content, isJsFamily ? 'typescript' : language);
950
+ const barrelLanguage = isJsFamily ? 'typescript' : /\.py$/i.test(filePath) ? 'python' : language;
951
+ const reExports = (0, import_resolver_1.extractReExports)(content, barrelLanguage);
789
952
  this.reExportCache.set(filePath, reExports);
790
953
  return reExports;
791
954
  },
792
955
  getCppIncludeDirs: () => {
793
- return (0, import_resolver_1.loadCppIncludeDirs)(this.projectRoot);
956
+ if (this.compileDbIncludeDirs === undefined)
957
+ this.compileDbIncludeDirs = (0, import_resolver_1.loadCppIncludeDirsFromCompileDB)(this.projectRoot);
958
+ return this.compileDbIncludeDirs ?? (this.layoutIncludeDirs ??= (0, import_resolver_1.loadCppIncludeDirsHeuristic)(this.projectRoot));
794
959
  },
960
+ getCargoCrates: () => this.readCargoCrates(),
961
+ getCppIncludeNodes: () => this.queries.getCppIncludeNodes(),
795
962
  };
796
963
  }
797
- /**
798
- * Resolve all unresolved references
799
- */
800
964
  resolveAll(unresolvedRefs, onProgress) {
801
- // Pre-load all nodes into memory for fast lookups
802
965
  this.warmCaches();
803
966
  this.advanceSupertypeGeneration();
804
967
  const resolved = [];
805
968
  const unresolved = [];
806
969
  const byMethod = {};
807
- // Convert to our internal format, using denormalized fields when available
808
970
  const refs = unresolvedRefs.map((ref) => ({
809
971
  fromNodeId: ref.fromNodeId,
810
972
  referenceName: ref.referenceName,
@@ -818,16 +980,15 @@ class ReferenceResolver {
818
980
  const total = refs.length;
819
981
  let lastReportedPercent = -1;
820
982
  for (let i = 0; i < refs.length; i++) {
821
- const ref = refs[i]; // Array index is guaranteed to be in bounds
983
+ const ref = refs[i];
822
984
  const result = this.resolveOneTimed(ref);
823
985
  if (result) {
824
986
  resolved.push(result);
825
987
  byMethod[result.resolvedBy] = (byMethod[result.resolvedBy] || 0) + 1;
826
988
  }
827
989
  else {
828
- unresolved.push(ref);
990
+ unresolved.push(this.parkable(ref));
829
991
  }
830
- // Report progress every 1% to avoid too many updates
831
992
  if (onProgress) {
832
993
  const currentPercent = Math.floor((i / total) * 100);
833
994
  if (currentPercent > lastReportedPercent) {
@@ -836,7 +997,6 @@ class ReferenceResolver {
836
997
  }
837
998
  }
838
999
  }
839
- // Final progress report
840
1000
  if (onProgress && total > 0) {
841
1001
  onProgress(total, total);
842
1002
  }
@@ -851,35 +1011,40 @@ class ReferenceResolver {
851
1011
  },
852
1012
  };
853
1013
  }
854
- /**
855
- * Check if a reference name has any possible match in the codebase.
856
- * Uses the pre-built knownNames set to skip expensive resolution
857
- * for names that definitely don't exist as symbols.
858
- */
1014
+ knownLowerNames = null;
1015
+ hasAnyPossibleMatchIgnoringCase(name) {
1016
+ if (!this.knownNames)
1017
+ return true;
1018
+ if (!this.knownLowerNames || this.knownLowerNames.size === 0) {
1019
+ this.knownLowerNames = new Set();
1020
+ for (const known of this.knownNames)
1021
+ this.knownLowerNames.add(known.toLowerCase());
1022
+ }
1023
+ const lower = name.toLowerCase();
1024
+ if (this.knownLowerNames.has(lower))
1025
+ return true;
1026
+ return lower.split(/::|->|\./).some((part) => part.length > 0 && this.knownLowerNames.has(part));
1027
+ }
859
1028
  hasAnyPossibleMatch(name) {
860
1029
  if (!this.knownNames)
861
- return true; // no pre-filter available
862
- // Direct name match
863
- if (this.knownNames.has(name))
864
1030
  return true;
865
- // For qualified names like "obj.method" or "Class::method", check the parts
1031
+ const only = this.classExpressionFreeBases.has(this.context) ? this.classExpressionOnlyNames() : null;
1032
+ const known = (n) => this.knownNames.has(n) && !(only?.has(n) ?? false);
1033
+ if (known(name))
1034
+ return true;
866
1035
  const dotIdx = name.indexOf('.');
867
1036
  if (dotIdx > 0) {
868
1037
  const receiver = name.substring(0, dotIdx);
869
1038
  const member = name.substring(dotIdx + 1);
870
- if (this.knownNames.has(receiver) || this.knownNames.has(member))
1039
+ if (known(receiver) || known(member))
871
1040
  return true;
872
- // Also check capitalized receiver (instance-method resolution)
873
1041
  const capitalized = receiver.charAt(0).toUpperCase() + receiver.slice(1);
874
- if (this.knownNames.has(capitalized))
1042
+ if (known(capitalized))
875
1043
  return true;
876
- // JVM FQN: `com.example.foo.Bar` — the only useful segment is the
877
- // last one (`Bar`); the earlier check finds `example.foo.Bar` which
878
- // never matches a node name.
879
1044
  const lastDot = name.lastIndexOf('.');
880
1045
  if (lastDot > dotIdx) {
881
1046
  const tail = name.substring(lastDot + 1);
882
- if (tail && this.knownNames.has(tail))
1047
+ if (tail && known(tail))
883
1048
  return true;
884
1049
  }
885
1050
  }
@@ -887,24 +1052,15 @@ class ReferenceResolver {
887
1052
  if (colonIdx > 0) {
888
1053
  const receiver = name.substring(0, colonIdx);
889
1054
  const member = name.substring(colonIdx + 2);
890
- if (this.knownNames.has(receiver) || this.knownNames.has(member))
1055
+ if (known(receiver) || known(member))
891
1056
  return true;
892
- // Multi-segment path `a::b::c` (a Rust/C++ module call like
893
- // `database::profiles::find`) — the only segment that names a symbol is
894
- // the last (`c`); `member` above is `b::c`, which never matches a node
895
- // name, so without this the pre-filter drops the ref before the Rust path
896
- // resolver ever sees it. Mirror the dotted-name leaf check above.
897
1057
  const lastColon = name.lastIndexOf('::');
898
1058
  if (lastColon > colonIdx) {
899
1059
  const tail = name.substring(lastColon + 2);
900
- if (tail && this.knownNames.has(tail))
1060
+ if (tail && known(tail))
901
1061
  return true;
902
1062
  }
903
1063
  }
904
- // Lua/Luau method calls use a single `:` (`lg:log`); R uses `$` (`lg$log`).
905
- // Check the member (and receiver) around these separators too, so the ref
906
- // isn't dropped here before the method-call resolver ever sees it. The `:`
907
- // case is skipped when the name actually contains `::` (handled above).
908
1064
  for (const sep of [':', '$']) {
909
1065
  if (sep === ':' && name.includes('::'))
910
1066
  continue;
@@ -912,27 +1068,21 @@ class ReferenceResolver {
912
1068
  if (sepIdx > 0) {
913
1069
  const receiver = name.substring(0, sepIdx);
914
1070
  const member = name.substring(sepIdx + 1);
915
- if (this.knownNames.has(member) || this.knownNames.has(receiver))
1071
+ if (known(member) || known(receiver))
916
1072
  return true;
917
1073
  const capitalized = receiver.charAt(0).toUpperCase() + receiver.slice(1);
918
- if (this.knownNames.has(capitalized))
1074
+ if (known(capitalized))
919
1075
  return true;
920
1076
  }
921
1077
  }
922
- // For path-like references (e.g., "snippets/drawer-menu.liquid"), check the filename
923
1078
  const slashIdx = name.lastIndexOf('/');
924
1079
  if (slashIdx > 0) {
925
1080
  const fileName = name.substring(slashIdx + 1);
926
- if (this.knownNames.has(fileName))
1081
+ if (known(fileName))
927
1082
  return true;
928
1083
  }
929
1084
  return false;
930
1085
  }
931
- /**
932
- * Does `ref.referenceName` match an import declared in its containing
933
- * file? Used as a pre-filter escape so re-export chain resolution
934
- * still gets a chance when the name has no project-wide declaration.
935
- */
936
1086
  matchesAnyImport(ref) {
937
1087
  const imports = this.context.getImportMappings(ref.filePath, ref.language);
938
1088
  if (imports.length === 0)
@@ -945,101 +1095,270 @@ class ReferenceResolver {
945
1095
  }
946
1096
  return false;
947
1097
  }
948
- /**
949
- * Resolve a single reference.
950
- *
951
- * Thin decorator over `resolveOneInner` so every strategy — framework,
952
- * import, name-match, chain, CFML component path — passes through the
953
- * inheritance target-kind gate at ONE seam. Filtering inside the
954
- * name-matcher would have covered `matchByExactName` only.
955
- * Calls that land on an alias binding then forward once to the callable
956
- * the alias names (see ./alias-binding), regardless of the strategy.
957
- */
1098
+ pythonAttrRetryCandidates(touched, ceiling = 2000) {
1099
+ const touchedSet = new Set(touched);
1100
+ const closure = this.queries.getPythonImporterClosure(touched).filter((f) => !touchedSet.has(f));
1101
+ const keyOf = (ref) => `${ref.fromNodeId}\0${ref.referenceName}`;
1102
+ const resolvable = (refs) => {
1103
+ const answers = new Map();
1104
+ return refs.filter((ref) => {
1105
+ if (!ref.filePath || !ref.language)
1106
+ return false;
1107
+ const key = keyOf(ref);
1108
+ let ok = answers.get(key);
1109
+ if (ok === undefined)
1110
+ answers.set(key, (ok = (0, name_matcher_1.pythonAttrRefResolves)(ref, this.context)));
1111
+ return ok;
1112
+ });
1113
+ };
1114
+ const candidates = this.queries.getFailedPythonAttrRefKeys(closure);
1115
+ const load = (keys) => this.queries.getUnresolvedReferencesByIds(keys.map((k) => k.id));
1116
+ if (new Set(candidates.map(keyOf)).size <= ceiling)
1117
+ return resolvable(load(candidates));
1118
+ const assigned = new Set();
1119
+ const defined = new Set();
1120
+ const subclassing = new Set();
1121
+ const calling = new Set();
1122
+ for (const file of touched) {
1123
+ const source = this.context.readFile(file);
1124
+ if (source) {
1125
+ const text = (0, strip_comments_1.stripCommentsForRegex)(source, 'python');
1126
+ for (const m of text.matchAll(/\b(?:self|cls)\.(\w+)\s*(?::[^=\n]*)?=(?!=)|^[ \t]+(\w+)\s*(?::[^=\n]*)?=(?!=)/gm)) {
1127
+ assigned.add((m[1] ?? m[2]));
1128
+ }
1129
+ }
1130
+ for (const n of this.context.getNodesInFile(file)) {
1131
+ if (n.kind === 'class' || n.kind === 'function' || n.kind === 'method')
1132
+ defined.add(n.name);
1133
+ }
1134
+ for (const f of this.queries.getPythonFilesWithEdgesInto(file, ['extends'], ['class']))
1135
+ subclassing.add(f);
1136
+ for (const f of this.queries.getPythonFilesWithEdgesInto(file, ['calls', 'instantiates'], ['function', 'method', 'class'])) {
1137
+ calling.add(f);
1138
+ }
1139
+ }
1140
+ const callees = new Map();
1141
+ const assignedCallees = (file, attr) => {
1142
+ let byAttr = callees.get(file);
1143
+ if (!byAttr) {
1144
+ byAttr = new Map();
1145
+ const source = this.context.readFile(file);
1146
+ const text = source ? (0, strip_comments_1.stripCommentsForRegex)(source, 'python') : '';
1147
+ for (const m of text.matchAll(/\b(\w+)\s*(?::[^=\n]*)?=(?!=)\s*(?:await\s+)?(?:[\w.]*\.)?(\w+)\s*\(/g)) {
1148
+ let set = byAttr.get(m[1]);
1149
+ if (!set)
1150
+ byAttr.set(m[1], (set = new Set()));
1151
+ set.add(m[2]);
1152
+ }
1153
+ callees.set(file, byAttr);
1154
+ }
1155
+ return byAttr.get(attr) ?? new Set();
1156
+ };
1157
+ const kept = candidates.filter((ref) => {
1158
+ const name = ref.referenceName;
1159
+ if (name.includes('().'))
1160
+ return defined.has(name.split('().')[0].split('.').pop());
1161
+ const segs = name.split('.');
1162
+ if (segs.length !== 3 || !segs.every((seg) => /^[A-Za-z_]\w*$/.test(seg)))
1163
+ return false;
1164
+ const attr = segs[1];
1165
+ if (assigned.has(attr))
1166
+ return true;
1167
+ if (subclassing.has(ref.filePath) && (segs[0] === 'self' || segs[0] === 'cls'))
1168
+ return true;
1169
+ return calling.has(ref.filePath) && [...assignedCallees(ref.filePath, attr)].some((c) => defined.has(c));
1170
+ });
1171
+ return new Set(kept.map(keyOf)).size <= ceiling ? resolvable(load(kept)) : null;
1172
+ }
958
1173
  resolveOne(ref) {
959
- // A C/C++ "call" whose name is a function-like macro visible in this
960
- // translation unit is a macro expansion, not a call — it must never bind
961
- // to a same-named function in another file (#1838).
1174
+ const outer = this.context;
1175
+ const unviewed = this.classExpressionFreeBases.get(outer) ?? outer;
1176
+ const base = unviewed === this.mocklessContext && this.mocklessBase ? this.mocklessBase : unviewed;
1177
+ const mockless = this.mocklessContextFor(ref, base) ?? base;
1178
+ const context = this.classExpressionFreeContextFor(ref, mockless) ?? mockless;
1179
+ this.lastResolved = { ref, context };
1180
+ return this.resolveOneWith(context, ref);
1181
+ }
1182
+ lastResolved = null;
1183
+ resolveOneWith(context, ref) {
1184
+ const outer = this.context;
1185
+ if (context === outer)
1186
+ return this.resolveOneIn(ref);
1187
+ this.context = context;
1188
+ try {
1189
+ return this.resolveOneIn(ref);
1190
+ }
1191
+ finally {
1192
+ this.context = outer;
1193
+ }
1194
+ }
1195
+ resolveOneIn(ref) {
1196
+ const byName = (0, name_matcher_1.rustChainedCallByName)(ref);
1197
+ if (byName) {
1198
+ const resolved = this.resolveOneIn(byName);
1199
+ return resolved && { ...resolved, original: ref };
1200
+ }
962
1201
  if ((0, cpp_macro_visibility_1.isVisibleCppMacro)(ref, this.context))
963
1202
  return null;
964
- const candidate = this.gateTargetKind(this.resolveOneInner(ref), ref);
965
- const resolved = candidate?.resolvedBy === 'framework'
966
- ? this.gateFrameworkLanguage(candidate, ref)
967
- : this.gateLanguage(candidate, ref);
1203
+ const candidate = (0, dart_local_scope_1.gateDartLocal)((0, type_parameters_1.gateTypeParameter)((0, swift_type_visibility_1.gateSwiftTypeTarget)(this.gateTargetKind(this.resolveOneInner(ref), ref), ref, this.context), ref, this.context), ref, this.context);
1204
+ const scoped = this.gateRustScope(candidate, ref);
1205
+ const resolved = (0, name_matcher_1.preferGoBuildTwin)(this.gateSuperSelfCall(scoped?.resolvedBy === 'framework' ? this.gateFrameworkLanguage(scoped, ref) : this.gateLanguage(scoped, ref), ref), ref, this.context);
1206
+ if (resolved && ref.language === 'dart' && ref.referenceKind === 'references' &&
1207
+ resolved.targetNodeId === ref.fromNodeId)
1208
+ return null;
1209
+ if (resolved && (0, name_matcher_1.isPythonFromImportModule)(ref, this.context)) {
1210
+ const module = this.nodeById(resolved.targetNodeId);
1211
+ if (module && module.kind !== 'file' && module.kind !== 'module')
1212
+ return null;
1213
+ }
1214
+ if (resolved && (resolved.byName || resolved.resolvedBy === 'exact-match' || resolved.resolvedBy === 'fuzzy') &&
1215
+ (0, name_matcher_1.isGuessedRecordAccessor)(resolved, ref, this.context))
1216
+ return null;
1217
+ if (resolved && (resolved.byName || resolved.resolvedBy === 'exact-match' || resolved.resolvedBy === 'fuzzy')) {
1218
+ const target = this.nodeById(resolved.targetNodeId);
1219
+ if (target && (0, name_matcher_1.crossesWorkspaceRoot)(target, ref, this.context))
1220
+ return null;
1221
+ }
1222
+ if (resolved && resolved.resolvedBy === 'import' && (0, name_matcher_1.isImportShadowedByJsBinding)(resolved, ref, this.context))
1223
+ return null;
1224
+ if (resolved && resolved.resolvedBy !== 'import') {
1225
+ const specifier = (0, ambient_modules_1.ambientModuleDeclarations)(this.context).get(resolved.targetNodeId);
1226
+ const declaringFile = specifier === undefined ? undefined : this.nodeById(resolved.targetNodeId)?.filePath;
1227
+ if (declaringFile !== undefined && declaringFile !== ref.filePath &&
1228
+ !(0, import_resolver_1.reachesAmbientModule)(ref, specifier, declaringFile, this.context))
1229
+ return null;
1230
+ }
968
1231
  if (!resolved || ref.referenceKind !== 'calls')
969
1232
  return resolved;
970
- const target = this.nodeById(resolved.targetNodeId);
1233
+ const call = ref.language === 'pascal' ? (0, pascal_scope_1.gatePascalCall)(resolved, ref, this.context) : resolved;
1234
+ if (!call)
1235
+ return null;
1236
+ const target = this.nodeById(call.targetNodeId);
971
1237
  if (!target)
972
- return resolved;
1238
+ return call;
973
1239
  const dot = ref.referenceName.lastIndexOf('.');
974
1240
  const memberName = dot >= 0 ? ref.referenceName.slice(dot + 1) : null;
975
1241
  const forwarded = (0, alias_binding_1.resolveAliasBinding)(target, memberName, this.context);
976
- if (!forwarded || forwarded.id === resolved.targetNodeId)
977
- return resolved;
1242
+ if (!forwarded || forwarded.id === call.targetNodeId)
1243
+ return call;
978
1244
  return this.gateLanguage({
979
- ...resolved,
1245
+ ...call,
980
1246
  targetNodeId: forwarded.id,
981
- confidence: Math.min(resolved.confidence, 0.85),
1247
+ confidence: Math.min(call.confidence, 0.85),
982
1248
  }, ref);
983
1249
  }
984
1250
  resolveOneInner(ref) {
985
- // A local C++ object construction (`T obj(args)`, ref `ns::T::T/1`)
986
- // resolves ONLY to a constructor of the lexically nearest `T` (#1839).
987
1251
  if ((0, cpp_constructor_1.isCppConstructorRef)(ref))
988
1252
  return (0, cpp_constructor_1.matchCppConstructor)(ref, this.context);
989
- // Skip built-in/external references
1253
+ if ((0, cpp_supertypes_1.isCppSupertypeRef)(ref))
1254
+ return (0, cpp_supertypes_1.matchCppSupertype)(ref, this.context);
1255
+ if ((0, cpp_supertypes_1.isCppDeclaredTypeRef)(ref, this.context))
1256
+ return (0, cpp_supertypes_1.matchCppDeclaredType)(ref, this.context);
1257
+ if ((0, name_matcher_2.isObjcDeclaredTypeRef)(ref))
1258
+ return (0, name_matcher_2.matchByExactName)(ref, this.context);
1259
+ if ((0, pascal_scope_1.isPascalParenlessRef)(ref))
1260
+ return (0, pascal_scope_1.matchPascalParenlessRef)(ref, this.context);
1261
+ if ((0, pascal_scope_1.isPascalSystemCall)(ref, this.context))
1262
+ return (0, pascal_scope_1.matchPascalSystemCall)(ref, this.context);
1263
+ const nested = (0, pascal_scope_1.matchPascalNestedCall)(ref, this.context);
1264
+ if (nested)
1265
+ return nested;
1266
+ if ((0, name_matcher_1.isDartMemberRead)(ref))
1267
+ return (0, name_matcher_1.matchDartMemberRead)(ref, this.context);
1268
+ if ((0, name_matcher_1.isDartChainLink)(ref, this.context))
1269
+ return (0, name_matcher_1.matchDartChainLink)(ref, this.context);
1270
+ if ((0, name_matcher_1.isDartAnnotation)(ref))
1271
+ return (0, name_matcher_1.matchDartAnnotation)(ref, this.context);
1272
+ const asserted = (0, name_matcher_1.matchGoAssertedCall)(ref, this.context);
1273
+ if (asserted !== undefined)
1274
+ return asserted;
1275
+ const indexed = (0, name_matcher_1.matchGoIndexedCall)(ref, this.context);
1276
+ if (indexed !== undefined)
1277
+ return indexed;
1278
+ const chained = (0, name_matcher_1.matchGoChainedCall)(ref, this.context);
1279
+ if (chained !== undefined)
1280
+ return chained;
1281
+ const themeFile = (0, shopify_themes_1.matchShopifyThemeFile)(ref, this.context);
1282
+ if (themeFile !== undefined)
1283
+ return themeFile;
1284
+ const superCall = (0, js_super_calls_1.matchJsSuperCall)(ref, this.context);
1285
+ if (superCall !== undefined)
1286
+ return superCall;
1287
+ if (ref.language === 'kotlin' && ref.referenceKind === 'calls') {
1288
+ const root = ref.referenceName.slice(0, ref.referenceName.indexOf('.'));
1289
+ if (root && this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.localName === root)) {
1290
+ const viaImport = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1291
+ if (viaImport)
1292
+ return viaImport;
1293
+ }
1294
+ const chain = (0, name_matcher_1.matchKotlinReceiverChain)(ref, this.context);
1295
+ if (chain && 'method' in chain) {
1296
+ const bare = this.resolveOneInner({ ...ref, referenceName: chain.method });
1297
+ return bare ? { ...bare, original: ref } : null;
1298
+ }
1299
+ if (chain !== undefined)
1300
+ return this.gateLanguage(chain, ref);
1301
+ }
990
1302
  if (this.isBuiltInOrExternal(ref)) {
991
- return null;
1303
+ return this.isPythonBuiltinNamedMethodCall(ref)
1304
+ ? this.gateLanguage((0, name_matcher_1.matchPythonTypedLocalCall)(ref, this.context), ref)
1305
+ : null;
992
1306
  }
993
- // CFML component paths in inheritance (#1152): `extends="coldbox.system.web.
994
- // Controller"` names the supertype by its dot-separated path (or `extends=
995
- // "../base"` by relative file path) — the graph indexes the class under its
996
- // final segment only, so these die at the fast pre-filter below and never
997
- // resolved. Handled by a dedicated path-corroborated matcher, gated to
998
- // inheritance refs only (a dotted `calls` ref is a member-access chain, not
999
- // a component path). No fallthrough on miss: the full path string can only
1000
- // ever mis-match downstream, and an unresolvable supertype usually lives in
1001
- // an out-of-repo library (mxunit, testbox) — silent beats wrong.
1002
1307
  if ((ref.language === 'cfml' || ref.language === 'cfscript') &&
1003
1308
  (ref.referenceKind === 'extends' || ref.referenceKind === 'implements') &&
1004
1309
  (ref.referenceName.includes('.') || ref.referenceName.includes('/'))) {
1005
1310
  return this.resolveCfmlComponentPath(ref);
1006
1311
  }
1007
- // Fast pre-filter: skip if no symbol with this name exists anywhere
1008
- // AND the name doesn't match a local import. The import escape is
1009
- // necessary because re-export rename chains (`import { login }
1010
- // from './barrel'` where the barrel has `export { signIn as login }
1011
- // from './auth'`) intentionally call a name that has no
1012
- // declaration anywhere — only the renamed upstream symbol does.
1013
- // ArkTS chained-attribute refs carry a leading dot (`.titleStyle`) that
1014
- // routes them to the decorator-gated matcher; the symbol itself is
1015
- // indexed under the bare name, so the existence check strips the dot.
1016
- // Nix static path imports (`import ./x.nix`) name a FILE, not a symbol —
1017
- // they bypass the symbol-existence check and resolve via resolveViaImport.
1312
+ if (ref.language === 'cfml' || ref.language === 'cfscript') {
1313
+ if (ref.referenceKind === 'instantiates' && ref.referenceName.includes('.'))
1314
+ return this.resolveCfmlComponentPath(ref);
1315
+ if (ref.referenceKind === 'calls' && CFML_CONSTRUCTED_CALL.test(ref.referenceName))
1316
+ return this.resolveCfmlConstructedCall(ref);
1317
+ }
1318
+ if ((ref.language === 'cfml' || ref.language === 'cfscript') && ref.referenceKind === 'imports' && isCfmlTemplatePath(ref.referenceName)) {
1319
+ const included = this.resolveCfmlIncludePath(ref) ?? (0, name_matcher_1.matchByFilePath)(ref, this.context);
1320
+ if (included && this.nodeById(included.targetNodeId)?.filePath === ref.filePath)
1321
+ return null;
1322
+ return this.gateLanguage(included, ref);
1323
+ }
1324
+ const phpQualified = (0, import_resolver_1.resolvePhpQualifiedClassRef)(ref, this.context);
1325
+ if (phpQualified !== undefined)
1326
+ return this.gateLanguage(phpQualified, ref);
1327
+ const rubyPath = (0, ruby_constant_paths_1.matchRubyConstantPathRef)(ref, this.context);
1328
+ if (rubyPath !== undefined)
1329
+ return this.gateLanguage(rubyPath, ref);
1330
+ const rustBound = (0, name_matcher_1.matchRustUseBoundName)(ref, this.context);
1331
+ if (rustBound !== undefined)
1332
+ return this.gateLanguage(rustBound, ref);
1018
1333
  let existenceName = ref.language === 'arkts' && ref.referenceName.startsWith('.')
1019
1334
  ? ref.referenceName.slice(1)
1020
1335
  : ref.referenceName;
1021
- // Erlang refs carry the call-site arity (`f/1`, `mod::f/2` — #1610); the
1022
- // name index stores bare names, so existence is checked arity-less.
1023
1336
  if (ref.language === 'erlang')
1024
1337
  existenceName = existenceName.replace(/\/\d{1,3}$/, '');
1338
+ if ((ref.language === 'cpp' || ref.language === 'c') && existenceName.startsWith('::')) {
1339
+ existenceName = existenceName.slice(2);
1340
+ }
1025
1341
  const tPre = this.profileStages ? process.hrtime.bigint() : 0n;
1026
1342
  const preFilterPass = (0, import_resolver_1.isNixPathImportRef)(ref) ||
1343
+ (0, import_resolver_1.isJsPathImportRef)(ref) ||
1027
1344
  this.hasAnyPossibleMatch(existenceName) ||
1345
+ (name_matcher_1.CASE_INSENSITIVE_LANGUAGES.has(ref.language) && this.hasAnyPossibleMatchIgnoringCase(existenceName)) ||
1028
1346
  this.matchesAnyImport(ref) ||
1029
- this.frameworks.some((f) => f.claimsReference?.(ref.referenceName));
1347
+ this.frameworksFor(ref.language).some((f) => f.claimsReference?.(ref.referenceName));
1030
1348
  if (this.profileStages)
1031
1349
  this.stageAdd('preFilter', ref, preFilterPass, tPre);
1032
1350
  if (!preFilterPass) {
1033
1351
  return this.gateLanguage((0, name_matcher_1.matchJsStoreBindingCall)(ref, this.context), ref);
1034
1352
  }
1035
- // Function-as-value refs (#756) get a dedicated, strictly-gated path:
1036
- // import-based resolution first (an imported callback resolves through its
1037
- // import, the most precise cross-file signal), then matchFunctionRef
1038
- // (same-file first, unique-only cross-file, function/method targets only).
1039
- // They never reach the framework or fuzzy strategies below.
1353
+ if ((0, vbnet_receivers_1.isVbMemberRead)(ref))
1354
+ return this.gateLanguage((0, vbnet_receivers_1.matchVbMemberRead)(ref, this.context), ref);
1355
+ if ((0, vbnet_receivers_1.isVbPathCall)(ref)) {
1356
+ return this.gateLanguage((0, vbnet_receivers_1.matchVbPathCall)(ref, this.context, (name) => (0, name_matcher_1.isStdMethodName)('vbnet', name)), ref);
1357
+ }
1358
+ const tsQualified = (0, import_resolver_1.resolveTsQualifiedTypeRef)(ref, this.context);
1359
+ if (tsQualified !== undefined)
1360
+ return this.gateLanguage(tsQualified, ref);
1040
1361
  if (ref.referenceKind === 'function_ref') {
1041
- // `this.<member>` values (TS/JS) resolve ONLY against the enclosing
1042
- // class's own members — never a same-named symbol elsewhere.
1043
1362
  if (ref.referenceName.startsWith('this.')) {
1044
1363
  return this.gateLanguage(this.resolveThisMemberFnRef(ref), ref);
1045
1364
  }
@@ -1052,51 +1371,35 @@ class ReferenceResolver {
1052
1371
  if (target &&
1053
1372
  (target.kind === 'function' ||
1054
1373
  target.kind === 'method' ||
1055
- // Python (#1478): an imported class used as a value (`return
1056
- // OrgSerializerFull`) resolves through its import like any
1057
- // callback — mirrors matchFunctionRef's bareClassOk.
1058
1374
  (ref.language === 'python' && target.kind === 'class'))) {
1059
1375
  return viaImport;
1060
1376
  }
1061
1377
  }
1062
1378
  return this.gateLanguage((0, name_matcher_1.matchFunctionRef)(ref, this.context), ref);
1063
1379
  }
1064
- // JVM FQN imports skip framework/name-matcher: `import com.example.Bar`
1065
- // resolves directly through the qualifiedName index, which is unambiguous
1066
- // even when several `Bar` classes exist in different packages.
1067
1380
  const tJvm = this.profileStages ? process.hrtime.bigint() : 0n;
1068
1381
  const jvmImport = (0, import_resolver_1.resolveJvmImport)(ref, this.context);
1069
1382
  if (this.profileStages)
1070
1383
  this.stageAdd('jvmImport', ref, !!jvmImport, tJvm);
1071
1384
  if (jvmImport)
1072
1385
  return jvmImport;
1073
- // Razor/Blazor: a markup or `@code` type ref resolves through the file's
1074
- // `@using` namespaces (incl. folder `_Imports.razor`). This precisely
1075
- // disambiguates a simple name that exists in several namespaces — e.g.
1076
- // `CatalogBrand` resolving to `BlazorShared.Models::CatalogBrand` (the DTO,
1077
- // which the `.razor` `@using`s) rather than the same-named domain entity.
1078
1386
  if (ref.language === 'razor') {
1079
1387
  const razorResult = this.resolveRazorUsing(ref);
1080
1388
  if (razorResult)
1081
1389
  return razorResult;
1082
1390
  }
1083
- // An explicit PHP class import owns its static calls, including an
1084
- // unavailable method. Do not let same-name fallbacks change the receiver
1085
- // to an unrelated Service/Repository type (#1545).
1086
1391
  const phpStaticImport = (0, import_resolver_1.resolvePhpImportedStaticCall)(ref, this.context);
1087
1392
  if (phpStaticImport !== undefined)
1088
1393
  return this.gateLanguage(phpStaticImport, ref);
1089
1394
  const candidates = [];
1090
- // Strategy 1: Try framework-specific resolution. Cross-language bridges
1091
- // are deliberately preserved (Drupal `routing.yml` → PHP controller, RN
1092
- // JS → native `calls`); other code references obey the shared family gate.
1093
1395
  const tFw = this.profileStages ? process.hrtime.bigint() : 0n;
1094
1396
  let fwEarly = null;
1095
- for (const framework of this.frameworks) {
1096
- const result = this.gateFrameworkLanguage(framework.resolve(ref, this.context), ref);
1397
+ for (const framework of this.frameworksFor(ref.language)) {
1398
+ const resolved = this.gateFrameworkLanguage(framework.resolve(ref, this.context), ref);
1399
+ const result = resolved ? { ...resolved, metadata: { ...resolved.metadata, framework: framework.name } } : null;
1097
1400
  if (result) {
1098
1401
  if (result.confidence >= 0.9) {
1099
- fwEarly = result; // High confidence, return immediately (below)
1402
+ fwEarly = result;
1100
1403
  break;
1101
1404
  }
1102
1405
  candidates.push(result);
@@ -1106,23 +1409,38 @@ class ReferenceResolver {
1106
1409
  this.stageAdd('frameworks', ref, fwEarly !== null, tFw);
1107
1410
  if (fwEarly)
1108
1411
  return fwEarly;
1109
- // A retained untyped chain supplies effect/call-site evidence only. In
1110
- // particular, importing its root does not make the root its call target.
1111
- if ((0, name_matcher_1.isUnresolvedJsMemberCall)(ref))
1112
- return null;
1113
- // Strategy 2: Try import-based resolution
1114
- // A TS/JS/Python call-receiver chain (`useStore.getState().reset`, #1683)
1115
- // names the ROOT's import, not the method's: letting resolveViaImport see
1116
- // it binds the call to the imported store constant and the method is
1117
- // never looked up. The name-matcher owns the chain shape for these
1118
- // languages — the Java/Kotlin/C++ chains keep their existing path.
1412
+ if (this.frameworksFor(ref.language).some((f) => f.ownsReference?.(ref, this.context))) {
1413
+ return candidates.length > 0
1414
+ ? candidates.reduce((best, curr) => (curr.confidence > best.confidence ? curr : best))
1415
+ : null;
1416
+ }
1417
+ if ((0, name_matcher_1.isUnresolvedJsMemberCall)(ref)) {
1418
+ const root = ref.referenceName.slice(0, ref.referenceName.indexOf('.'));
1419
+ const namespace = this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.isNamespace && m.localName === root);
1420
+ if (!namespace)
1421
+ return this.gateLanguage((0, name_matcher_1.matchObjectPathCall)(ref, this.context), ref);
1422
+ const viaNamespace = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1423
+ const target = viaNamespace ? this.nodeById(viaNamespace.targetNodeId) : null;
1424
+ return target && (target.kind === 'function' || target.kind === 'method' || target.kind === 'class' || target.kind === 'constant' || target.kind === 'variable')
1425
+ ? viaNamespace : null;
1426
+ }
1119
1427
  if (ref.referenceKind === 'calls' &&
1120
1428
  CHAIN_SHAPE.test(ref.referenceName) &&
1121
1429
  (ref.language === 'typescript' || ref.language === 'javascript' || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'python')) {
1122
- return this.gateLanguage((0, name_matcher_1.matchReference)(ref, this.context), ref);
1430
+ const chainResult = this.gateLanguage((0, name_matcher_1.matchReference)(ref, this.context), ref);
1431
+ if (!chainResult && name_matcher_1.NEW_RECEIVER_SHAPE.test(ref.referenceName)) {
1432
+ const cls = (0, name_matcher_1.newReceiverClass)(ref, this.context);
1433
+ if (cls && this.context.getNodesByName(cls).some((n) => n.kind === 'class' && (0, name_matcher_1.sameLanguageFamily)(n.language, ref.language))) {
1434
+ this.deferReference(ref, this.deferredChainRefs);
1435
+ }
1436
+ }
1437
+ return chainResult;
1123
1438
  }
1124
1439
  const tImp = this.profileStages ? process.hrtime.bigint() : 0n;
1125
- const importResult = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1440
+ const selfCall = ref.language === 'python' && ref.referenceKind === 'calls' &&
1441
+ this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.localName === ref.referenceName) &&
1442
+ (0, name_matcher_1.isPythonSelfCall)(ref, this.context);
1443
+ const importResult = selfCall ? null : this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1126
1444
  if (this.profileStages)
1127
1445
  this.stageAdd('viaImport', ref, !!importResult, tImp);
1128
1446
  if (importResult) {
@@ -1130,38 +1448,17 @@ class ReferenceResolver {
1130
1448
  return importResult;
1131
1449
  candidates.push(importResult);
1132
1450
  }
1133
- // PHP include/require paths resolve to files via import resolution only.
1134
- // If that didn't find the file, do NOT fall back to the symbol
1135
- // name-matcher — it would mis-connect e.g. "inc/db.php" to an unrelated
1136
- // db.php elsewhere in the tree (a wrong edge is worse than none, #660).
1137
- // Terraform refs are directory-scoped by language semantics — the
1138
- // framework resolver IS the whole rulebook (`var.X` can never legally
1139
- // bind outside its module directory), so the name-matcher's
1140
- // qualified-name fallback would only ever add wrong cross-module edges.
1141
- // Nix static path imports are file references for the same reason —
1142
- // falling through would let "./x.nix" name-match an unrelated node.
1143
- if ((0, import_resolver_1.isPhpIncludePathRef)(ref) || (0, import_resolver_1.isCobolCopybookRef)(ref) || (0, import_resolver_1.isNixPathImportRef)(ref) || ref.language === 'terraform') {
1451
+ if ((0, import_resolver_1.isPhpIncludePathRef)(ref) || (0, import_resolver_1.isCobolCopybookRef)(ref) || (0, import_resolver_1.isNixPathImportRef)(ref) || (0, import_resolver_1.isDartImportRef)(ref) || (0, import_resolver_1.isLuaRequireRef)(ref) || ref.language === 'terraform') {
1144
1452
  return candidates.length > 0
1145
1453
  ? candidates.reduce((best, curr) => curr.confidence > best.confidence ? curr : best)
1146
1454
  : null;
1147
1455
  }
1148
- // Strategy 3: Try name matching
1149
1456
  const tName = this.profileStages ? process.hrtime.bigint() : 0n;
1150
1457
  let nameResult = this.gateLanguage((0, name_matcher_1.matchReference)(ref, this.context), ref);
1151
1458
  if (this.profileStages)
1152
1459
  this.stageAdd('nameMatch', ref, !!nameResult, tName);
1153
- // Nix has no ambient cross-file namespace — a callee binds lexically
1154
- // (same file) or through explicit import/callPackage wiring (the import
1155
- // path above). A cross-file name match is wrong by construction: every
1156
- // module `inherit (lib) mkOption`s the same nixpkgs helpers, so the
1157
- // matcher would link each `mkOption` call to whichever file's inherit
1158
- // binding it happened to pick. Same-file matches only.
1159
1460
  if (nameResult) {
1160
1461
  const target = this.nodeById(nameResult.targetNodeId);
1161
- // A definition its language makes file-local — a C `static`, a Kotlin
1162
- // `private fun`, a Go unexported name in another package, a Rust
1163
- // non-`pub` item outside its module subtree — cannot be what a name in
1164
- // another file means, whichever strategy chose it (#1730).
1165
1462
  if (target && !(0, name_matcher_1.isVisibleAcrossFiles)(target, ref, this.context)) {
1166
1463
  nameResult = null;
1167
1464
  }
@@ -1171,10 +1468,6 @@ class ReferenceResolver {
1171
1468
  }
1172
1469
  }
1173
1470
  else if (target && target.language === 'nix') {
1174
- // The reverse direction is just as impossible: no other language can
1175
- // symbolically call into a .nix binding (interop is eval/CLI, never a
1176
- // linkable symbol) — without this, a Python script's `split()` lands
1177
- // on some module's `split = ...` binding as a low-confidence match.
1178
1471
  nameResult = null;
1179
1472
  }
1180
1473
  }
@@ -1182,41 +1475,24 @@ class ReferenceResolver {
1182
1475
  candidates.push(nameResult);
1183
1476
  }
1184
1477
  if (candidates.length === 0) {
1185
- // Defer a chained static-factory/fluent call the first pass couldn't
1186
- // resolve — its method may live on a supertype the receiver conforms to,
1187
- // resolvable once implements/extends edges exist (the conformance pass).
1188
1478
  if (ref.referenceKind === 'calls' &&
1189
1479
  CHAIN_LANGUAGES.has(ref.language) &&
1190
1480
  CHAIN_SHAPE.test(ref.referenceName)) {
1191
1481
  this.deferReference(ref, this.deferredChainRefs);
1192
1482
  }
1193
- else if (
1194
- // PHP `$this->prop->method()` (encoded `this->prop.method`): its method
1195
- // may live on the property's declared supertype, resolvable only once
1196
- // implements/extends edges exist — defer to the same conformance pass.
1197
- ref.referenceKind === 'calls' &&
1483
+ else if (ref.referenceKind === 'calls' &&
1198
1484
  ref.language === 'php' &&
1199
1485
  PHP_PROP_SHAPE.test(ref.referenceName)) {
1200
1486
  this.deferReference(ref, this.deferredChainRefs);
1201
1487
  }
1202
1488
  return null;
1203
1489
  }
1204
- // Return highest confidence candidate
1205
1490
  return candidates.reduce((best, curr) => curr.confidence > best.confidence ? curr : best);
1206
1491
  }
1207
- /**
1208
- * Create edges from resolved references
1209
- */
1210
1492
  createEdges(resolved) {
1211
1493
  return resolved.flatMap((ref) => {
1212
- // `function_ref` (#756) is internal-only: it persists as a `references`
1213
- // edge (the registration site depends on the callback), distinguishable
1214
- // by metadata.resolvedBy === 'function-ref'. callers/impact already
1215
- // traverse `references`, so registration sites surface with no
1216
- // graph-layer changes.
1217
1494
  let kind = ref.edgeKind ??
1218
1495
  (ref.original.referenceKind === 'function_ref' ? 'references' : ref.original.referenceKind);
1219
- // Promote "extends" to "implements" when a class/struct targets an interface
1220
1496
  if (kind === 'extends') {
1221
1497
  const targetNode = this.nodeById(ref.targetNodeId);
1222
1498
  if (targetNode && (targetNode.kind === 'interface' || targetNode.kind === 'protocol')) {
@@ -1226,11 +1502,17 @@ class ReferenceResolver {
1226
1502
  }
1227
1503
  }
1228
1504
  }
1229
- // Promote "calls" to "instantiates" when the resolved target is a
1230
- // class/struct/union. Languages without a `new` keyword (Python, Ruby)
1231
- // express instantiation as `Foo()` — extraction can't tell that
1232
- // apart from a function call without symbol info, but resolution
1233
- // can: if `Foo` resolves to a class, the call IS an instantiation.
1505
+ if (kind === 'calls' && ref.original.language === 'go') {
1506
+ const targetNode = this.nodeById(ref.targetNodeId);
1507
+ if (targetNode && name_matcher_1.GO_TYPE_KINDS.has(targetNode.kind))
1508
+ kind = 'references';
1509
+ }
1510
+ if (kind === 'calls' &&
1511
+ ref.original.language === 'pascal' &&
1512
+ !ref.original.referenceName.includes('.') &&
1513
+ PASCAL_CAST_TARGET_KINDS.has(this.nodeById(ref.targetNodeId)?.kind ?? '')) {
1514
+ kind = 'references';
1515
+ }
1234
1516
  if (kind === 'calls') {
1235
1517
  const targetNode = this.nodeById(ref.targetNodeId);
1236
1518
  if (targetNode &&
@@ -1238,9 +1520,6 @@ class ReferenceResolver {
1238
1520
  kind = 'instantiates';
1239
1521
  }
1240
1522
  }
1241
- // One reference can name several targets — a navigation whose
1242
- // destination is a conditional reaches every arm. Each becomes its own
1243
- // edge, sharing this resolution's kind and confidence.
1244
1523
  const targets = [
1245
1524
  { targetNodeId: ref.targetNodeId, metadata: ref.metadata },
1246
1525
  ...(ref.alsoTargets ?? []),
@@ -1255,36 +1534,13 @@ class ReferenceResolver {
1255
1534
  ...(t.metadata ?? {}),
1256
1535
  confidence: ref.confidence,
1257
1536
  resolvedBy: ref.resolvedBy,
1258
- // The ORIGINAL reference text (and kind, when edge-kind promotion
1259
- // rewrote it — calls→instantiates, extends→implements,
1260
- // function_ref→references). If this edge's target is later removed
1261
- // by a re-index, the edge is resurrected as exactly this ref and
1262
- // re-resolved (#1240 removal case) — a faithful resurrection, so
1263
- // re-resolution can never bind anywhere a full re-index wouldn't.
1264
- // Reconstruction from the target node's name instead would strip
1265
- // receiver/qualifier context (`h.greet` → `greet`) and risk a
1266
- // wrong rebind; edges without refName (pre-#1240, synthesized) are
1267
- // deliberately NOT resurrected for the same reason.
1268
1537
  refName: ref.original.referenceName,
1269
1538
  ...(ref.original.referenceKind !== kind ? { refKind: ref.original.referenceKind } : {}),
1270
- // Uniform marker for function-as-value edges (#756), regardless of
1271
- // which strategy resolved them (import vs matchFunctionRef) — lets
1272
- // tooling label "callback registration" and lets validation diff
1273
- // exactly the edges this feature added.
1274
1539
  ...(ref.original.referenceKind === 'function_ref' ? { fnRef: true } : {}),
1275
1540
  },
1276
1541
  }));
1277
1542
  });
1278
1543
  }
1279
- /**
1280
- * Split resolved refs into rows deletable by id and hand-built refs that
1281
- * must fall back to the key-tuple delete. Rows loaded from the database
1282
- * carry their row id and are deleted by exactly that id; the key tuple
1283
- * omits line/col, so it also removes SIBLING rows — the same caller calling
1284
- * the same callee at other lines — that a later batch hadn't attempted yet:
1285
- * when a batch boundary split a caller's same-named call sites, the later
1286
- * sites' edges were silently never created (#1269).
1287
- */
1288
1544
  static partitionResolvedCleanup(resolved) {
1289
1545
  const rowIds = [];
1290
1546
  const legacyKeys = [];
@@ -1300,29 +1556,29 @@ class ReferenceResolver {
1300
1556
  }
1301
1557
  return { rowIds, legacyKeys };
1302
1558
  }
1303
- /**
1304
- * Same row-id precision for parking unresolvable refs as status='failed'
1305
- * (#1240): the key-tuple fallback would flip same-key sibling rows in later
1306
- * batches to 'failed' before they were ever attempted, and resolution
1307
- * outcome can differ per call site (receiver-type inference reads the
1308
- * ref's line), so a sibling must not inherit this row's failure (#1269).
1309
- */
1310
1559
  static partitionFailedCleanup(unresolved) {
1311
1560
  const byRowId = [];
1312
1561
  const legacyKeys = [];
1313
1562
  for (const r of unresolved) {
1314
1563
  if (r.rowId != null)
1315
- byRowId.push({ rowId: r.rowId, referenceName: r.referenceName });
1564
+ byRowId.push({ rowId: r.rowId, referenceName: r.referenceName, referenceKind: r.referenceKind, nameTail: r.nameTail });
1316
1565
  else
1317
1566
  legacyKeys.push({
1318
1567
  fromNodeId: r.fromNodeId,
1319
1568
  referenceName: r.referenceName,
1320
1569
  referenceKind: r.referenceKind,
1570
+ nameTail: r.nameTail,
1321
1571
  });
1322
1572
  }
1323
1573
  return { byRowId, legacyKeys };
1324
1574
  }
1325
- /** A deferred attempt is unfinished work, not a final failure (#1577). */
1575
+ parkable(ref) {
1576
+ const read = this.lastResolved?.ref === ref ? this.lastResolved.context : this.context;
1577
+ const tail = (0, import_resolver_1.importBindingTail)(ref, this.context, read);
1578
+ if (tail)
1579
+ ref.nameTail = tail;
1580
+ return ref;
1581
+ }
1326
1582
  nonDeferredFailures(unresolved) {
1327
1583
  return unresolved.filter((ref) => ref.rowId == null || !this.deferredRowIds.has(ref.rowId));
1328
1584
  }
@@ -1331,9 +1587,6 @@ class ReferenceResolver {
1331
1587
  if (ref.rowId != null)
1332
1588
  this.deferredRowIds.add(ref.rowId);
1333
1589
  }
1334
- /**
1335
- * Resolve and persist edges to database
1336
- */
1337
1590
  resolveAndPersist(unresolvedRefs, onProgress) {
1338
1591
  const prerequisites = unresolvedRefs.filter(ReferenceResolver.isPrerequisite);
1339
1592
  if (prerequisites.length > 0 && prerequisites.length < unresolvedRefs.length) {
@@ -1342,27 +1595,15 @@ class ReferenceResolver {
1342
1595
  return ReferenceResolver.mergeResults(first, rest);
1343
1596
  }
1344
1597
  const result = this.resolveAll(unresolvedRefs, onProgress);
1345
- // Create edges from resolved references
1346
1598
  const edges = this.createEdges(result.resolved);
1347
- // Insert edges into database
1348
1599
  if (edges.length > 0) {
1349
1600
  this.queries.insertEdges(edges);
1350
1601
  }
1351
- // Clean up resolved refs from unresolved_refs table so metrics are accurate
1352
1602
  if (result.resolved.length > 0) {
1353
1603
  const { rowIds, legacyKeys } = ReferenceResolver.partitionResolvedCleanup(result.resolved);
1354
1604
  this.queries.deleteReferencesByRowIds(rowIds);
1355
1605
  this.queries.deleteSpecificResolvedReferences(legacyKeys);
1356
1606
  }
1357
- // Park unresolvable refs as status='failed' — parity with
1358
- // resolveAndPersistBatched. Deleting them was wrong (#1240): a ref whose
1359
- // own file never changes is otherwise gone forever, so when a DIFFERENT
1360
- // file later gains the export/symbol that would satisfy it, no sync can
1361
- // recreate the edge — only a full re-index. Failed rows are excluded from
1362
- // the pending readers, which preserves the #1187 orphan sweep's
1363
- // invariant in status form: after a COMPLETED pass nothing it processed
1364
- // is still 'pending', so any pending row at rest belongs to an
1365
- // interrupted run and the sweep can key off the pending count.
1366
1607
  if (result.unresolved.length > 0) {
1367
1608
  const { byRowId, legacyKeys } = ReferenceResolver.partitionFailedCleanup(this.nonDeferredFailures(result.unresolved));
1368
1609
  this.queries.markReferencesFailedByRowIds(byRowId);
@@ -1370,15 +1611,6 @@ class ReferenceResolver {
1370
1611
  }
1371
1612
  return result;
1372
1613
  }
1373
- /**
1374
- * Yielding counterpart of {@link resolveAndPersist} for a caller-supplied
1375
- * ref list — used by sync's failed-ref retry pass (#1240). Same persistence
1376
- * semantics: resolved refs become edges and their rows are deleted;
1377
- * still-unresolvable refs are (re-)marked failed (a no-op for rows already
1378
- * in that status). Yields per-ref because sync can run on the daemon's
1379
- * liveness-watchdog thread (#850/#1091) and a retry set is unbounded when
1380
- * a large edit lands many popular symbol names at once.
1381
- */
1382
1614
  async resolveAndPersistListYielding(refs) {
1383
1615
  const prerequisites = refs.filter(ReferenceResolver.isPrerequisite);
1384
1616
  if (prerequisites.length > 0 && prerequisites.length < refs.length) {
@@ -1418,7 +1650,6 @@ class ReferenceResolver {
1418
1650
  }
1419
1651
  return edges.length;
1420
1652
  }
1421
- /** Finalize the durable queue only AFTER its edges have been inserted. */
1422
1653
  async persistDeferredReferences(deferred, resolved) {
1423
1654
  for (const ref of deferred)
1424
1655
  if (ref.rowId != null)
@@ -1434,7 +1665,6 @@ class ReferenceResolver {
1434
1665
  this.clearCaches();
1435
1666
  return count;
1436
1667
  }
1437
- /** Same two phases as the bounded DB reader: persist wiring before calls. */
1438
1668
  static isPrerequisite(ref) {
1439
1669
  return ref.referenceKind === 'imports' || ref.referenceKind === 'extends' || ref.referenceKind === 'implements';
1440
1670
  }
@@ -1454,43 +1684,22 @@ class ReferenceResolver {
1454
1684
  },
1455
1685
  };
1456
1686
  }
1457
- /**
1458
- * Second resolution pass for chained static-factory / fluent calls whose
1459
- * chained method is defined on a SUPERTYPE the receiver's type conforms to —
1460
- * a protocol-extension / inherited / default-interface method (#750). The
1461
- * first pass can't resolve these because `implements`/`extends` edges aren't
1462
- * built yet; this runs AFTER edges are persisted, so `context.getSupertypes`
1463
- * (and the conformance fallback in resolveMethodOnType) can walk them.
1464
- *
1465
- * Operates only on the leftover unresolved refs that have the `inner().method`
1466
- * chain shape, for the dotted-chain languages — a small set — and is idempotent
1467
- * (re-resolving an already-resolved ref is a no-op since it's been deleted).
1468
- * Returns the number of newly-created edges.
1469
- */
1470
1687
  async resolveChainedCallsViaConformance() {
1471
1688
  const deferred = this.deferredChainRefs;
1472
1689
  this.deferredChainRefs = [];
1473
1690
  if (deferred.length === 0)
1474
1691
  return 0;
1475
- // Read fresh edges (the main pass built the implements/extends edges after
1476
- // these refs were deferred). matchDottedCallChain now resolves a method on a
1477
- // supertype via context.getSupertypes -> resolveMethodOnType's conformance walk.
1478
1692
  this.clearCaches();
1479
- // This post-pass runs synchronously on the indexer's main thread; yield
1480
- // periodically so the #850 liveness watchdog heartbeat can fire on a repo
1481
- // with many deferred chained calls (#1091).
1482
1693
  const maybeYield = (0, cooperative_yield_1.createYielder)();
1483
1694
  const resolved = [];
1484
1695
  for (const ref of deferred) {
1485
- // PHP `this->prop.method` resolves via matchMethodCall (declared-type
1486
- // inference + resolveMethodOnType conformance walk); `::`-receiver
1487
- // languages (Rust) split on `::` (matchScopedCallChain); other
1488
- // dotted-receiver languages on `.` (matchDottedCallChain).
1489
1696
  const chainMatch = (ref.language === 'php' && PHP_PROP_SHAPE.test(ref.referenceName))
1490
1697
  ? (0, name_matcher_1.matchMethodCall)(ref, this.context)
1491
- : SCOPED_CHAIN_LANGUAGES.has(ref.language)
1492
- ? (0, name_matcher_1.matchScopedCallChain)(ref, this.context)
1493
- : (0, name_matcher_1.matchDottedCallChain)(ref, this.context);
1698
+ : name_matcher_1.NEW_RECEIVER_SHAPE.test(ref.referenceName)
1699
+ ? (0, name_matcher_1.matchNewReceiverCall)(ref, this.context)
1700
+ : SCOPED_CHAIN_LANGUAGES.has(ref.language)
1701
+ ? (0, name_matcher_1.matchScopedCallChain)(ref, this.context)
1702
+ : (0, name_matcher_1.matchDottedCallChain)(ref, this.context);
1494
1703
  const match = this.gateLanguage(chainMatch, ref);
1495
1704
  if (match)
1496
1705
  resolved.push(match);
@@ -1498,19 +1707,6 @@ class ReferenceResolver {
1498
1707
  }
1499
1708
  return this.persistDeferredReferences(deferred, resolved);
1500
1709
  }
1501
- /**
1502
- * Resolve one batch with a yield checkpoint between EVERY ref so the #850
1503
- * liveness heartbeat can fire on a slow/dense batch (#1091). The checkpoint
1504
- * granularity is per-ref — not per-N-refs — because per-ref cost is unbounded
1505
- * in the worst case (a collision-heavy method name whose candidate set misses
1506
- * the LRU re-fetches tens of thousands of rows): any fixed N multiplies that
1507
- * worst case into the watchdog window, which is how v1.2.0 still got killed
1508
- * at "Resolving refs" on large Java monorepos (#1122). `maybeYield()` is a
1509
- * ~ns time check when under budget, so per-ref checkpoints cost nothing.
1510
- * Behaviourally identical to `resolveAll(batch)`: `warmCaches()` is
1511
- * idempotent (guarded) and `resolveOne` is independent per ref, so yielding
1512
- * between refs changes only timing, never which edges get created.
1513
- */
1514
1710
  async resolveBatchYielding(batch, maybeYield) {
1515
1711
  this.warmCaches();
1516
1712
  this.advanceSupertypeGeneration();
@@ -1534,10 +1730,8 @@ class ReferenceResolver {
1534
1730
  byMethod[result.resolvedBy] = (byMethod[result.resolvedBy] || 0) + 1;
1535
1731
  }
1536
1732
  else {
1537
- unresolved.push(ref);
1733
+ unresolved.push(this.parkable(ref));
1538
1734
  }
1539
- // Fast-path the per-ref yield check: awaiting the async no-op costs a
1540
- // microtask hop per ref, which dominates at ~10⁵ refs (see MaybeYield).
1541
1735
  const y = maybeYield();
1542
1736
  if (y)
1543
1737
  await y;
@@ -1553,30 +1747,7 @@ class ReferenceResolver {
1553
1747
  },
1554
1748
  };
1555
1749
  }
1556
- /**
1557
- * Resolve a list of refs and return everything the ADMISSION side needs to
1558
- * persist the outcome: resolutions, failures, the deferred post-pass refs
1559
- * this run produced (drained, so the caller owns routing them), and stats.
1560
- * This is the resolver-worker entry point — it runs the exact per-ref loop
1561
- * of resolveBatchYielding, minus the main-thread yields (worker threads have
1562
- * no watchdog heartbeat to starve). Results are in input order.
1563
- */
1564
- /**
1565
- * CODEGRAPH_RESOLVE_PROFILE=1: per-outcome wall-clock histogram of
1566
- * resolveOne, keyed by the winning strategy (`resolvedBy`) or
1567
- * `fail:<referenceKind>` — the §7a.2 "profile the per-ref path" probe. The
1568
- * kernel-scale batch loop is ~430s and CORE-INVARIANT (835.9s pooled-4-on-8
1569
- * ≈ 812.5s sequential-on-2 for the whole superphase), so the next lever is
1570
- * which CLASS of ref the time belongs to, not more parallelism. Off by
1571
- * default: the hrtime pair costs ~100ns/ref only when the env is set.
1572
- */
1573
1750
  resolveProfile = process.env.CODEGRAPH_RESOLVE_PROFILE ? new Map() : null;
1574
- /**
1575
- * CODEGRAPH_RESOLVE_PROFILE=2 additionally attributes time to the
1576
- * STRATEGIES inside resolveOne (`stage:<name>|<refKind>|hit/miss` rows in
1577
- * the same histogram) — i.e. WHICH machinery a failing class of refs pays
1578
- * for, not just that it fails. =1 keeps the per-outcome rows only.
1579
- */
1580
1751
  profileStages = process.env.CODEGRAPH_RESOLVE_PROFILE === '2';
1581
1752
  stageAdd(stage, ref, hit, t0) {
1582
1753
  if (!this.resolveProfile)
@@ -1609,7 +1780,6 @@ class ReferenceResolver {
1609
1780
  }
1610
1781
  return result;
1611
1782
  }
1612
- /** Dump the CODEGRAPH_RESOLVE_PROFILE histogram to stderr (no-op when off). */
1613
1783
  dumpResolveProfile(label) {
1614
1784
  if (!this.resolveProfile || this.resolveProfile.size === 0)
1615
1785
  return;
@@ -1619,7 +1789,6 @@ class ReferenceResolver {
1619
1789
  for (const r of rows) {
1620
1790
  console.error(`[resolve-profile] ${label} ${r.k}: n=${r.n} total=${(r.ms / 1000).toFixed(1)}s avg=${((r.ms * 1000) / Math.max(1, r.n)).toFixed(0)}µs`);
1621
1791
  }
1622
- // =2 only: this thread's matchReference sub-stage table rides along.
1623
1792
  (0, name_matcher_1.dumpNameMatcherProfile)(label);
1624
1793
  }
1625
1794
  resolveListForAdmission(refs) {
@@ -1645,10 +1814,10 @@ class ReferenceResolver {
1645
1814
  byMethod[result.resolvedBy] = (byMethod[result.resolvedBy] || 0) + 1;
1646
1815
  }
1647
1816
  else {
1648
- unresolved.push(ref);
1817
+ unresolved.push(this.parkable(ref));
1649
1818
  }
1650
1819
  }
1651
- this.deferredRowIds.clear(); // the admission side now owns both queues
1820
+ this.deferredRowIds.clear();
1652
1821
  return {
1653
1822
  resolved,
1654
1823
  unresolved,
@@ -1657,57 +1826,20 @@ class ReferenceResolver {
1657
1826
  byMethod,
1658
1827
  };
1659
1828
  }
1660
- /**
1661
- * The resolver's live ResolutionContext — resolver-pool workers use it to
1662
- * run synthesis passes against their own read-only connection.
1663
- */
1664
1829
  getResolutionContext() {
1665
1830
  return this.context;
1666
1831
  }
1667
- /**
1668
- * Re-queue deferred post-pass refs produced by resolver workers, preserving
1669
- * their admission order so resolveChainedCallsViaConformance /
1670
- * resolveDeferredThisMemberRefs process them exactly as the sequential path
1671
- * would have.
1672
- */
1673
1832
  appendDeferredFromWorkers(deferredChain, deferredThisMember) {
1674
1833
  for (const ref of deferredChain)
1675
1834
  this.deferReference(ref, this.deferredChainRefs);
1676
1835
  for (const ref of deferredThisMember)
1677
1836
  this.deferReference(ref, this.deferredThisMemberRefs);
1678
1837
  }
1679
- /**
1680
- * Resolve and persist in batches to keep memory bounded.
1681
- * Processes unresolved references in chunks, persisting edges and cleaning
1682
- * up resolved refs after each batch to avoid accumulating large arrays.
1683
- */
1684
- async resolveAndPersistBatched(onProgress, batchSize = 5000, onSynthesisProgress,
1685
- // When provided, big batches fan out across a read-only resolver-worker
1686
- // pool with results admitted in canonical order (see resolver-pool.ts).
1687
- // Sequential fallback on any pool failure. CODEGRAPH_NO_PARALLEL_RESOLVE=1
1688
- // disables entirely. bulkEdgeLoad hooks (when provided) bracket the batch
1689
- // loop with drop/recreate of the non-unique edge indexes on big runs —
1690
- // see DatabaseConnection.beginBulkEdgeLoad. backpressure (when provided)
1691
- // is the WAL valve's writer-side backstop (WalCheckpointValve.backpressure):
1692
- // called at pool-idle boundaries so a full backfill can actually complete —
1693
- // the valve's timer-driven passive passes stay perpetually partial against
1694
- // the pool's continuous reads, which is how a kernel-scale resolution grew
1695
- // a 22GB WAL on a 4.6GB DB (migration plan §7a.1).
1696
- parallel, synthesize = true) {
1697
- // Resolution runs on the indexer's MAIN thread, and the #850 liveness
1698
- // watchdog SIGKILLs a process whose event loop stalls past its window (60s
1699
- // by default). A single dense batch's resolveAll — or the synthesis pass
1700
- // below — can exceed that on a large repo, killing a VALID in-progress index
1701
- // (#1091). A shared yielder lets both give the watchdog heartbeat a regular
1702
- // window to fire; see ./cooperative-yield.
1838
+ async resolveAndPersistBatched(onProgress, batchSize = 5000, onSynthesisProgress, parallel, synthesize = true) {
1703
1839
  const maybeYield = (0, cooperative_yield_1.createYielder)();
1704
1840
  if (process.env.CODEGRAPH_SYNTH_TIMINGS) {
1705
1841
  console.error(`[pool-timing] backpressure hook: ${parallel?.backpressure ? 'present' : 'absent'}`);
1706
1842
  }
1707
- // CODEGRAPH_RESOLVE_PROFILE loop-stage attribution: the §7a.2 kernel-scale
1708
- // histogram showed resolveOne owns only ~93s of the ~436s batch loop —
1709
- // these counters name where the other ~340s goes (reads, edge build+insert,
1710
- // deletes/marks, the per-batch count guard).
1711
1843
  const loopProf = process.env.CODEGRAPH_RESOLVE_PROFILE
1712
1844
  ? { read: 0, settle: 0, backpressure: 0, recycle: 0, createEdges: 0, insertEdges: 0, deletes: 0, marks: 0, countGuard: 0 }
1713
1845
  : null;
@@ -1723,24 +1855,21 @@ class ReferenceResolver {
1723
1855
  unresolved: 0,
1724
1856
  byMethod: {},
1725
1857
  };
1726
- // Parallel pool, started immediately but never awaited up front: early
1727
- // batches run sequentially while the workers boot (module load + readonly
1728
- // DB open + framework detect + cache warm ≈ hundreds of ms), and the loop
1729
- // switches to fan-out the moment the pool reports ready — so pool boot
1730
- // costs zero wall-clock. Any failure downgrades to sequential permanently.
1731
1858
  let pool = null;
1732
1859
  let poolReady = false;
1733
- // True once pool creation has been attempted by EITHER engage site (the
1734
- // up-front ref-count gate or the adaptive projection below) — a pool that
1735
- // failed or was destroyed must stay down (downgrade is permanent), and
1736
- // tryCreate's sizing probes shouldn't re-run every batch on hosts that
1737
- // declined.
1738
1860
  let poolEngageTried = false;
1739
- const createPool = (t0, why) => {
1861
+ const createPool = (t0, why, worth) => {
1740
1862
  poolEngageTried = true;
1741
1863
  if (!parallel)
1742
1864
  return null;
1743
- const p = resolver_pool_1.ResolverPool.tryCreate(parallel.dbPath, this.projectRoot);
1865
+ const p = resolver_pool_1.ResolverPool.tryCreate(parallel.dbPath, this.projectRoot, parallel.shareFrameworks ? this.getDetectedFrameworks() : undefined, worth);
1866
+ if (p && parallel.shareFrameworks) {
1867
+ const scans = this.projectScans();
1868
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
1869
+ console.error(`[pool-timing] project scans: ${scans.cpp ? 'shared' : 'none'}`);
1870
+ if (scans.cpp)
1871
+ p.shareScans(scans);
1872
+ }
1744
1873
  p?.ready().then(() => {
1745
1874
  poolReady = true;
1746
1875
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
@@ -1754,33 +1883,15 @@ class ReferenceResolver {
1754
1883
  };
1755
1884
  if (parallel && total >= (0, resolver_pool_1.minRefsForPool)()) {
1756
1885
  pool = createPool(Date.now(), 'ref-count');
1886
+ if (pool)
1887
+ await (0, resolver_pool_1.poolStartSettled)(pool.ready());
1757
1888
  }
1758
- // Adaptive engagement bar (see the batch-loop hook): projected remaining
1759
- // sequential settle above this boots the pool mid-loop. Boot is async and
1760
- // fan-out waits for ready, so a marginal engage costs background boot
1761
- // only; the bar just needs to clear the fan-out's own overhead class.
1762
1889
  const ADAPTIVE_ENGAGE_SETTLE_MS = 400;
1763
1890
  let adaptiveSeqMs = 0;
1764
1891
  let adaptiveSeqRefs = 0;
1765
- // Process in PIPELINED batches (double-buffer). The enumeration is the
1766
- // head of the pending set in rowid order; every ref a persisted batch
1767
- // processed leaves the pending set (resolved rows are deleted,
1768
- // unresolvable ones flip to status='failed'), shifting the remaining
1769
- // pending rows forward.
1770
1892
  let prevRemaining = Number.POSITIVE_INFINITY;
1771
- // Cadence for the worker connection recycling below — ~8 batches
1772
- // ≈ 40k refs between recycles keeps the WAL shallow at kernel scale
1773
- // while a small sync never recycles at all. (25 recovered only half
1774
- // the write tax — the WAL re-deepened between recycles; reopens are
1775
- // sub-millisecond so the shorter cadence is ~free.)
1776
1893
  const RECYCLE_EVERY_BATCHES = 8;
1777
1894
  let batchesSinceRecycle = 0;
1778
- // Begin one batch: fan out to the pool when it's ready and the batch is
1779
- // big enough — workers then resolve batch k+1 WHILE the main thread
1780
- // persists batch k (persist measured at ~58% of resolution wall on a
1781
- // 255k-ref repo, all of it previously spent with the pool idle).
1782
- // Sequential batches stay lazy: they run on the main thread at settle
1783
- // time, where an early start would only contend with the persist.
1784
1895
  const beginBatch = (batch) => {
1785
1896
  if (pool && poolReady && resolver_pool_1.ResolverPool.worthParallel(batch.length)) {
1786
1897
  return {
@@ -1790,11 +1901,6 @@ class ReferenceResolver {
1790
1901
  }
1791
1902
  return { mode: 'seq' };
1792
1903
  };
1793
- // Settle an in-flight batch to a ResolutionResult. Deferred post-pass refs
1794
- // are appended HERE, in loop order — never inside the fan-out promise — so
1795
- // admission order stays exactly the sequential order even while a later
1796
- // batch resolves concurrently. A pool failure downgrades to sequential
1797
- // permanently and re-resolves this batch on the main thread.
1798
1904
  const settleBatch = async (inFlight, batch) => {
1799
1905
  if (inFlight.mode === 'pool') {
1800
1906
  const settled = await inFlight.settled;
@@ -1820,41 +1926,27 @@ class ReferenceResolver {
1820
1926
  }
1821
1927
  return this.resolveBatchYielding(batch, maybeYield);
1822
1928
  };
1823
- // Bulk edge load: on big runs, drop the non-unique edge indexes for the
1824
- // duration of the batch loop (the identity index stays — OR IGNORE dedup
1825
- // and the source-keyed supertype-walk reads both live on it). Recreated in
1826
- // the inner finally BEFORE synthesis, whose passes read kind-keyed.
1827
- // Measured on a 224k-edge resolution set: insert 2.8s → 1.1s + 0.3s
1828
- // recreate. Same ref-count gate as the pool so small syncs never pay the
1829
- // recreate cost.
1830
1929
  let bulkEdgesActive = false;
1831
1930
  if (parallel?.bulkEdgeLoad && total >= (0, resolver_pool_1.minRefsForPool)()) {
1832
1931
  try {
1833
1932
  parallel.bulkEdgeLoad.begin();
1834
1933
  bulkEdgesActive = true;
1835
1934
  }
1836
- catch { /* keep the indexes; inserts just pay the per-row maintenance */ }
1935
+ catch { }
1837
1936
  }
1838
- // Same gate for the ref-index window: the loop's deletes stop maintaining
1839
- // the five sync-path unresolved_refs indexes, and the end-of-loop rebuild
1840
- // is near-free (only failed refs survive the loop).
1841
1937
  let bulkRefsActive = false;
1842
1938
  if (parallel?.refIndexLoad && total >= (0, resolver_pool_1.minRefsForPool)()) {
1843
1939
  try {
1844
1940
  parallel.refIndexLoad.begin();
1845
1941
  bulkRefsActive = true;
1846
1942
  }
1847
- catch { /* keep the indexes; deletes just pay the per-row maintenance */ }
1943
+ catch { }
1848
1944
  }
1849
1945
  try {
1850
1946
  try {
1851
- // Orphans retain interruption/re-extraction order, not clean-index order.
1852
- // A caller can precede its imports or supertypes by many batches (#1577).
1853
- // Drain those prerequisites first, then start a fresh keyset cursor over
1854
- // the remaining kinds. The disjoint filters let us prefetch across the
1855
- // phase boundary before cleanup without re-reading the current batch.
1856
1947
  let prerequisites = true;
1857
1948
  let afterRowId = 0;
1949
+ let readDependents = false;
1858
1950
  const readNextBatch = () => {
1859
1951
  let next = this.queries.getUnresolvedReferencesBatchAfter(afterRowId, batchSize, prerequisites);
1860
1952
  if (next.length === 0 && prerequisites) {
@@ -1864,68 +1956,47 @@ class ReferenceResolver {
1864
1956
  }
1865
1957
  if (next.length > 0)
1866
1958
  afterRowId = next[next.length - 1].rowId;
1959
+ readDependents = !prerequisites;
1867
1960
  return next;
1868
1961
  };
1869
1962
  tLp = Date.now();
1870
1963
  let batch = readNextBatch();
1871
1964
  lp('read', tLp);
1965
+ let batchIsDependents = readDependents;
1872
1966
  let inFlight = batch.length > 0 ? beginBatch(batch) : null;
1873
1967
  while (batch.length > 0 && inFlight) {
1874
- // Prefetch the NEXT batch before this one persists: this batch's rows
1875
- // are still pending (nothing has mutated the table since they were
1876
- // read), so seeking past this batch's last row id in the same rowid
1877
- // enumeration yields the following batch (keyset — OFFSET re-walked the
1878
- // accumulated failed prefix every read, 54.6s at kernel scale, §7a.2).
1879
1968
  tLp = Date.now();
1880
1969
  const nextBatch = readNextBatch();
1881
1970
  lp('read', tLp);
1971
+ const nextIsDependents = readDependents;
1972
+ let nextInFlight = null;
1973
+ if (batchIsDependents && inFlight.mode === 'pool' && nextBatch.length > 0 && batchesSinceRecycle + 1 < RECYCLE_EVERY_BATCHES) {
1974
+ const ahead = beginBatch(nextBatch);
1975
+ if (ahead.mode === 'pool')
1976
+ nextInFlight = ahead;
1977
+ }
1882
1978
  const tBatch = Date.now();
1883
1979
  const result = await settleBatch(inFlight, batch);
1884
1980
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
1885
1981
  console.error(`[pool-timing] batch ${inFlight.mode}: ${batch.length} refs in ${Date.now() - tBatch}ms`);
1886
1982
  lp('settle', tBatch);
1887
- // Adaptive pool engagement: the fixed ref-count gate can't see PER-REF
1888
- // cost, and settle rates differ ~9× by language (56k Rust refs cost
1889
- // more sequential settle than 154k Go refs — 36µs vs 4µs measured on
1890
- // tokio/prometheus). After each sequential batch, project the remaining
1891
- // settle from the observed rate and boot the pool mid-loop when it
1892
- // clears the bar. The loop already switches to fan-out only when the
1893
- // async boot reports ready, admission order is mode-independent, and
1894
- // 2-core/low-memory hosts still decline inside tryCreate's sizing —
1895
- // so the switch changes wall-clock, never the graph.
1896
1983
  if (inFlight.mode === 'seq' && parallel && pool === null && !poolEngageTried) {
1897
1984
  adaptiveSeqMs += Date.now() - tBatch;
1898
1985
  adaptiveSeqRefs += batch.length;
1899
1986
  const remaining = total - processed - batch.length;
1900
1987
  const projectedMs = (adaptiveSeqMs / Math.max(1, adaptiveSeqRefs)) * Math.max(0, remaining);
1901
- if (projectedMs >= ADAPTIVE_ENGAGE_SETTLE_MS) {
1988
+ if ((0, resolver_pool_1.shouldEngageAdaptively)(projectedMs, remaining, ADAPTIVE_ENGAGE_SETTLE_MS)) {
1902
1989
  if (process.env.CODEGRAPH_SYNTH_TIMINGS) {
1903
1990
  console.error(`[pool-timing] adaptive engage: projected ${Math.round(projectedMs)}ms sequential settle over ${remaining} remaining refs`);
1904
1991
  }
1905
- pool = createPool(Date.now(), 'adaptive');
1992
+ pool = createPool(Date.now(), 'adaptive', (0, resolver_pool_1.resolveWorkersWorthStarting)(projectedMs));
1906
1993
  }
1907
1994
  }
1908
- // WAL-valve backstop at the ONE pool-idle boundary of the double-buffer
1909
- // (this batch settled, the next not yet fanned out): past the hard cap
1910
- // the writer parks for a full backfill here, where the pool's readers
1911
- // are all between statements — so the backfill completes, readers
1912
- // re-enter at SQLite's backfilled mark, and the next persist commit
1913
- // WRAPS the WAL instead of growing it. No-op (one fstat) under the cap.
1914
1995
  tLp = Date.now();
1915
- const bp = parallel?.backpressure?.();
1996
+ const bp = nextInFlight ? null : parallel?.backpressure?.();
1916
1997
  if (bp)
1917
1998
  await bp;
1918
1999
  lp('backpressure', tLp);
1919
- // Recycle the workers' read connections periodically at this same
1920
- // worker-idle boundary (batch k settled, batch k+1 not yet fanned
1921
- // out): a long-lived reader pins WAL checkpoint progress, and the
1922
- // deep WAL that accumulates behind it taxes the writer's OWN page
1923
- // operations — the §7a.6 writes-under-readers finding (deletes
1924
- // 42.6s → 118.8s from 0 to 4 attached readers; an aggressive valve
1925
- // recovered the writes but paid +129s in full-park folds). Releasing
1926
- // the read marks every ~25 batches lets the existing checkpoints
1927
- // advance instead, at ~milliseconds of reopen cost. A failed recycle
1928
- // downgrades to sequential permanently, same as a failed fan-out.
1929
2000
  if (pool && poolReady && ++batchesSinceRecycle >= RECYCLE_EVERY_BATCHES) {
1930
2001
  batchesSinceRecycle = 0;
1931
2002
  tLp = Date.now();
@@ -1941,49 +2012,24 @@ class ReferenceResolver {
1941
2012
  }
1942
2013
  lp('recycle', tLp);
1943
2014
  }
1944
- // Persist in bounded sub-transactions with yields between: a whole
1945
- // batch's edge insert / keyed deletes are otherwise one solid
1946
- // synchronous span each on a multi-GB index, sitting BETWEEN the
1947
- // per-ref yields — the last unyielded stretch of the resolution loop.
1948
- // Crash semantics are unchanged (already several transactions): edges
1949
- // land before their refs are deleted, so a kill mid-way re-resolves
1950
- // the remainder idempotently on the next run/sweep (#1187).
1951
2015
  const PERSIST_CHUNK = 1000;
1952
2016
  const tPersist = Date.now();
1953
- // A batch that made `extends`/`implements` edges persists them BEFORE
1954
- // fanning out the next batch: later batches read them —
1955
- // resolveMethodOnType walks supertype chains over edges that earlier
1956
- // batches resolved, so a receiver typed as a subclass only reaches a
1957
- // method declared on its base class if those edges are visible.
1958
- // (Validated on dubbo: fanning out first downgraded exactly those
1959
- // supertype-method resolutions from the 0.9 typed-receiver path to the
1960
- // 0.65 word-overlap fallback.) They are the only edges resolution reads
1961
- // (RESOLUTION_READ_EDGE_KINDS), so a batch that made none — every batch
1962
- // after the prerequisite phase readNextBatch drains first — fans the
1963
- // next batch out now and inserts while it resolves: the same writes in
1964
- // the same order, and nothing the workers read differs.
1965
2017
  tLp = Date.now();
1966
2018
  const edges = this.createEdges(result.resolved);
1967
2019
  lp('createEdges', tLp);
1968
2020
  const readEdge = edges.some((e) => RESOLUTION_READ_EDGE_KINDS.includes(e.kind));
1969
- let nextInFlight = !readEdge && nextBatch.length > 0 ? beginBatch(nextBatch) : null;
2021
+ if (readEdge)
2022
+ nextInFlight = null;
2023
+ else if (!nextInFlight && nextBatch.length > 0)
2024
+ nextInFlight = beginBatch(nextBatch);
1970
2025
  tLp = Date.now();
1971
2026
  for (let i = 0; i < edges.length; i += PERSIST_CHUNK) {
1972
2027
  this.queries.insertEdges(edges.slice(i, i + PERSIST_CHUNK));
1973
2028
  await maybeYield();
1974
2029
  }
1975
2030
  lp('insertEdges', tLp);
1976
- // NOW fan the next batch out (if not already) — workers see exactly the
1977
- // edge state the sequential baseline would (every batch ≤ this one
1978
- // committed), while the main thread spends the REST of the persist (ref
1979
- // deletes + failed parking below) overlapped with their resolution —
1980
- // the double-buffer.
1981
2031
  if (!nextInFlight && nextBatch.length > 0)
1982
2032
  nextInFlight = beginBatch(nextBatch);
1983
- // Clean up resolved refs so they don't appear in the next batch —
1984
- // by row id, so a same-key sibling ref in a LATER batch (same caller
1985
- // calling the same callee at another line) is left pending for its own
1986
- // attempt instead of being swept out with this batch's rows (#1269).
1987
2033
  tLp = Date.now();
1988
2034
  let removedThisBatch = 0;
1989
2035
  const resolvedCleanup = ReferenceResolver.partitionResolvedCleanup(result.resolved);
@@ -1996,10 +2042,6 @@ class ReferenceResolver {
1996
2042
  await maybeYield();
1997
2043
  }
1998
2044
  lp('deletes', tLp);
1999
- // Park unresolvable refs from this batch as status='failed' so they
2000
- // leave the pending set (the batch reader and non-progress guard below
2001
- // only see pending rows) but stay retryable when a later sync adds a
2002
- // symbol that could satisfy them (#1240).
2003
2045
  tLp = Date.now();
2004
2046
  const failures = this.nonDeferredFailures(result.unresolved);
2005
2047
  const deferredCount = result.unresolved.length - failures.length;
@@ -2015,7 +2057,6 @@ class ReferenceResolver {
2015
2057
  lp('marks', tLp);
2016
2058
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2017
2059
  console.error(`[pool-timing] batch persist: ${Date.now() - tPersist}ms`);
2018
- // Aggregate stats
2019
2060
  aggregateStats.total += result.stats.total;
2020
2061
  aggregateStats.resolved += result.stats.resolved;
2021
2062
  aggregateStats.unresolved += result.stats.unresolved;
@@ -2024,31 +2065,7 @@ class ReferenceResolver {
2024
2065
  }
2025
2066
  processed += batch.length;
2026
2067
  onProgress?.(processed, total);
2027
- // Yield so progress UI can render between batches
2028
2068
  await new Promise(resolve => setImmediate(resolve));
2029
- // NOTE: there used to be an extra early break here when a batch resolved
2030
- // nothing (`result.unresolved.length === batch.length`). That was wrong:
2031
- // an all-unresolvable batch still DELETES its rows (progress), yet the
2032
- // break abandoned every batch after it in the same run — on a repo whose
2033
- // first 5000 refs are all external/stdlib calls, resolution stopped at
2034
- // batch one and left the rest of the table as permanent orphans (#1187).
2035
- // The count-based guard below catches the true no-progress case.
2036
- // Non-progress guard (defense-in-depth). Ordinary attempts must leave
2037
- // the pending set; a mismatched original reference can make legacy-key
2038
- // cleanup a no-op. Keep the guard against that broken persistence even
2039
- // though keyset pagination now advances independently of row cleanup.
2040
- // An abandoned prefetched batch has no side effects until settleBatch.
2041
- // Non-progress signal, now O(1): `changes` summed across this batch's
2042
- // deletes + failed-parks is the DIRECT evidence the guard's old count
2043
- // diff inferred — a resolver returning a mismatched name makes the keyed
2044
- // cleanup no-op, which shows up here as zero removals. The per-batch
2045
- // COUNT(*) it replaces walked every remaining pending row — O(N²/batch)
2046
- // over a run, 93.9s of the kernel-scale batch loop (§7a.2). A REAL count
2047
- // runs only on the suspicious path (claimed-work batch removed nothing —
2048
- // e.g. every row was a sibling a legacy-key sweep already consumed),
2049
- // where it arbitrates stop-vs-continue exactly as before.
2050
- // Deferred refs legitimately remain pending for the post-pass. The
2051
- // keyset cursor advances past them; they must not trigger this guard.
2052
2069
  if (removedThisBatch + deferredCount <= 0 && batch.length > 0) {
2053
2070
  tLp = Date.now();
2054
2071
  const remaining = this.queries.getUnresolvedReferencesCount();
@@ -2057,16 +2074,12 @@ class ReferenceResolver {
2057
2074
  break;
2058
2075
  prevRemaining = remaining;
2059
2076
  }
2060
- // Advance the pipeline: the prefetched batch (already fanned out when
2061
- // the pool is on) becomes the current one.
2062
2077
  batch = nextBatch;
2078
+ batchIsDependents = nextIsDependents;
2063
2079
  inFlight = nextInFlight;
2064
2080
  }
2065
2081
  }
2066
2082
  finally {
2067
- // Recreate the edge indexes BEFORE synthesis (kind-keyed reads) and on
2068
- // any error path. A crash before this line is healed by the next
2069
- // DatabaseConnection open (schema.sql re-applies IF NOT EXISTS).
2070
2083
  if (bulkRefsActive) {
2071
2084
  const tRef = Date.now();
2072
2085
  await parallel.refIndexLoad.end();
@@ -2078,16 +2091,11 @@ class ReferenceResolver {
2078
2091
  await parallel.bulkEdgeLoad.end();
2079
2092
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2080
2093
  console.error(`[phase-timing] edge-index-recreate: ${Date.now() - tIdx}ms`);
2081
- // The recreate just wrote every non-unique edge index into the WAL
2082
- // (multi-GB at kernel scale) with the pool idle — fold before the
2083
- // synthesis passes pin readers against it for minutes.
2084
2094
  const bp = parallel?.backpressure?.();
2085
2095
  if (bp)
2086
2096
  await bp;
2087
2097
  }
2088
2098
  }
2089
- // Indexes the bulk-edge window's end deferred: built once, while the pool
2090
- // is busy with synthesis when it is, and in any case before this returns.
2091
2099
  let deferredBuilt = !bulkEdgesActive || !parallel?.bulkEdgeLoad?.deferred;
2092
2100
  const buildDeferredIndexes = () => {
2093
2101
  if (deferredBuilt)
@@ -2097,24 +2105,16 @@ class ReferenceResolver {
2097
2105
  try {
2098
2106
  parallel.bulkEdgeLoad.deferred();
2099
2107
  }
2100
- catch { /* healed by schema.sql on the next open, like a crash in the window */ }
2108
+ catch { }
2101
2109
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2102
2110
  console.error(`[phase-timing] deferred-edge-index: ${Date.now() - tDeferred}ms`);
2103
2111
  };
2104
- // Dynamic-edge synthesis: now that all base `calls` edges are persisted,
2105
- // synthesize observer/callback dispatch edges (dispatcher → registered
2106
- // callbacks) that static parsing leaves out. Best-effort — never fail the
2107
- // index on it. The pool (when it survived resolution) is REUSED to fan the
2108
- // independent passes across its read-only workers — that's why its destroy
2109
- // lives in the finally below, after synthesis, not at the end of the batch
2110
- // loop. See docs/design/callback-edge-synthesis.md.
2111
2112
  const tSynth = Date.now();
2112
2113
  try {
2113
2114
  if (synthesize)
2114
2115
  aggregateStats.byMethod['callback-synthesis'] = await (0, callback_synthesizer_1.synthesizeCallbackEdges)(this.queries, this.context, onSynthesisProgress, pool, parallel?.backpressure, buildDeferredIndexes);
2115
2116
  }
2116
2117
  catch {
2117
- // synthesis is additive and optional; ignore failures
2118
2118
  }
2119
2119
  buildDeferredIndexes();
2120
2120
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
@@ -2135,7 +2135,35 @@ class ReferenceResolver {
2135
2135
  stats: aggregateStats,
2136
2136
  };
2137
2137
  }
2138
- /** Replace synthesis only after every base-resolution pass has finished. */
2138
+ trackParameterFlows() {
2139
+ return new parameter_flow_1.FlowChange(this.queries);
2140
+ }
2141
+ async resolveParameterFlows(change) {
2142
+ const t0 = Date.now();
2143
+ let changed = 0;
2144
+ try {
2145
+ const flows = this.queries.parameterFlows;
2146
+ for (const { retarget, drop, restore, stats, language, record } of await (0, parameter_flow_1.planParameterFlows)(this.queries, this.context, change)) {
2147
+ flows.retargetCalls(retarget.flatMap((r) => (r.edgeId === undefined ? [] : [r.edgeId])), retarget.flatMap((r) => (r.rowId === undefined ? [] : [r.rowId])), this.createEdges(retarget.map((r) => r.resolved)));
2148
+ flows.replaceEdgesWithFlowMarkedRefs(drop.map((d) => d.edgeId), drop.map((d) => d.reference));
2149
+ if (retarget.length + drop.length > 0)
2150
+ flows.noteParameterFlows();
2151
+ if (restore.length > 0) {
2152
+ flows.restoreCalls(restore.flatMap((r) => (r.edgeId === undefined ? [] : [r.edgeId])), restore.flatMap((r) => (r.rowId === undefined ? [] : [r.rowId])), restore.map((r) => r.reference));
2153
+ const files = new Set(restore.flatMap((r) => (r.reference.filePath === undefined ? [] : [r.reference.filePath])));
2154
+ await this.resolveAndPersistListYielding(this.queries.getUnresolvedReferencesByFiles([...files]));
2155
+ }
2156
+ flows.setRecord(language, record);
2157
+ changed += retarget.length + drop.length + restore.length;
2158
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2159
+ console.error(`[phase-timing] parameter-flow: ${Date.now() - t0}ms ${JSON.stringify(stats)}`);
2160
+ }
2161
+ }
2162
+ catch (error) {
2163
+ (0, errors_1.logDebug)('Parameter flows failed', { error: String(error) });
2164
+ }
2165
+ return changed;
2166
+ }
2139
2167
  async refreshSynthesis(dbPath, onProgress, backpressure) {
2140
2168
  this.clearCaches();
2141
2169
  const stage = new synthesis_stage_1.SynthesisStage(dbPath);
@@ -2150,37 +2178,256 @@ class ReferenceResolver {
2150
2178
  this.clearCaches();
2151
2179
  }
2152
2180
  }
2153
- /**
2154
- * Get detected frameworks
2155
- */
2181
+ getPythonRootFingerprint() {
2182
+ return (0, import_resolver_1.pythonRootFingerprint)(this.diskContext());
2183
+ }
2184
+ refreshWorkspacePackages(knownManifests) {
2185
+ const { packages: fresh, discovery } = (0, workspace_packages_1.loadWorkspacePackagesAndManifests)(this.projectRoot, knownManifests);
2186
+ if (discovery)
2187
+ this.workspaceDiscovery = discovery;
2188
+ const fingerprint = (0, workspace_packages_1.workspaceFingerprint)(fresh);
2189
+ if (this.workspacePackages === undefined || (0, workspace_packages_1.workspaceFingerprint)(this.workspacePackages) !== fingerprint) {
2190
+ this.workspacePackages = fresh;
2191
+ this.clearCaches();
2192
+ }
2193
+ return fingerprint;
2194
+ }
2195
+ getWorkspaceDiscovery() {
2196
+ return this.workspaceDiscovery;
2197
+ }
2198
+ getModuleConfigSnapshot(previous, treeMoved = false) {
2199
+ const was = parseModuleConfigSnapshot(previous);
2200
+ if (treeMoved || !('Cargo.toml' in was)) {
2201
+ this.cargoCrates = undefined;
2202
+ this.layoutIncludeDirs = undefined;
2203
+ this.readCargoCrates();
2204
+ }
2205
+ const files = new Set(this.moduleConfigFiles);
2206
+ for (const name of MODULE_CONFIG_ROOT_FILES)
2207
+ files.add(path.join(this.projectRoot, name));
2208
+ for (const rel of Object.keys(was))
2209
+ files.add(path.join(this.projectRoot, rel));
2210
+ return moduleConfigSnapshot(this.projectRoot, files, was);
2211
+ }
2212
+ readCargoCrates() {
2213
+ if (!this.cargoCrates) {
2214
+ this.cargoCrates = (0, cargo_workspace_1.readCargoWorkspaceCrateMap)(this.diskContext());
2215
+ for (const dir of this.cargoCrates.values())
2216
+ this.moduleConfigFiles.add(path.join(this.projectRoot, dir, 'Cargo.toml'));
2217
+ }
2218
+ return this.cargoCrates;
2219
+ }
2220
+ resetModuleConfig() {
2221
+ this.projectAliases = undefined;
2222
+ this.dirAliases.clear();
2223
+ this.goModuleByDir.clear();
2224
+ this.goPackageDirs.clear();
2225
+ this.cargoCrates = undefined;
2226
+ this.compileDbIncludeDirs = undefined;
2227
+ this.moduleConfigFiles.clear();
2228
+ this.clearCaches();
2229
+ this.readCargoCrates();
2230
+ }
2231
+ getWorkspaceFingerprint() {
2232
+ return (0, workspace_packages_1.workspaceFingerprint)(this.context.getWorkspacePackages?.() ?? null);
2233
+ }
2234
+ workspacePackageDirOf(file) {
2235
+ const ws = this.context.getWorkspacePackages?.();
2236
+ return ws ? (0, workspace_packages_1.workspacePackageDirOf)(ws, file) : null;
2237
+ }
2238
+ getPythonReopenScope(changedFiles) {
2239
+ return (0, import_resolver_1.pythonReopenScope)(this.diskContext(), changedFiles);
2240
+ }
2241
+ getPythonScriptModuleScope(editedFiles) {
2242
+ return (0, import_resolver_1.pythonScriptModuleScope)(this.context, editedFiles);
2243
+ }
2244
+ getPythonPackageImporters(initFiles) {
2245
+ return (0, import_resolver_1.pythonPackageImporters)(this.context, initFiles);
2246
+ }
2247
+ diskContext() {
2248
+ return {
2249
+ ...this.context,
2250
+ readFile: (filePath) => {
2251
+ try {
2252
+ const abs = path.join(this.projectRoot, filePath);
2253
+ return fs.statSync(abs).isFile() ? fs.readFileSync(abs, 'utf-8') : null;
2254
+ }
2255
+ catch {
2256
+ return null;
2257
+ }
2258
+ },
2259
+ };
2260
+ }
2156
2261
  getDetectedFrameworks() {
2157
2262
  return this.frameworks.map((f) => f.name);
2158
2263
  }
2159
- /**
2160
- * True when `receiver` is a local name bound by an import that resolves to a
2161
- * file IN THIS PROJECT — the only case where letting a python
2162
- * built-in-method name through the filter is safe (#1681).
2163
- *
2164
- * Asking only whether SOME import bound the local name is not enough: every
2165
- * import produces a mapping, stdlib and PyPI included, so that would also be
2166
- * true for `os`, `requests`, `np`. Opening the filter for them lets
2167
- * resolveViaImport find no project file, fall through to bare-name matching,
2168
- * and bind `os.remove(p)` to whatever project method happens to be named
2169
- * `remove` — reintroducing, through its own escape hatch, the fabricated-edge
2170
- * class this filter exists to prevent.
2171
- *
2172
- * Resolving the specifier is the same question resolveViaImport will ask
2173
- * next, so a receiver that passes here is one the qualified path can actually
2174
- * serve; anything else stays a silent miss rather than a wrong edge.
2175
- */
2264
+ resolveModuleFile(specifier, fromFile, language) {
2265
+ return (0, import_resolver_1.resolveImportPath)(specifier, fromFile, language, this.context);
2266
+ }
2267
+ resolveNow(ref) {
2268
+ if (!ref.filePath || !ref.language)
2269
+ return null;
2270
+ const resolved = this.resolveOne({ ...ref, filePath: ref.filePath, language: ref.language });
2271
+ return resolved ? { targetNodeId: resolved.targetNodeId, resolvedBy: resolved.resolvedBy } : null;
2272
+ }
2273
+ hasNavigationRouters() {
2274
+ return this.frameworks.some((f) => f.navigation !== undefined);
2275
+ }
2276
+ reopenNavigationsFor(routes, changedFilePaths = [], perNameCeiling = 500) {
2277
+ if (routes.length === 0)
2278
+ return 0;
2279
+ const plans = [];
2280
+ const tails = new Set();
2281
+ for (const router of this.frameworks) {
2282
+ if (!router.navigation)
2283
+ continue;
2284
+ const scopes = new Set();
2285
+ for (const route of routes) {
2286
+ for (const scope of router.navigation.scope(route, this.context) ?? [])
2287
+ scopes.add(scope);
2288
+ }
2289
+ if (scopes.size === 0)
2290
+ continue;
2291
+ plans.push({ router, scopes: [...scopes] });
2292
+ for (const tail of router.navigation.tails)
2293
+ tails.add(tail);
2294
+ }
2295
+ if (plans.length === 0)
2296
+ return 0;
2297
+ const claimed = (name, filePath) => plans.some(({ router, scopes }) => scopes.some((scope) => filePath.startsWith(scope)) && router.claimsReference?.(name) === true);
2298
+ const fresh = new Set(changedFilePaths);
2299
+ const failed = new Map();
2300
+ for (const ref of this.queries.getFailedCallsByTail([...tails])) {
2301
+ if (fresh.has(ref.filePath) || !claimed(ref.referenceName, ref.filePath))
2302
+ continue;
2303
+ const rowIds = failed.get(ref.referenceName);
2304
+ if (rowIds)
2305
+ rowIds.push(ref.rowId);
2306
+ else
2307
+ failed.set(ref.referenceName, [ref.rowId]);
2308
+ }
2309
+ const resolved = new Map();
2310
+ for (const edge of this.queries.getResolvedNavigations()) {
2311
+ const name = edge.metadata?.refName;
2312
+ if (typeof name !== 'string' || fresh.has(edge.sourceFilePath) || !claimed(name, edge.sourceFilePath))
2313
+ continue;
2314
+ const edges = resolved.get(name);
2315
+ if (edges)
2316
+ edges.push(edge);
2317
+ else
2318
+ resolved.set(name, [edge]);
2319
+ }
2320
+ const rowIds = [];
2321
+ const edgeIds = [];
2322
+ const refs = [];
2323
+ const sites = new Set();
2324
+ for (const name of new Set([...failed.keys(), ...resolved.keys()])) {
2325
+ const rows = failed.get(name) ?? [];
2326
+ const edges = resolved.get(name) ?? [];
2327
+ if (rows.length + edges.length > perNameCeiling)
2328
+ continue;
2329
+ for (const rowId of rows)
2330
+ rowIds.push(rowId);
2331
+ for (const edge of edges) {
2332
+ const ref = (0, resurrect_ref_1.resurrectRefFromDroppedEdge)(edge);
2333
+ if (!ref)
2334
+ continue;
2335
+ edgeIds.push(edge.edgeId);
2336
+ const site = `${ref.fromNodeId}\0${ref.referenceName}\0${ref.line}\0${ref.column}`;
2337
+ if (sites.has(site))
2338
+ continue;
2339
+ sites.add(site);
2340
+ refs.push(ref);
2341
+ }
2342
+ }
2343
+ if (edgeIds.length > 0)
2344
+ this.queries.replaceResolutionEdgesWithUnresolvedRefs(edgeIds, refs);
2345
+ return this.queries.reopenFailedReferences(rowIds) + refs.length;
2346
+ }
2347
+ changedDefaultExports(modifiedFilePaths, changedFilePaths, resolvedUpToEdgeId) {
2348
+ const fresh = new Set(changedFilePaths);
2349
+ const moved = [];
2350
+ for (const filePath of modifiedFilePaths) {
2351
+ if (!(0, import_resolver_1.isJsFamilyFile)(filePath))
2352
+ continue;
2353
+ const bindings = new Map();
2354
+ for (const i of this.queries.getImportsInto(`file:${filePath}`, filePath)) {
2355
+ if (i.refName === null || fresh.has(i.filePath) || !(0, import_resolver_1.isModuleBindingName)(i.refName))
2356
+ continue;
2357
+ const names = bindings.get(i.filePath) ?? new Set();
2358
+ names.add(i.refName);
2359
+ bindings.set(i.filePath, names);
2360
+ }
2361
+ if (bindings.size === 0)
2362
+ continue;
2363
+ const language = this.queries.getFileByPath(filePath)?.language;
2364
+ if (!language)
2365
+ continue;
2366
+ const readsDefault = (e) => {
2367
+ const name = e.metadata?.refName;
2368
+ return typeof name === 'string' && e.metadata?.resolvedBy === 'import' && e.edgeId <= resolvedUpToEdgeId &&
2369
+ !e.target.startsWith('file:') && bindings.get(e.sourceFilePath)?.has(name) === true;
2370
+ };
2371
+ let readers = this.queries.getCrossFileIncomingEdgesWithTarget(filePath).filter(readsDefault);
2372
+ if (readers.length === 0) {
2373
+ const now = (0, import_resolver_1.moduleDefaultExport)(filePath, language, this.context);
2374
+ if (!now || now.filePath === filePath)
2375
+ continue;
2376
+ readers = [...bindings].slice(0, DEFAULT_READER_SAMPLE_FILES)
2377
+ .flatMap(([file, names]) => this.queries.getResolutionEdgesThrough(file, [...names]))
2378
+ .filter(readsDefault);
2379
+ }
2380
+ const was = new Set();
2381
+ for (const e of readers) {
2382
+ const now = (0, import_resolver_1.moduleDefaultExport)(filePath, e.sourceLanguage, this.context);
2383
+ if (now && (e.target === now.id || (e.kind === 'calls' && (0, alias_binding_1.resolveAliasBinding)(now, null, this.context)?.id === e.target)))
2384
+ continue;
2385
+ was.add(e.target);
2386
+ }
2387
+ if (was.size > 0)
2388
+ moved.push({ path: filePath, language, was: [...was] });
2389
+ }
2390
+ return moved;
2391
+ }
2392
+ couldNameAnyOf(files) {
2393
+ const added = new Set(files);
2394
+ const names = new Set(files.map((file) => file.slice(file.lastIndexOf('/') + 1)));
2395
+ return (reference) => {
2396
+ const language = reference.language || this.getLanguageFromNodeId(reference.fromNodeId);
2397
+ if (!import_resolver_1.ESM_IMPORT_LANGUAGES.has(language))
2398
+ return false;
2399
+ const ref = {
2400
+ fromNodeId: reference.fromNodeId,
2401
+ referenceName: reference.referenceName,
2402
+ referenceKind: reference.referenceKind,
2403
+ line: reference.line,
2404
+ column: reference.column,
2405
+ filePath: reference.filePath || this.getFilePathFromNodeId(reference.fromNodeId),
2406
+ language,
2407
+ rowId: reference.rowId,
2408
+ };
2409
+ const name = ref.referenceName;
2410
+ if (names.has(name.slice(name.lastIndexOf('/') + 1)))
2411
+ return true;
2412
+ const target = (0, import_resolver_1.resolveImportPath)(name, ref.filePath, language, this.context);
2413
+ if (target !== null && added.has(target) && (0, import_resolver_1.jsModuleFile)(ref, this.context) === target)
2414
+ return true;
2415
+ return name.includes('/') && this.frameworksFor(language).some((framework) => {
2416
+ const result = framework.resolve(ref, this.context);
2417
+ return result !== null && added.has(this.nodeById(result.targetNodeId)?.filePath ?? '');
2418
+ });
2419
+ };
2420
+ }
2176
2421
  isPythonProjectModule(ref, receiver) {
2177
- for (const imp of this.context.getImportMappings(ref.filePath, ref.language)) {
2422
+ const imports = this.context.getImportMappings(ref.filePath, ref.language);
2423
+ if (!imports.some((imp) => imp.localName === receiver))
2424
+ return false;
2425
+ const local = (0, name_matcher_1.pythonFunctionModuleAlias)(receiver, ref, this.context);
2426
+ if (local)
2427
+ return (0, import_resolver_1.resolveImportPath)(local, ref.filePath, ref.language, this.context) !== null;
2428
+ for (const imp of (0, import_resolver_1.pythonImportsInScope)(ref, imports, this.context)) {
2178
2429
  if (imp.localName !== receiver)
2179
2430
  continue;
2180
- // `import pkg.mod` / `import pkg.mod as m` binds the module `source`
2181
- // names. `from pkg import mod` binds `pkg.mod`, and `from . import mod`
2182
- // binds `.mod` — join without doubling the dot that makes `.` mean the
2183
- // current package.
2184
2431
  const specifier = imp.isNamespace
2185
2432
  ? imp.source
2186
2433
  : imp.source.endsWith('.')
@@ -2192,58 +2439,48 @@ class ReferenceResolver {
2192
2439
  }
2193
2440
  return false;
2194
2441
  }
2195
- /**
2196
- * Check if reference is to a built-in or external symbol
2197
- */
2442
+ isPythonBuiltinNamedMethodCall(ref) {
2443
+ if (ref.language !== 'python' || ref.referenceKind !== 'calls')
2444
+ return false;
2445
+ const dot = ref.referenceName.indexOf('.');
2446
+ return dot > 0 && PYTHON_BUILT_IN_METHODS.has(ref.referenceName.slice(dot + 1)) &&
2447
+ !PYTHON_BUILT_IN_TYPES.has(ref.referenceName.slice(0, dot));
2448
+ }
2449
+ isGoProjectPackage(ref, qualifier) {
2450
+ return this.context
2451
+ .getImportMappings(ref.filePath, ref.language)
2452
+ .some((imp) => imp.localName === qualifier && this.context.getGoPackageDir?.(imp.source, ref.filePath) != null);
2453
+ }
2198
2454
  isBuiltInOrExternal(ref) {
2199
2455
  const name = ref.referenceName;
2200
2456
  const isJsTs = ref.language === 'typescript' || ref.language === 'javascript'
2201
- || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'arkts';
2202
- // JavaScript/TypeScript built-ins
2203
- if (isJsTs && js_builtins_1.JS_BUILT_INS.has(name)) {
2457
+ || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'arkts'
2458
+ || ref.language === 'vue' || ref.language === 'svelte' || ref.language === 'astro';
2459
+ if (isJsTs && js_builtins_1.JS_BUILT_INS.has(name) &&
2460
+ !this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.localName === name)) {
2204
2461
  return true;
2205
2462
  }
2206
- // ArkTS resource-reference intrinsics — `$r('app.string.x')` /
2207
- // `$rawfile('x.png')` are framework-provided and appear dozens of times
2208
- // per UI file; without this they can resolve to a stray same-named
2209
- // symbol (e.g. a checked-in hvigor wrapper's `$r`).
2210
2463
  if (ref.language === 'arkts' && (name === '$r' || name === '$rawfile')) {
2211
2464
  return true;
2212
2465
  }
2213
- // Common JS/TS library calls (console.log, Math.floor, JSON.parse)
2214
2466
  if (isJsTs && (name.startsWith('console.') || name.startsWith('Math.') || name.startsWith('JSON.'))) {
2215
2467
  return true;
2216
2468
  }
2217
- // React hooks from React itself
2218
2469
  if (isJsTs && REACT_HOOKS.has(name)) {
2219
2470
  return true;
2220
2471
  }
2221
- // Python built-ins (bare calls only — dotted calls like console.print are method calls)
2222
2472
  if (ref.language === 'python' && PYTHON_BUILT_INS.has(name)) {
2223
2473
  return true;
2224
2474
  }
2225
- // Python built-in method calls (e.g., list.extend, dict.update)
2226
2475
  if (ref.language === 'python') {
2227
2476
  const dotIdx = name.indexOf('.');
2228
2477
  if (dotIdx > 0) {
2229
2478
  const receiver = name.substring(0, dotIdx);
2230
2479
  const method = name.substring(dotIdx + 1);
2231
- // Filter calls on built-in types (list.append, dict.update, etc.)
2232
2480
  if (PYTHON_BUILT_IN_TYPES.has(receiver)) {
2233
2481
  return true;
2234
2482
  }
2235
- // Filter built-in methods on non-class receivers
2236
- // (e.g., items.append where items is a local list variable)
2237
- // But allow if the capitalized receiver matches a known codebase class,
2238
- // OR the receiver is itself an imported project module — a module can
2239
- // export a top-level function sharing a common collection-method name
2240
- // (`ledger.append`, `from . import ledger`), and that call is a real
2241
- // project dependency, not `list.append` (#1681). Without this, the
2242
- // qualified ref never reaches resolveViaImport / resolvePythonModuleMember.
2243
2483
  if (PYTHON_BUILT_IN_METHODS.has(method)) {
2244
- // A module-scope collection binding is stronger evidence than a
2245
- // coincidentally matching class name (#1652). Only use this file's
2246
- // binding: an unrelated module may reuse the receiver for a collection.
2247
2484
  const isCollection = this.context.getNodesByName(receiver).some((node) => node.language === 'python' && node.filePath === ref.filePath &&
2248
2485
  (node.kind === 'variable' || node.kind === 'constant') &&
2249
2486
  node.qualifiedName === receiver &&
@@ -2259,21 +2496,16 @@ class ReferenceResolver {
2259
2496
  }
2260
2497
  }
2261
2498
  }
2262
- // A bare name colliding with a builtin method (index, get, update, count…)
2263
- // is only a builtin when NOTHING in the codebase declares it. A declared
2264
- // symbol with that exact name — e.g. a Flask/FastAPI view `def index()` or
2265
- // `def get()` — is a real reference target. Without this guard, every
2266
- // handler named after a builtin method silently loses its route→handler edge.
2267
2499
  if (PYTHON_BUILT_IN_METHODS.has(name) && !this.knownNames?.has(name)) {
2268
2500
  return true;
2269
2501
  }
2270
2502
  }
2271
- // Go standard library packages — refs like "fmt.Println", "http.ListenAndServe", etc.
2272
2503
  if (ref.language === 'go') {
2273
2504
  const dotIdx = name.indexOf('.');
2274
- if (dotIdx > 0) {
2505
+ if (dotIdx > 0 && !this.isGoProjectPackage(ref, name.substring(0, dotIdx))) {
2275
2506
  const pkg = name.substring(0, dotIdx);
2276
- if (GO_STDLIB_PACKAGES.has(pkg)) {
2507
+ if (name_matcher_1.GO_STDLIB_PACKAGES.has(pkg) && !(0, name_matcher_1.isGoAssertedLocal)(pkg, ref, this.context) &&
2508
+ !(0, name_matcher_1.isGoProjectLocalCall)(ref, this.context)) {
2277
2509
  return true;
2278
2510
  }
2279
2511
  }
@@ -2281,54 +2513,33 @@ class ReferenceResolver {
2281
2513
  return true;
2282
2514
  }
2283
2515
  }
2284
- // Pascal/Delphi built-ins and standard library units
2285
2516
  if (ref.language === 'pascal') {
2286
- if (PASCAL_UNIT_PREFIXES.some((p) => name.startsWith(p))) {
2517
+ const lower = name.toLowerCase();
2518
+ if (PASCAL_UNIT_PREFIXES.some((p) => name.startsWith(p)) || lower.startsWith('system.')) {
2287
2519
  return true;
2288
2520
  }
2289
- if (PASCAL_BUILT_INS.has(name)) {
2521
+ if (PASCAL_BUILT_INS.has(lower)) {
2290
2522
  return true;
2291
2523
  }
2292
2524
  }
2293
- // C/C++ standard library symbols (printf, malloc, std::vector, etc.).
2294
- // Names that collide with user-defined symbols are NOT filtered —
2295
- // C and C++ projects routinely shadow stdlib names (custom allocators
2296
- // define `malloc`/`free`, stream wrappers define `read`/`write`/`open`,
2297
- // containers define `move`/`swap`, logging libs wrap `printf`). Killing
2298
- // those resolutions makes the graph wrong, not cleaner. We only filter
2299
- // when there's no user node with this name — then name-matching would
2300
- // produce zero edges anyway and the filter just short-circuits work.
2301
2525
  if (ref.language === 'c' || ref.language === 'cpp') {
2302
- // C++ std:: namespace prefix — safe to filter unconditionally,
2303
- // since `std::foo` is never a user-defined qualified name in
2304
- // tree-sitter output.
2305
- if (name.startsWith('std::'))
2526
+ const scoped = name.startsWith('::') ? name.slice(2) : name;
2527
+ if (scoped.startsWith('std::'))
2306
2528
  return true;
2307
- if (C_BUILT_INS.has(name) || CPP_BUILT_INS.has(name)) {
2308
- return !this.hasAnyPossibleMatch(name);
2529
+ if (C_BUILT_INS.has(scoped) || CPP_BUILT_INS.has(scoped)) {
2530
+ return !this.hasAnyPossibleMatch(scoped);
2309
2531
  }
2310
2532
  }
2311
2533
  return false;
2312
2534
  }
2313
- /**
2314
- * Get file path from node ID
2315
- */
2316
2535
  getFilePathFromNodeId(nodeId) {
2317
2536
  const node = this.nodeById(nodeId);
2318
2537
  return node?.filePath || '';
2319
2538
  }
2320
- /**
2321
- * Get language from node ID
2322
- */
2323
2539
  getLanguageFromNodeId(nodeId) {
2324
2540
  const node = this.nodeById(nodeId);
2325
2541
  return node?.language || 'unknown';
2326
2542
  }
2327
- /**
2328
- * Collect the `@using` namespaces in scope for a `.razor`/`.cshtml` file: its
2329
- * own `@using` directives plus every `_Imports.razor` from the file's folder up
2330
- * to the project root (Razor `_Imports` cascade). Cached per file.
2331
- */
2332
2543
  getRazorUsings(filePath) {
2333
2544
  const cached = this.razorUsingsCache.get(filePath);
2334
2545
  if (cached)
@@ -2342,7 +2553,6 @@ class ReferenceResolver {
2342
2553
  };
2343
2554
  addFrom(this.context.readFile(filePath));
2344
2555
  let dir = filePath.includes('/') ? filePath.slice(0, filePath.lastIndexOf('/')) : '';
2345
- // Walk up to the project root, reading each level's _Imports.razor.
2346
2556
  for (;;) {
2347
2557
  addFrom(this.context.readFile(dir ? `${dir}/_Imports.razor` : '_Imports.razor'));
2348
2558
  if (!dir)
@@ -2354,13 +2564,6 @@ class ReferenceResolver {
2354
2564
  this.razorUsingsCache.set(filePath, arr);
2355
2565
  return arr;
2356
2566
  }
2357
- /**
2358
- * Resolve a Razor/Blazor simple type ref through the file's `@using`
2359
- * namespaces: `CatalogBrand` + `@using BlazorShared.Models` → the node whose
2360
- * qualified name is `BlazorShared.Models::CatalogBrand`. Only resolves when the
2361
- * `@using` set yields exactly ONE type (otherwise it stays ambiguous and falls
2362
- * through to name-matching).
2363
- */
2364
2567
  resolveRazorUsing(ref) {
2365
2568
  if (ref.referenceName.includes('.') || ref.referenceName.includes('::'))
2366
2569
  return null;
@@ -2378,37 +2581,12 @@ class ReferenceResolver {
2378
2581
  const target = found.values().next().value;
2379
2582
  return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' };
2380
2583
  }
2381
- /**
2382
- * Resolve a CFML inheritance reference written as a component path (#1152).
2383
- * Two forms exist in real code:
2384
- *
2385
- * - Dotted: `extends="coldbox.system.web.Controller"` — dots are directory
2386
- * separators from the webroot or a CFML mapping. Mappings live in server
2387
- * config / Application.cfc, so the leading segments may not exist in the
2388
- * repo at all (in the coldbox repo itself the path is `system/web/
2389
- * Controller.cfc` — the `coldbox.` root IS the repo). Matched by final
2390
- * segment (the class), corroborated right-to-left against the candidate's
2391
- * parent directories.
2392
- * - Relative: `extends="../base"` / `extends="./base"` (the FW/1 style) —
2393
- * resolved against the referencing file's own directory.
2394
- *
2395
- * Conservative by design: a candidate needs at least one corroborating
2396
- * directory segment (a dotted path whose only same-named class sits in an
2397
- * unrelated directory is almost always an out-of-repo library supertype —
2398
- * mxunit/testbox/coldbox-as-dependency), and a corroboration tie yields no
2399
- * edge. Directory comparison is case-insensitive (CFML path resolution is);
2400
- * the class segment itself is matched exactly, which real code satisfies —
2401
- * dotted paths are written to match the on-disk file name.
2402
- */
2403
2584
  resolveCfmlComponentPath(ref) {
2404
2585
  const cfmlCandidates = (name) => this.context
2405
2586
  .getNodesByName(name)
2406
2587
  .filter((n) => (n.kind === 'class' || n.kind === 'interface') &&
2407
2588
  (n.language === 'cfml' || n.language === 'cfscript'));
2408
2589
  const norm = (p) => p.replace(/\\/g, '/').toLowerCase();
2409
- // Relative-path form: `../base`, `./base`, `sub/thing` — resolve against
2410
- // the referencing file's directory and require an exact (case-insensitive)
2411
- // file match.
2412
2590
  if (ref.referenceName.includes('/')) {
2413
2591
  const rel = ref.referenceName.replace(/\.cfc$/i, '');
2414
2592
  const fromDir = ref.filePath.replace(/\\/g, '/').split('/').slice(0, -1);
@@ -2418,7 +2596,7 @@ class ReferenceResolver {
2418
2596
  continue;
2419
2597
  if (seg === '..') {
2420
2598
  if (parts.length === 0)
2421
- return null; // escapes the project root
2599
+ return null;
2422
2600
  parts.pop();
2423
2601
  }
2424
2602
  else {
@@ -2434,20 +2612,18 @@ class ReferenceResolver {
2434
2612
  ? { original: ref, targetNodeId: target.id, confidence: 0.95, resolvedBy: 'file-path' }
2435
2613
  : null;
2436
2614
  }
2437
- // Dotted form.
2438
2615
  const segments = ref.referenceName.split('.').map((s) => s.trim()).filter(Boolean);
2439
2616
  if (segments.length < 2)
2440
2617
  return null;
2441
2618
  const className = segments[segments.length - 1];
2442
2619
  const dirSegments = segments.slice(0, -1);
2443
- let best = null;
2620
+ const fromTest = (0, query_utils_1.isTestPath)(ref.filePath);
2444
2621
  let bestScore = 0;
2445
- let tie = false;
2622
+ let tied = [];
2446
2623
  for (const cand of cfmlCandidates(className)) {
2624
+ if (!fromTest && (0, name_matcher_1.isTestSuitePath)(cand.filePath))
2625
+ continue;
2447
2626
  const dirs = cand.filePath.replace(/\\/g, '/').split('/').slice(0, -1);
2448
- // Count matching directory segments right-to-left: for
2449
- // `coldbox.system.web.Controller` vs `system/web/Controller.cfc`,
2450
- // `web` and `system` match, then the repo root ends the run → score 2.
2451
2627
  let score = 0;
2452
2628
  while (score < dirSegments.length &&
2453
2629
  score < dirs.length &&
@@ -2455,38 +2631,99 @@ class ReferenceResolver {
2455
2631
  dirs[dirs.length - 1 - score].toLowerCase()) {
2456
2632
  score++;
2457
2633
  }
2634
+ if (score === 0 && dirs.length === 0 && dirSegments.length === 1 &&
2635
+ cand.filePath.replace(/\.cfc$/i, '').toLowerCase() === className.toLowerCase()) {
2636
+ score = 0.5;
2637
+ }
2458
2638
  if (score > bestScore) {
2459
- best = cand;
2460
2639
  bestScore = score;
2461
- tie = false;
2640
+ tied = [cand];
2462
2641
  }
2463
2642
  else if (score === bestScore && score > 0) {
2464
- tie = true;
2643
+ tied.push(cand);
2644
+ }
2645
+ }
2646
+ if (tied.length > 1)
2647
+ tied = tied.filter((c) => !(0, name_matcher_1.isTestSuitePath)(c.filePath));
2648
+ if (bestScore === 0 || tied.length !== 1)
2649
+ return null;
2650
+ return { original: ref, targetNodeId: tied[0].id, confidence: bestScore >= 1 ? 0.9 : 0.8, resolvedBy: 'qualified-name' };
2651
+ }
2652
+ resolveCfmlConstructedCall(ref) {
2653
+ const match = CFML_CONSTRUCTED_CALL.exec(ref.referenceName);
2654
+ if (!match)
2655
+ return null;
2656
+ const component = match[1];
2657
+ const cls = component.includes('.')
2658
+ ? this.nodeById(this.resolveCfmlComponentPath({ ...ref, referenceName: component, referenceKind: 'instantiates' })?.targetNodeId ?? '')
2659
+ : this.cfmlComponentByName(component, ref.filePath);
2660
+ const method = cls ? this.cfmlMethodOf(cls, match[2].toLowerCase(), new Set()) : undefined;
2661
+ return method ? { original: ref, targetNodeId: method.id, confidence: 0.9, resolvedBy: 'instance-method' } : null;
2662
+ }
2663
+ cfmlComponentByName(name, fromFile) {
2664
+ const components = this.context
2665
+ .getNodesByLowerName(name.toLowerCase())
2666
+ .filter((n) => (n.kind === 'class' || n.kind === 'interface') && (n.language === 'cfml' || n.language === 'cfscript'));
2667
+ const dirOf = (p) => p.slice(0, p.lastIndexOf('/') + 1);
2668
+ const beside = components.filter((n) => dirOf(n.filePath) === dirOf(fromFile));
2669
+ if (beside.length === 1)
2670
+ return beside[0];
2671
+ return components.length === 1 ? components[0] : undefined;
2672
+ }
2673
+ cfmlMethodOf(cls, lowerName, seen) {
2674
+ if (seen.has(cls.id) || seen.size >= 8)
2675
+ return undefined;
2676
+ seen.add(cls.id);
2677
+ const own = this.context.getNodesInFile(cls.filePath).find((n) => n.kind === 'method' &&
2678
+ n.name.toLowerCase() === lowerName &&
2679
+ n.qualifiedName.toLowerCase() === `${cls.name}::${n.name}`.toLowerCase() &&
2680
+ n.startLine >= cls.startLine && n.endLine <= cls.endLine);
2681
+ if (own)
2682
+ return own;
2683
+ for (const supertype of this.context.getSupertypeNodes?.(cls.id) ?? []) {
2684
+ const inherited = this.cfmlMethodOf(supertype, lowerName, seen);
2685
+ if (inherited)
2686
+ return inherited;
2687
+ }
2688
+ return undefined;
2689
+ }
2690
+ resolveCfmlIncludePath(ref) {
2691
+ const written = ref.referenceName.trim().replace(/\\/g, '/');
2692
+ const fromRoot = written.startsWith('/');
2693
+ const parts = fromRoot ? [] : ref.filePath.replace(/\\/g, '/').split('/').slice(0, -1);
2694
+ for (const seg of written.split('/')) {
2695
+ if (seg === '' || seg === '.')
2696
+ continue;
2697
+ if (seg === '..') {
2698
+ if (parts.length === 0)
2699
+ return null;
2700
+ parts.pop();
2701
+ }
2702
+ else {
2703
+ parts.push(seg);
2465
2704
  }
2466
2705
  }
2467
- if (!best || bestScore === 0 || tie)
2706
+ const fileName = parts[parts.length - 1];
2707
+ if (!fileName)
2468
2708
  return null;
2469
- return { original: ref, targetNodeId: best.id, confidence: 0.9, resolvedBy: 'qualified-name' };
2470
- }
2471
- /**
2472
- * Resolve a `this.<member>` function-as-value reference (#756/#808) to the
2473
- * ENCLOSING CLASS's own member — never a same-named symbol elsewhere. The
2474
- * registration idiom (`btn.on('click', this.handleClick)`) names a member
2475
- * of the class being defined, so the only valid target shares the
2476
- * from-symbol's qualified-name scope. Function/method targets only — a
2477
- * property (a data field, post-#808 classification) yields no edge — same
2478
- * file required, no fallback of any kind.
2479
- */
2709
+ const wanted = parts.join('/');
2710
+ const files = this.context.getNodesByLowerName(fileName.toLowerCase()).filter((n) => n.kind === 'file');
2711
+ const exact = files.find((n) => n.filePath === wanted);
2712
+ if (exact)
2713
+ return { original: ref, targetNodeId: exact.id, confidence: fromRoot ? 0.85 : 0.95, resolvedBy: 'file-path' };
2714
+ const folded = files.filter((n) => n.filePath.toLowerCase() === wanted.toLowerCase());
2715
+ return folded.length === 1
2716
+ ? { original: ref, targetNodeId: folded[0].id, confidence: fromRoot ? 0.8 : 0.9, resolvedBy: 'file-path' }
2717
+ : null;
2718
+ }
2480
2719
  resolveThisMemberFnRef(ref) {
2481
2720
  const member = ref.referenceName.slice('this.'.length);
2482
2721
  if (!member)
2483
2722
  return null;
2484
- const fromNode = this.nodeById(ref.fromNodeId);
2485
- if (!fromNode)
2723
+ const written = this.nodeById(ref.fromNodeId);
2724
+ if (!written)
2486
2725
  return null;
2487
- // A hook declared at class-body level (Ruby `before_action :authenticate`)
2488
- // attributes to the CLASS node itself — its qualified name IS the scope.
2489
- // For members, strip the member segment.
2726
+ const fromNode = (0, name_matcher_1.thisScopeCaller)(written, this.context);
2490
2727
  let classPrefix;
2491
2728
  if (SUPERTYPE_BEARING_KINDS.has(fromNode.kind) || fromNode.kind === 'module') {
2492
2729
  classPrefix = fromNode.qualifiedName;
@@ -2494,7 +2731,7 @@ class ReferenceResolver {
2494
2731
  else {
2495
2732
  const sep = fromNode.qualifiedName.lastIndexOf('::');
2496
2733
  if (sep <= 0)
2497
- return null; // not inside a class scope
2734
+ return null;
2498
2735
  classPrefix = fromNode.qualifiedName.slice(0, sep);
2499
2736
  }
2500
2737
  const candidates = this.context
@@ -2503,9 +2740,6 @@ class ReferenceResolver {
2503
2740
  n.filePath === ref.filePath &&
2504
2741
  n.id !== ref.fromNodeId);
2505
2742
  if (candidates.length === 0) {
2506
- // Not on the class itself — possibly INHERITED. implements/extends
2507
- // edges don't exist yet in this pass, so retry in the supertype pass
2508
- // (resolveDeferredThisMemberRefs) instead of giving up.
2509
2743
  this.deferReference(ref, this.deferredThisMemberRefs);
2510
2744
  return null;
2511
2745
  }
@@ -2517,29 +2751,14 @@ class ReferenceResolver {
2517
2751
  resolvedBy: 'function-ref',
2518
2752
  };
2519
2753
  }
2520
- /**
2521
- * Second pass for `this.<member>` refs whose member wasn't on the enclosing
2522
- * class itself (#808): once implements/extends edges exist, walk the
2523
- * class's supertypes (transitively, depth-capped) and resolve the member on
2524
- * the nearest one that declares it — `this.handleSubmit` registered in a
2525
- * subclass resolves to `FormBase::handleSubmit`. Validated targets only
2526
- * (function/method kind, same language family); no match → no edge.
2527
- * Mirrors resolveChainedCallsViaConformance's lifecycle. Returns the number
2528
- * of newly-created edges.
2529
- */
2530
2754
  async resolveDeferredThisMemberRefs() {
2531
2755
  const deferred = this.deferredThisMemberRefs;
2532
2756
  this.deferredThisMemberRefs = [];
2533
2757
  if (deferred.length === 0)
2534
2758
  return 0;
2535
2759
  this.clearCaches();
2536
- // Synchronous main-thread post-pass with a per-ref supertype BFS — yield
2537
- // periodically so the #850 liveness watchdog heartbeat can fire (#1091).
2538
2760
  const maybeYield = (0, cooperative_yield_1.createYielder)();
2539
2761
  const resolved = [];
2540
- // Refs share supertypes (every `this.dispose` walks the same chain), and
2541
- // nothing is written until the loop ends: read each type's supertype
2542
- // edges, and each supertype's callable members by name, once.
2543
2762
  const supertypeEdges = new Map();
2544
2763
  const callableMembers = new Map();
2545
2764
  const supertypesOf = (id) => {
@@ -2571,10 +2790,10 @@ class ReferenceResolver {
2571
2790
  for (const ref of deferred) {
2572
2791
  await maybeYield();
2573
2792
  const member = ref.referenceName.slice('this.'.length);
2574
- const fromNode = this.nodeById(ref.fromNodeId);
2575
- if (!fromNode || !member)
2793
+ const written = this.nodeById(ref.fromNodeId);
2794
+ if (!written || !member)
2576
2795
  continue;
2577
- // Class-body-level hooks (Ruby) attribute to the CLASS node itself.
2796
+ const fromNode = (0, name_matcher_1.thisScopeCaller)(written, this.context);
2578
2797
  let className;
2579
2798
  if (SUPERTYPE_BEARING_KINDS.has(fromNode.kind) || fromNode.kind === 'module') {
2580
2799
  className = fromNode.name;
@@ -2588,19 +2807,11 @@ class ReferenceResolver {
2588
2807
  ? classPrefix.slice(classPrefix.lastIndexOf('::') + 2)
2589
2808
  : classPrefix;
2590
2809
  }
2591
- // NODE-anchored BFS up the supertype graph: start from the class node
2592
- // in the ref's own file (never a same-named class elsewhere — rails has
2593
- // a dozen `Engine`s), follow implements/extends EDGES to supertype
2594
- // NODES, and look members up through `contains` edges. No name-based
2595
- // unions anywhere — a name-keyed getSupertypes('Engine') merged every
2596
- // Engine's parents and produced a cross-class wrong edge on rails.
2597
2810
  let frontierNodes = this.context
2598
2811
  .getNodesByName(className)
2599
2812
  .filter((n) => SUPERTYPE_BEARING_KINDS.has(n.kind) &&
2600
2813
  n.filePath === ref.filePath);
2601
2814
  if (frontierNodes.length === 0) {
2602
- // The class itself may be declared in another file (partial/reopened
2603
- // classes); fall back to same-family nodes of that name.
2604
2815
  frontierNodes = this.context
2605
2816
  .getNodesByName(className)
2606
2817
  .filter((n) => SUPERTYPE_BEARING_KINDS.has(n.kind) &&
@@ -2618,7 +2829,6 @@ class ReferenceResolver {
2618
2829
  seenNodes.add(superNode.id);
2619
2830
  if (!SUPERTYPE_BEARING_KINDS.has(superNode.kind))
2620
2831
  continue;
2621
- // Member lookup anchored on the supertype's contains edges.
2622
2832
  target =
2623
2833
  callableMembersOf(superNode.id)
2624
2834
  .get(member)
@@ -2643,53 +2853,42 @@ class ReferenceResolver {
2643
2853
  }
2644
2854
  return this.persistDeferredReferences(deferred, resolved);
2645
2855
  }
2646
- /**
2647
- * Drop a resolution whose target cannot be what the reference names.
2648
- * Applied at the `resolveOne` seam so it covers every strategy uniformly —
2649
- * framework, import, name-match, chain, CFML component path.
2650
- *
2651
- * For `imports`: the target must be importable. A member that only exists
2652
- * inside a type never is.
2653
- *
2654
- * For `extends`/`implements`, it cannot be describing a real supertype when:
2655
- *
2656
- * 1. The target's kind can never be a supertype (an enum member, a method,
2657
- * a variable). `matchByExactName` additionally narrows its candidate
2658
- * pool by the same set, so a legitimate supertype outranks a same-named
2659
- * non-type rather than merely losing its edge.
2660
- * 2. The name is imported from outside the repo, so NO local node is the
2661
- * referent. Without this, filtering by kind alone just relocates the
2662
- * false edge onto the next same-named local type.
2663
- *
2664
- * One exception to (1): a TypeScript VALUE that shares its name with a type
2665
- * in the same file. `export const IFoo = createDecorator<IFoo>('foo')` beside
2666
- * `export interface IFoo` is how VS Code declares every service, and an
2667
- * import of `IFoo` resolves to the file with both — a strategy that takes the
2668
- * first export of that name gets the value. The strategy found the right
2669
- * file and name; the type declared there is the supertype, so the edge moves
2670
- * to it rather than being dropped (dropping it lost ~900 `implements` edges
2671
- * on vscode).
2672
- *
2673
- * Otherwise this only ever REMOVES an edge, never adds one. A dropped ref
2674
- * stays in `unresolved_refs` as `failed`, which is the honest record for a
2675
- * supertype that lives outside the repo — silent beats wrong.
2676
- */
2677
2856
  gateTargetKind(result, ref) {
2678
2857
  if (!result)
2679
2858
  return result;
2680
- // A `#define` is a value, never a callee (#1838): a macro defined only in
2681
- // an unrelated file is not what `NAME(x)` here expands to either.
2859
+ if (ref.language === 'go' && (ref.referenceKind === 'calls' || ref.referenceKind === 'function_ref') &&
2860
+ (0, name_matcher_1.isGoBareName)(ref, this.context) && (0, name_matcher_1.isGoLocallyBound)(ref, this.context))
2861
+ return null;
2682
2862
  if (ref.referenceKind === 'calls') {
2683
2863
  const target = this.nodeById(result.targetNodeId);
2684
2864
  if (target?.kind === 'constant' && types_1.CPP_DEFINE_SIGNATURE.test(target.signature ?? ''))
2685
2865
  return null;
2866
+ if (target && ref.language === 'go' && name_matcher_1.GO_TYPE_KINDS.has(target.kind) &&
2867
+ !ref.referenceName.includes('.') && !(0, name_matcher_1.isGoBareName)(ref, this.context))
2868
+ return null;
2869
+ }
2870
+ if ((ref.referenceKind === 'calls' || ref.referenceKind === 'instantiates') && import_resolver_1.ESM_IMPORT_LANGUAGES.has(ref.language)) {
2871
+ const target = this.nodeById(result.targetNodeId);
2872
+ if (target && (target.kind === 'interface' || target.kind === 'type_alias')) {
2873
+ const value = this.sameNamedValueOfType(target);
2874
+ if (!value)
2875
+ return null;
2876
+ result = { ...result, targetNodeId: value.id };
2877
+ }
2686
2878
  }
2687
- // An `imports` reference names something importable — never a member that
2688
- // only exists inside a type.
2689
2879
  if (ref.referenceKind === 'imports') {
2690
2880
  const target = this.nodeById(result.targetNodeId);
2881
+ if (target?.kind === 'import' && target.filePath === ref.filePath)
2882
+ return null;
2691
2883
  return target && !(0, types_1.isImportableKind)(target.kind) ? null : result;
2692
2884
  }
2885
+ if (ref.language === 'go' && ref.referenceKind === 'references' &&
2886
+ name_matcher_1.GO_TYPE_KINDS.has(this.nodeById(ref.fromNodeId)?.kind ?? '') && (0, name_matcher_1.isGoUnknownQualified)(ref, this.context))
2887
+ return null;
2888
+ if (ref.language === 'go' && (ref.referenceKind === 'instantiates' ||
2889
+ (ref.referenceKind === 'references' && this.nodeById(ref.fromNodeId)?.kind !== 'route'))) {
2890
+ return (0, name_matcher_1.goTypePositionTarget)(result, ref, this.context);
2891
+ }
2693
2892
  if (!(0, types_1.isInheritanceRef)(ref))
2694
2893
  return result;
2695
2894
  const target = this.nodeById(result.targetNodeId);
@@ -2699,11 +2898,304 @@ class ReferenceResolver {
2699
2898
  return null;
2700
2899
  result = { ...result, targetNodeId: type.id };
2701
2900
  }
2702
- if ((0, import_resolver_1.isBoundToOutOfRepoImport)(ref, this.context))
2901
+ if ((0, import_resolver_1.isBoundToOutOfRepoImport)(ref, this.context, target))
2902
+ return null;
2903
+ if (ref.language === 'go' && (0, name_matcher_1.isGoUnknownQualified)(ref, this.context))
2703
2904
  return null;
2905
+ if (ref.language === 'go')
2906
+ return (0, name_matcher_1.goDotImportedSupertype)(result, ref, this.context);
2704
2907
  return result;
2705
2908
  }
2706
- /** The one supertype-kind node a TypeScript value shares its name and file with. */
2909
+ gateSuperSelfCall(result, ref) {
2910
+ if (!result || ref.referenceKind !== 'calls' || result.targetNodeId !== ref.fromNodeId)
2911
+ return result;
2912
+ if ((0, js_super_calls_1.isJsSuperCallLanguage)(ref.language))
2913
+ return (0, js_super_calls_1.isJsSuperCallSite)(ref, this.context) ? null : result;
2914
+ const name = ref.referenceName.slice(Math.max(ref.referenceName.lastIndexOf('.'), ref.referenceName.lastIndexOf(':')) + 1);
2915
+ if (!/^[A-Za-z_$][\w$]*$/.test(name))
2916
+ return result;
2917
+ const line = (this.context.getFileLines?.(ref.filePath) ?? this.context.readFile(ref.filePath)?.split(/\r?\n/))?.[ref.line - 1];
2918
+ if (!line)
2919
+ return result;
2920
+ const escaped = name.replace(/\$/g, '\\$');
2921
+ const viaSuper = new RegExp(String.raw `(?:\b(?:super|base)\s*(?:\(\s*(?:[\w.]+\s*,\s*\w+)?\s*\))?\s*\??\.\s*|\[\s*super\s+|\bparent\s*::\s*)` + escaped + String.raw `\b`);
2922
+ return viaSuper.test(line) ? null : result;
2923
+ }
2924
+ gateRustScope(result, ref) {
2925
+ if (!result || ref.language !== 'rust')
2926
+ return result;
2927
+ const bare = /^[A-Za-z_]\w*$/.test(ref.referenceName);
2928
+ if (!bare && ref.referenceKind !== 'calls')
2929
+ return result;
2930
+ const target = this.nodeById(result.targetNodeId);
2931
+ if (!target)
2932
+ return result;
2933
+ if (bare && !(0, name_matcher_1.isRustNameInScope)(target, ref, this.context))
2934
+ return null;
2935
+ if (ref.referenceKind !== 'calls')
2936
+ return result;
2937
+ if (!bare && !(0, name_matcher_1.isRustPathCallReachable)(target, ref, this.context))
2938
+ return null;
2939
+ return (0, name_matcher_1.isRustForeignImplCallable)(target, ref, this.context) ? result : null;
2940
+ }
2941
+ mocklessContextFor(ref, base) {
2942
+ if ((0, query_utils_1.isTestPath)(ref.filePath))
2943
+ return null;
2944
+ const mocks = this.manualMockNames();
2945
+ if (!mocks)
2946
+ return null;
2947
+ if (this.mocklessContext && this.mocklessBase === base)
2948
+ return this.mocklessContext;
2949
+ const isMock = (n) => (0, name_matcher_1.isManualMockPath)(n.filePath);
2950
+ const real = (nodes) => (nodes.some(isMock) ? nodes.filter((n) => !isMock(n)) : nodes);
2951
+ const byName = new Map();
2952
+ const byLowerName = new Map();
2953
+ const byKind = new Map();
2954
+ const getMethodMatches = base.getMethodMatches;
2955
+ const iterateNodesByKind = base.iterateNodesByKind;
2956
+ this.mocklessBase = base;
2957
+ this.mocklessContext = {
2958
+ ...base,
2959
+ getNodesByName: (name) => {
2960
+ if (!mocks.names.has(name))
2961
+ return base.getNodesByName(name);
2962
+ let nodes = byName.get(name);
2963
+ if (!nodes)
2964
+ byName.set(name, (nodes = real(base.getNodesByName(name))));
2965
+ return nodes;
2966
+ },
2967
+ getNodesByLowerName: (lowerName) => {
2968
+ if (!mocks.lowerNames.has(lowerName))
2969
+ return base.getNodesByLowerName(lowerName);
2970
+ let nodes = byLowerName.get(lowerName);
2971
+ if (!nodes)
2972
+ byLowerName.set(lowerName, (nodes = real(base.getNodesByLowerName(lowerName))));
2973
+ return nodes;
2974
+ },
2975
+ getNodesByQualifiedName: (qualifiedName) => real(base.getNodesByQualifiedName(qualifiedName)),
2976
+ getNodesByKind: (kind) => {
2977
+ let nodes = byKind.get(kind);
2978
+ if (!nodes)
2979
+ byKind.set(kind, (nodes = real(base.getNodesByKind(kind))));
2980
+ return nodes;
2981
+ },
2982
+ getMethodMatches: getMethodMatches
2983
+ ? (typeName, methodName, language) => {
2984
+ const nodes = getMethodMatches(typeName, methodName, language);
2985
+ return mocks.names.has(methodName) ? real(nodes) : nodes;
2986
+ }
2987
+ : undefined,
2988
+ iterateNodesByKind: iterateNodesByKind
2989
+ ? function* (kind) {
2990
+ for (const n of iterateNodesByKind(kind))
2991
+ if (!isMock(n))
2992
+ yield n;
2993
+ }
2994
+ : undefined,
2995
+ };
2996
+ return this.mocklessContext;
2997
+ }
2998
+ mocklessContext = null;
2999
+ mocklessBase = null;
3000
+ manualMocks;
3001
+ manualMockNames() {
3002
+ if (this.manualMocks !== undefined)
3003
+ return this.manualMocks;
3004
+ const files = [...(this.knownFiles ?? this.queries.getAllFilePaths())].filter(name_matcher_1.isManualMockPath);
3005
+ const names = new Set();
3006
+ const lowerNames = new Set();
3007
+ if (files.length > 0) {
3008
+ for (const n of this.queries.getNodesByFiles(files)) {
3009
+ names.add(n.name);
3010
+ lowerNames.add(n.name.toLowerCase());
3011
+ }
3012
+ }
3013
+ this.manualMocks = names.size > 0 ? { names, lowerNames } : null;
3014
+ return this.manualMocks;
3015
+ }
3016
+ classExpressionFreeContextFor(ref, base) {
3017
+ if (!js_class_expressions_1.CLASS_EXPRESSION_REF_LANGUAGES.has(ref.language))
3018
+ return null;
3019
+ const expressions = this.classExpressions();
3020
+ if (!expressions)
3021
+ return null;
3022
+ const dot = ref.referenceName.indexOf('.');
3023
+ const named = expressions.byName.get(dot > 0 ? ref.referenceName.slice(0, dot) : ref.referenceName);
3024
+ const inside = expressions.byFile.get(ref.filePath)?.some((n) => (0, js_class_expressions_1.writtenIn)(n, ref)) ?? false;
3025
+ if (inside && !(named && !named.some((n) => (0, js_class_expressions_1.writtenIn)(n, ref))))
3026
+ return null;
3027
+ let view = this.classExpressionFreeViews.get(base);
3028
+ if (!view) {
3029
+ view = this.classExpressionFreeView(base);
3030
+ this.classExpressionFreeViews.set(base, view);
3031
+ this.classExpressionFreeBases.set(view, base);
3032
+ }
3033
+ return view;
3034
+ }
3035
+ classExpressionFreeView(base) {
3036
+ const { hiddenIds } = this.classExpressions();
3037
+ const hidden = (n) => hiddenIds.has(n.id);
3038
+ const keep = (nodes) => (nodes.some(hidden) ? nodes.filter((n) => !hidden(n)) : nodes);
3039
+ const byKind = new Map();
3040
+ const getMethodMatches = base.getMethodMatches;
3041
+ const iterateNodesByKind = base.iterateNodesByKind;
3042
+ const { files } = this.classExpressions();
3043
+ return {
3044
+ ...base,
3045
+ getNodesByName: (name) => keep(base.getNodesByName(name)),
3046
+ getNodesByLowerName: (lowerName) => keep(base.getNodesByLowerName(lowerName)),
3047
+ getNodesByQualifiedName: (qualifiedName) => keep(base.getNodesByQualifiedName(qualifiedName)),
3048
+ getNodesInFile: (filePath) => (files.has(filePath) ? keep(base.getNodesInFile(filePath)) : base.getNodesInFile(filePath)),
3049
+ getNodesByKind: (kind) => {
3050
+ let nodes = byKind.get(kind);
3051
+ if (!nodes)
3052
+ byKind.set(kind, (nodes = keep(base.getNodesByKind(kind))));
3053
+ return nodes;
3054
+ },
3055
+ getMethodMatches: getMethodMatches
3056
+ ? (typeName, methodName, language) => keep(getMethodMatches(typeName, methodName, language))
3057
+ : undefined,
3058
+ iterateNodesByKind: iterateNodesByKind
3059
+ ? function* (kind) {
3060
+ for (const n of iterateNodesByKind(kind))
3061
+ if (!hidden(n))
3062
+ yield n;
3063
+ }
3064
+ : undefined,
3065
+ };
3066
+ }
3067
+ classExpressionFreeViews = new WeakMap();
3068
+ classExpressionFreeBases = new WeakMap();
3069
+ classExpressionOnlyNames() {
3070
+ if (this.classExpressionOnlyNameSet)
3071
+ return this.classExpressionOnlyNameSet;
3072
+ const only = new Set();
3073
+ const expressions = this.classExpressions();
3074
+ if (expressions) {
3075
+ const names = new Set();
3076
+ for (const id of expressions.hiddenIds) {
3077
+ const n = this.nodeById(id);
3078
+ if (n)
3079
+ names.add(n.name);
3080
+ }
3081
+ for (const name of names) {
3082
+ if (!this.queries.getNodesByName(name).some((n) => !expressions.hiddenIds.has(n.id)))
3083
+ only.add(name);
3084
+ }
3085
+ }
3086
+ this.classExpressionOnlyNameSet = only;
3087
+ return only;
3088
+ }
3089
+ classExpressionOnlyNameSet = null;
3090
+ classExpressionIndex;
3091
+ classExpressions() {
3092
+ if (this.classExpressionIndex !== undefined)
3093
+ return this.classExpressionIndex;
3094
+ const byName = new Map();
3095
+ const byFile = new Map();
3096
+ const byKey = new Map();
3097
+ const files = new Set();
3098
+ const hiddenIds = new Set();
3099
+ const linesOf = (file) => this.context.getFileLines?.(file) ?? this.context.readFile(file)?.split(/\r?\n/) ?? [];
3100
+ for (const n of this.queries.getNodesByKind('class')) {
3101
+ if (!(0, js_class_expressions_1.isJsClassExpression)(n) || (0, js_class_expressions_1.isCommonJsExportedClass)(n, linesOf(n.filePath)))
3102
+ continue;
3103
+ const named = byName.get(n.name);
3104
+ if (named)
3105
+ named.push(n);
3106
+ else
3107
+ byName.set(n.name, [n]);
3108
+ const inFile = byFile.get(n.filePath);
3109
+ if (inFile)
3110
+ inFile.push(n);
3111
+ else
3112
+ byFile.set(n.filePath, [n]);
3113
+ byKey.set(`${n.filePath}\0${n.qualifiedName}`, n);
3114
+ files.add(n.filePath);
3115
+ hiddenIds.add(n.id);
3116
+ }
3117
+ const ownerOf = (member) => {
3118
+ const cut = member.qualifiedName.lastIndexOf('::');
3119
+ return cut > 0 ? byKey.get(`${member.filePath}\0${member.qualifiedName.slice(0, cut)}`) : undefined;
3120
+ };
3121
+ if (files.size > 0) {
3122
+ for (const n of this.queries.getNodesByFiles([...files])) {
3123
+ if ((n.kind === 'method' || n.kind === 'property' || n.kind === 'field') && ownerOf(n))
3124
+ hiddenIds.add(n.id);
3125
+ }
3126
+ }
3127
+ this.classExpressionIndex = byName.size > 0 ? { byName, byFile, files, hiddenIds, ownerOf } : null;
3128
+ return this.classExpressionIndex;
3129
+ }
3130
+ isIndexedFile(filePath) {
3131
+ const normalized = filePath.replace(/\\/g, '/');
3132
+ return this.knownFiles ? this.knownFiles.has(normalized) : this.queries.getFileByPath(normalized) !== null;
3133
+ }
3134
+ manifestScopes = new Map();
3135
+ isDeclaredOutsidePackage(source, fromFile) {
3136
+ if (/^(?:node|bun|jsr|npm|https?):/.test(source) || source.startsWith('@std/') || NODE_BUILTINS.has(source))
3137
+ return true;
3138
+ const name = source.startsWith('@') ? source.split('/').slice(0, 2).join('/') : source.split('/')[0];
3139
+ const normalized = fromFile.replace(/\\/g, '/');
3140
+ const scope = this.manifestScope(normalized.includes('/') ? normalized.slice(0, normalized.lastIndexOf('/')) : '');
3141
+ if (scope.own.has(name))
3142
+ return false;
3143
+ if (scope.deps.has(name))
3144
+ return true;
3145
+ const provider = source.startsWith('astro:') ? 'astro' : /^\$(?:app|env|service-worker)(?:\/|$)/.test(source) ? '@sveltejs/kit' : null;
3146
+ return provider !== null && !scope.own.has(provider) && !this.context.getWorkspacePackages?.()?.byName.has(provider);
3147
+ }
3148
+ manifestScope(dir) {
3149
+ const memo = this.manifestScopes.get(dir);
3150
+ if (memo)
3151
+ return memo;
3152
+ const parent = dir === '' ? null : this.manifestScope(dir.includes('/') ? dir.slice(0, dir.lastIndexOf('/')) : '');
3153
+ let scope = parent ?? { own: new Set(), deps: new Set() };
3154
+ try {
3155
+ const json = JSON.parse(this.context.readFile(dir ? `${dir}/package.json` : 'package.json') ?? 'null');
3156
+ if (json && typeof json === 'object') {
3157
+ scope = { own: new Set(scope.own), deps: new Set(scope.deps) };
3158
+ if (typeof json.name === 'string' && json.name.length > 0)
3159
+ scope.own.add(json.name);
3160
+ for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
3161
+ const deps = json[field];
3162
+ if (!deps || typeof deps !== 'object')
3163
+ continue;
3164
+ for (const [dep, version] of Object.entries(deps)) {
3165
+ if (typeof version === 'string' && /^(?:workspace|file|link|portal):/.test(version))
3166
+ scope.own.add(dep);
3167
+ else
3168
+ scope.deps.add(dep);
3169
+ }
3170
+ }
3171
+ }
3172
+ }
3173
+ catch { }
3174
+ for (const file of ['deno.json', 'deno.jsonc']) {
3175
+ const raw = this.context.readFile(dir ? `${dir}/${file}` : file);
3176
+ if (!raw)
3177
+ continue;
3178
+ const json = (0, jsonc_parser_1.parse)(raw);
3179
+ const imports = json && typeof json === 'object' ? json.imports : undefined;
3180
+ if (!imports || typeof imports !== 'object')
3181
+ continue;
3182
+ for (const [key, target] of Object.entries(imports)) {
3183
+ if (typeof target !== 'string' || !/^(?:jsr|npm|https?):/.test(target))
3184
+ continue;
3185
+ if (scope === parent)
3186
+ scope = { own: new Set(scope.own), deps: new Set(scope.deps) };
3187
+ scope.deps.add(key.replace(/\/$/, ''));
3188
+ }
3189
+ }
3190
+ this.manifestScopes.set(dir, scope);
3191
+ return scope;
3192
+ }
3193
+ sameNamedValueOfType(type) {
3194
+ return this.context
3195
+ .getNodesInFile(type.filePath)
3196
+ .filter((n) => n.name === type.name && TYPE_COMPANION_VALUE_KINDS.has(n.kind))
3197
+ .sort((a, b) => a.startLine - b.startLine || a.startColumn - b.startColumn)[0] ?? null;
3198
+ }
2707
3199
  sameNamedTypeOfValue(value) {
2708
3200
  if (value.kind !== 'constant' && value.kind !== 'variable')
2709
3201
  return null;
@@ -2719,18 +3211,12 @@ class ReferenceResolver {
2719
3211
  return result;
2720
3212
  return (0, name_matcher_1.gateLanguageMatch)(result, ref, this.context);
2721
3213
  }
2722
- /**
2723
- * Framework calls carry bridge evidence (RN/Expo JS → native). Other
2724
- * framework results obey the same code-family boundary as name matches;
2725
- * markup/config transitions remain open.
2726
- */
2727
3214
  gateFrameworkLanguage(result, ref) {
2728
3215
  if (!result)
2729
3216
  return result;
2730
3217
  if (ref.referenceKind === 'calls')
2731
3218
  return result;
2732
3219
  const tgt = this.getLanguageFromNodeId(result.targetNodeId);
2733
- // Package imports cannot target prose found by a framework's name lookup.
2734
3220
  if (ref.referenceKind === 'imports' && tgt === 'markdown' && ref.language !== 'markdown')
2735
3221
  return null;
2736
3222
  if (tgt && ref.language && (0, name_matcher_1.crossesCodeBoundary)(tgt, ref.language))
@@ -2739,9 +3225,19 @@ class ReferenceResolver {
2739
3225
  }
2740
3226
  }
2741
3227
  exports.ReferenceResolver = ReferenceResolver;
2742
- /**
2743
- * Create a reference resolver instance
2744
- */
3228
+ function isCfmlTemplatePath(name) {
3229
+ return !name.includes(':') && (name.includes('/') || name.includes('\\') || /\.(?:cfml?|cfc|cfs)$/i.test(name.trim()));
3230
+ }
3231
+ function goDirOf(p) {
3232
+ const dir = path.posix.dirname(p.replace(/\\/g, '/'));
3233
+ return dir === '.' || dir === '/' ? '' : dir;
3234
+ }
3235
+ function changedRoutes(before, after) {
3236
+ const key = (route) => `${route.filePath}\0${route.name}`;
3237
+ const beforeKeys = new Set(before.map(key));
3238
+ const afterKeys = new Set(after.map(key));
3239
+ return [...before.filter((route) => !afterKeys.has(key(route))), ...after.filter((route) => !beforeKeys.has(key(route)))];
3240
+ }
2745
3241
  function createResolver(projectRoot, queries) {
2746
3242
  const resolver = new ReferenceResolver(projectRoot, queries);
2747
3243
  resolver.initialize();