cgraphx 2.0.2 → 2.0.6

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 (754) hide show
  1. package/dist/.claude-template/FLOW-MAP.md +13 -3
  2. package/dist/.claude-template/agents/task-history.md +186 -0
  3. package/dist/.claude-template/commands/end.md +1 -0
  4. package/dist/.claude-template/skills/cgraphx-guide/SKILL.md +5 -3
  5. package/dist/.claude-template/skills/cgraphx-guide/how-to-use.html +8 -8
  6. package/dist/.claude-template/skills/cgraphx-guide/how-to-use.md +8 -8
  7. package/dist/.claude-template/skills/clarify-requirements/SKILL.md +13 -9
  8. package/dist/.claude-template/skills/db-query/SKILL.md +19 -2
  9. package/dist/.claude-template/skills/iboc-check/SKILL.md +51 -23
  10. package/dist/.claude-template/skills/iboc-check/filler-prompt.md +3 -4
  11. package/dist/.claude-template/skills/run-api-test/SKILL.md +15 -15
  12. package/dist/.claude-template/skills/run-api-test/assets/{template-test-report.md → template-/346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212.md} +4 -4
  13. package/dist/.claude-template/skills/run-api-test/references/bru-run.md +1 -1
  14. package/dist/.claude-template/skills/run-api-test/references/db-verification.md +2 -2
  15. package/dist/.claude-template/skills/run-api-test/references/report-format.md +6 -6
  16. package/dist/.claude-template/skills/run-api-test/references/service-readiness.md +1 -1
  17. package/dist/.claude-template/skills/run-api-test/references/test-scope.md +6 -6
  18. package/dist/.claude-template/skills/run-ui-test/SKILL.md +186 -0
  19. package/dist/.claude-template/skills/run-ui-test/references/report-format.md +77 -0
  20. package/dist/.claude-template/skills/subagent-implement/SKILL.md +3 -2
  21. package/dist/.claude-template/skills/write-api/SKILL.md +18 -18
  22. package/dist/.claude-template/skills/write-api/assets/{template-api-spec.md → template-/346/216/245/345/217/243/346/265/213/350/257/225-spec.md} +1 -1
  23. package/dist/.claude-template/skills/write-api/references/{api-spec-format.md → /346/216/245/345/217/243/346/265/213/350/257/225-spec-format.md} +3 -3
  24. package/dist/.claude-template/skills/write-plan/SKILL.md +4 -2
  25. package/dist/.claude-template/skills/write-ui-test/SKILL.md +125 -0
  26. package/dist/.claude-template/skills/write-ui-test/references//347/224/250/344/276/213/350/247/204/346/240/274-format.md +94 -0
  27. package/dist/core/code/engine/cli/analyze-config.js +320 -0
  28. package/dist/core/code/engine/cli/analyze.js +1086 -0
  29. package/dist/core/code/engine/cli/cli-message.js +83 -0
  30. package/dist/core/code/engine/cli/detect-changes-format.js +58 -0
  31. package/dist/core/code/engine/cli/embedding-dims.js +43 -0
  32. package/dist/core/code/engine/cli/format-elapsed.js +12 -0
  33. package/dist/core/code/engine/cli/help-i18n.js +144 -0
  34. package/dist/core/code/engine/cli/i18n/en.js +110 -0
  35. package/dist/core/code/engine/cli/i18n/index.js +47 -0
  36. package/dist/core/code/engine/cli/i18n/resources.js +9 -0
  37. package/dist/core/code/engine/cli/i18n/zh-CN.js +110 -0
  38. package/dist/core/code/engine/cli/lazy-action.js +67 -0
  39. package/dist/core/code/engine/cli/optional-grammars.js +136 -0
  40. package/dist/core/code/engine/cli/resolve-invocation.js +76 -0
  41. package/dist/core/code/engine/cli/status.js +156 -0
  42. package/dist/core/code/engine/cli/tool.js +384 -0
  43. package/dist/core/code/engine/config/ignore-service.js +511 -0
  44. package/dist/core/code/engine/config/supported-languages.js +17 -0
  45. package/dist/core/code/engine/core/analysis-features.js +64 -0
  46. package/dist/core/code/engine/core/analyzer-identity.js +2171 -0
  47. package/dist/core/code/engine/core/git-staleness.js +180 -0
  48. package/dist/core/code/engine/core/graph/graph.js +180 -0
  49. package/dist/core/code/engine/core/graph/import-cycles.js +106 -0
  50. package/dist/core/code/engine/core/graph/types.js +2 -0
  51. package/dist/core/code/engine/core/index-freshness.js +12 -0
  52. package/dist/core/code/engine/core/ingestion/binding-accumulator.js +341 -0
  53. package/dist/core/code/engine/core/ingestion/call-extractors/configs/c-cpp.js +168 -0
  54. package/dist/core/code/engine/core/ingestion/call-extractors/configs/csharp.js +9 -0
  55. package/dist/core/code/engine/core/ingestion/call-extractors/configs/dart.js +8 -0
  56. package/dist/core/code/engine/core/ingestion/call-extractors/configs/go.js +8 -0
  57. package/dist/core/code/engine/core/ingestion/call-extractors/configs/jvm.js +54 -0
  58. package/dist/core/code/engine/core/ingestion/call-extractors/configs/php.js +8 -0
  59. package/dist/core/code/engine/core/ingestion/call-extractors/configs/python.js +8 -0
  60. package/dist/core/code/engine/core/ingestion/call-extractors/configs/ruby.js +8 -0
  61. package/dist/core/code/engine/core/ingestion/call-extractors/configs/rust.js +8 -0
  62. package/dist/core/code/engine/core/ingestion/call-extractors/configs/swift.js +8 -0
  63. package/dist/core/code/engine/core/ingestion/call-extractors/configs/typescript-javascript.js +11 -0
  64. package/dist/core/code/engine/core/ingestion/call-extractors/generic.js +62 -0
  65. package/dist/core/code/engine/core/ingestion/call-processor.js +503 -0
  66. package/dist/core/code/engine/core/ingestion/call-routing.js +98 -0
  67. package/dist/core/code/engine/core/ingestion/call-types.js +3 -0
  68. package/dist/core/code/engine/core/ingestion/cfg/callee-cell-format.js +45 -0
  69. package/dist/core/code/engine/core/ingestion/cfg/cfg-builder.js +202 -0
  70. package/dist/core/code/engine/core/ingestion/cfg/collect.js +81 -0
  71. package/dist/core/code/engine/core/ingestion/cfg/control-dependence.js +185 -0
  72. package/dist/core/code/engine/core/ingestion/cfg/control-flow-context.js +130 -0
  73. package/dist/core/code/engine/core/ingestion/cfg/emit.js +646 -0
  74. package/dist/core/code/engine/core/ingestion/cfg/post-dominators.js +182 -0
  75. package/dist/core/code/engine/core/ingestion/cfg/reaching-def-reason-codec.js +139 -0
  76. package/dist/core/code/engine/core/ingestion/cfg/reaching-defs-graph.js +322 -0
  77. package/dist/core/code/engine/core/ingestion/cfg/reaching-defs.js +792 -0
  78. package/dist/core/code/engine/core/ingestion/cfg/synthetic-escape.js +305 -0
  79. package/dist/core/code/engine/core/ingestion/cfg/traversal-result.js +6 -0
  80. package/dist/core/code/engine/core/ingestion/cfg/types.js +14 -0
  81. package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp-harvest.js +545 -0
  82. package/dist/core/code/engine/core/ingestion/cfg/visitors/c-cpp.js +590 -0
  83. package/dist/core/code/engine/core/ingestion/cfg/visitors/call-site-harvest.js +356 -0
  84. package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp-harvest.js +593 -0
  85. package/dist/core/code/engine/core/ingestion/cfg/visitors/csharp.js +871 -0
  86. package/dist/core/code/engine/core/ingestion/cfg/visitors/dart-harvest.js +874 -0
  87. package/dist/core/code/engine/core/ingestion/cfg/visitors/dart.js +840 -0
  88. package/dist/core/code/engine/core/ingestion/cfg/visitors/go-harvest.js +625 -0
  89. package/dist/core/code/engine/core/ingestion/cfg/visitors/go.js +642 -0
  90. package/dist/core/code/engine/core/ingestion/cfg/visitors/java-harvest.js +517 -0
  91. package/dist/core/code/engine/core/ingestion/cfg/visitors/java.js +816 -0
  92. package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin-harvest.js +723 -0
  93. package/dist/core/code/engine/core/ingestion/cfg/visitors/kotlin.js +813 -0
  94. package/dist/core/code/engine/core/ingestion/cfg/visitors/php-harvest.js +630 -0
  95. package/dist/core/code/engine/core/ingestion/cfg/visitors/php.js +725 -0
  96. package/dist/core/code/engine/core/ingestion/cfg/visitors/python-harvest.js +776 -0
  97. package/dist/core/code/engine/core/ingestion/cfg/visitors/python.js +562 -0
  98. package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby-harvest.js +591 -0
  99. package/dist/core/code/engine/core/ingestion/cfg/visitors/ruby.js +760 -0
  100. package/dist/core/code/engine/core/ingestion/cfg/visitors/rust-harvest.js +877 -0
  101. package/dist/core/code/engine/core/ingestion/cfg/visitors/rust.js +562 -0
  102. package/dist/core/code/engine/core/ingestion/cfg/visitors/scope-tree-harvest.js +120 -0
  103. package/dist/core/code/engine/core/ingestion/cfg/visitors/swift-harvest.js +683 -0
  104. package/dist/core/code/engine/core/ingestion/cfg/visitors/swift.js +791 -0
  105. package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript-harvest.js +1060 -0
  106. package/dist/core/code/engine/core/ingestion/cfg/visitors/typescript.js +587 -0
  107. package/dist/core/code/engine/core/ingestion/class-extractors/configs/c-cpp.js +77 -0
  108. package/dist/core/code/engine/core/ingestion/class-extractors/configs/csharp.js +24 -0
  109. package/dist/core/code/engine/core/ingestion/class-extractors/configs/dart.js +10 -0
  110. package/dist/core/code/engine/core/ingestion/class-extractors/configs/go.js +28 -0
  111. package/dist/core/code/engine/core/ingestion/class-extractors/configs/jvm.js +67 -0
  112. package/dist/core/code/engine/core/ingestion/class-extractors/configs/php.js +10 -0
  113. package/dist/core/code/engine/core/ingestion/class-extractors/configs/python.js +10 -0
  114. package/dist/core/code/engine/core/ingestion/class-extractors/configs/ruby.js +13 -0
  115. package/dist/core/code/engine/core/ingestion/class-extractors/configs/rust.js +10 -0
  116. package/dist/core/code/engine/core/ingestion/class-extractors/configs/swift.js +21 -0
  117. package/dist/core/code/engine/core/ingestion/class-extractors/configs/typescript-javascript.js +31 -0
  118. package/dist/core/code/engine/core/ingestion/class-extractors/generic.js +144 -0
  119. package/dist/core/code/engine/core/ingestion/class-types.js +2 -0
  120. package/dist/core/code/engine/core/ingestion/cluster-enricher.js +174 -0
  121. package/dist/core/code/engine/core/ingestion/community-processor.js +604 -0
  122. package/dist/core/code/engine/core/ingestion/constants.js +26 -0
  123. package/dist/core/code/engine/core/ingestion/cpp-ue-preprocessor.js +263 -0
  124. package/dist/core/code/engine/core/ingestion/csharp-namespace-gate.js +133 -0
  125. package/dist/core/code/engine/core/ingestion/di-extractors/index.js +38 -0
  126. package/dist/core/code/engine/core/ingestion/di-extractors/spring.js +310 -0
  127. package/dist/core/code/engine/core/ingestion/emit-references.js +244 -0
  128. package/dist/core/code/engine/core/ingestion/entry-point-scoring.js +201 -0
  129. package/dist/core/code/engine/core/ingestion/export-detection.js +244 -0
  130. package/dist/core/code/engine/core/ingestion/field-extractor.js +29 -0
  131. package/dist/core/code/engine/core/ingestion/field-extractors/configs/c-cpp.js +107 -0
  132. package/dist/core/code/engine/core/ingestion/field-extractors/configs/csharp.js +124 -0
  133. package/dist/core/code/engine/core/ingestion/field-extractors/configs/dart.js +99 -0
  134. package/dist/core/code/engine/core/ingestion/field-extractors/configs/go.js +102 -0
  135. package/dist/core/code/engine/core/ingestion/field-extractors/configs/helpers.js +198 -0
  136. package/dist/core/code/engine/core/ingestion/field-extractors/configs/jvm.js +172 -0
  137. package/dist/core/code/engine/core/ingestion/field-extractors/configs/php.js +67 -0
  138. package/dist/core/code/engine/core/ingestion/field-extractors/configs/python.js +94 -0
  139. package/dist/core/code/engine/core/ingestion/field-extractors/configs/ruby.js +79 -0
  140. package/dist/core/code/engine/core/ingestion/field-extractors/configs/rust.js +55 -0
  141. package/dist/core/code/engine/core/ingestion/field-extractors/configs/swift.js +93 -0
  142. package/dist/core/code/engine/core/ingestion/field-extractors/configs/typescript-javascript.js +59 -0
  143. package/dist/core/code/engine/core/ingestion/field-extractors/generic.js +147 -0
  144. package/dist/core/code/engine/core/ingestion/field-extractors/typescript.js +266 -0
  145. package/dist/core/code/engine/core/ingestion/field-types.js +3 -0
  146. package/dist/core/code/engine/core/ingestion/filesystem-walker.js +136 -0
  147. package/dist/core/code/engine/core/ingestion/finalize-orchestrator.js +159 -0
  148. package/dist/core/code/engine/core/ingestion/framework-detection.js +432 -0
  149. package/dist/core/code/engine/core/ingestion/frameworks/spring/analysis-features.js +38 -0
  150. package/dist/core/code/engine/core/ingestion/frameworks/spring/annotation-arguments.js +234 -0
  151. package/dist/core/code/engine/core/ingestion/frameworks/spring/aop-candidates.js +88 -0
  152. package/dist/core/code/engine/core/ingestion/frameworks/spring/aop.js +487 -0
  153. package/dist/core/code/engine/core/ingestion/frameworks/spring/auto-configuration.js +21 -0
  154. package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-candidates.js +189 -0
  155. package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-catalog.js +32 -0
  156. package/dist/core/code/engine/core/ingestion/frameworks/spring/bean-factories.js +73 -0
  157. package/dist/core/code/engine/core/ingestion/frameworks/spring/conditionals.js +323 -0
  158. package/dist/core/code/engine/core/ingestion/frameworks/spring/config-bindings.js +119 -0
  159. package/dist/core/code/engine/core/ingestion/frameworks/spring/di-metadata.js +385 -0
  160. package/dist/core/code/engine/core/ingestion/frameworks/spring/resource-injection.js +96 -0
  161. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/c-cpp.js +17 -0
  162. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/csharp.js +46 -0
  163. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/dart.js +59 -0
  164. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/go.js +30 -0
  165. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/jvm.js +73 -0
  166. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/php.js +19 -0
  167. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/python.js +45 -0
  168. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/ruby.js +20 -0
  169. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/rust.js +58 -0
  170. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/swift.js +94 -0
  171. package/dist/core/code/engine/core/ingestion/import-resolvers/configs/typescript-javascript.js +26 -0
  172. package/dist/core/code/engine/core/ingestion/import-resolvers/csharp.js +128 -0
  173. package/dist/core/code/engine/core/ingestion/import-resolvers/go.js +50 -0
  174. package/dist/core/code/engine/core/ingestion/import-resolvers/jvm.js +112 -0
  175. package/dist/core/code/engine/core/ingestion/import-resolvers/php.js +80 -0
  176. package/dist/core/code/engine/core/ingestion/import-resolvers/python.js +75 -0
  177. package/dist/core/code/engine/core/ingestion/import-resolvers/resolver-factory.js +36 -0
  178. package/dist/core/code/engine/core/ingestion/import-resolvers/ruby.js +20 -0
  179. package/dist/core/code/engine/core/ingestion/import-resolvers/rust.js +79 -0
  180. package/dist/core/code/engine/core/ingestion/import-resolvers/standard.js +180 -0
  181. package/dist/core/code/engine/core/ingestion/import-resolvers/types.js +7 -0
  182. package/dist/core/code/engine/core/ingestion/import-resolvers/utils.js +153 -0
  183. package/dist/core/code/engine/core/ingestion/import-target-adapter.js +99 -0
  184. package/dist/core/code/engine/core/ingestion/language-config.js +391 -0
  185. package/dist/core/code/engine/core/ingestion/language-provider.js +25 -0
  186. package/dist/core/code/engine/core/ingestion/languages/c/arity-metadata.js +98 -0
  187. package/dist/core/code/engine/core/ingestion/languages/c/arity.js +21 -0
  188. package/dist/core/code/engine/core/ingestion/languages/c/capture-side-channel.js +69 -0
  189. package/dist/core/code/engine/core/ingestion/languages/c/captures.js +189 -0
  190. package/dist/core/code/engine/core/ingestion/languages/c/header-scan.js +58 -0
  191. package/dist/core/code/engine/core/ingestion/languages/c/import-decomposer.js +68 -0
  192. package/dist/core/code/engine/core/ingestion/languages/c/import-target.js +103 -0
  193. package/dist/core/code/engine/core/ingestion/languages/c/index.js +33 -0
  194. package/dist/core/code/engine/core/ingestion/languages/c/interpret.js +53 -0
  195. package/dist/core/code/engine/core/ingestion/languages/c/merge-bindings.js +26 -0
  196. package/dist/core/code/engine/core/ingestion/languages/c/query.js +210 -0
  197. package/dist/core/code/engine/core/ingestion/languages/c/scope-resolver.js +112 -0
  198. package/dist/core/code/engine/core/ingestion/languages/c/simple-hooks.js +24 -0
  199. package/dist/core/code/engine/core/ingestion/languages/c/static-linkage.js +109 -0
  200. package/dist/core/code/engine/core/ingestion/languages/c-cpp.js +506 -0
  201. package/dist/core/code/engine/core/ingestion/languages/cpp/adl.js +804 -0
  202. package/dist/core/code/engine/core/ingestion/languages/cpp/arity-metadata.js +258 -0
  203. package/dist/core/code/engine/core/ingestion/languages/cpp/arity.js +37 -0
  204. package/dist/core/code/engine/core/ingestion/languages/cpp/capture-side-channel.js +89 -0
  205. package/dist/core/code/engine/core/ingestion/languages/cpp/captures.js +1975 -0
  206. package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-extractor.js +311 -0
  207. package/dist/core/code/engine/core/ingestion/languages/cpp/constraint-filter.js +210 -0
  208. package/dist/core/code/engine/core/ingestion/languages/cpp/conversion-rank.js +163 -0
  209. package/dist/core/code/engine/core/ingestion/languages/cpp/file-local-linkage.js +327 -0
  210. package/dist/core/code/engine/core/ingestion/languages/cpp/header-scan.js +53 -0
  211. package/dist/core/code/engine/core/ingestion/languages/cpp/import-decomposer.js +134 -0
  212. package/dist/core/code/engine/core/ingestion/languages/cpp/import-target.js +16 -0
  213. package/dist/core/code/engine/core/ingestion/languages/cpp/index.js +33 -0
  214. package/dist/core/code/engine/core/ingestion/languages/cpp/inline-namespaces.js +379 -0
  215. package/dist/core/code/engine/core/ingestion/languages/cpp/interpret.js +239 -0
  216. package/dist/core/code/engine/core/ingestion/languages/cpp/member-lookup.js +470 -0
  217. package/dist/core/code/engine/core/ingestion/languages/cpp/merge-bindings.js +32 -0
  218. package/dist/core/code/engine/core/ingestion/languages/cpp/query.js +763 -0
  219. package/dist/core/code/engine/core/ingestion/languages/cpp/range-bindings.js +230 -0
  220. package/dist/core/code/engine/core/ingestion/languages/cpp/scope-resolver.js +354 -0
  221. package/dist/core/code/engine/core/ingestion/languages/cpp/simple-hooks.js +67 -0
  222. package/dist/core/code/engine/core/ingestion/languages/cpp/two-phase-lookup.js +348 -0
  223. package/dist/core/code/engine/core/ingestion/languages/cpp/type-classifier.js +56 -0
  224. package/dist/core/code/engine/core/ingestion/languages/cpp/user-defined-conversions.js +128 -0
  225. package/dist/core/code/engine/core/ingestion/languages/csharp/accessor-unwrap.js +67 -0
  226. package/dist/core/code/engine/core/ingestion/languages/csharp/arity-metadata.js +49 -0
  227. package/dist/core/code/engine/core/ingestion/languages/csharp/arity.js +40 -0
  228. package/dist/core/code/engine/core/ingestion/languages/csharp/cache-stats.js +32 -0
  229. package/dist/core/code/engine/core/ingestion/languages/csharp/captures.js +557 -0
  230. package/dist/core/code/engine/core/ingestion/languages/csharp/import-decomposer.js +96 -0
  231. package/dist/core/code/engine/core/ingestion/languages/csharp/import-target.js +176 -0
  232. package/dist/core/code/engine/core/ingestion/languages/csharp/index.js +95 -0
  233. package/dist/core/code/engine/core/ingestion/languages/csharp/interpret.js +150 -0
  234. package/dist/core/code/engine/core/ingestion/languages/csharp/merge-bindings.js +58 -0
  235. package/dist/core/code/engine/core/ingestion/languages/csharp/namespace-siblings.js +708 -0
  236. package/dist/core/code/engine/core/ingestion/languages/csharp/qualified-type-names.js +62 -0
  237. package/dist/core/code/engine/core/ingestion/languages/csharp/query.js +578 -0
  238. package/dist/core/code/engine/core/ingestion/languages/csharp/receiver-binding.js +142 -0
  239. package/dist/core/code/engine/core/ingestion/languages/csharp/resolution-config.js +18 -0
  240. package/dist/core/code/engine/core/ingestion/languages/csharp/scope-resolver.js +84 -0
  241. package/dist/core/code/engine/core/ingestion/languages/csharp/simple-hooks.js +81 -0
  242. package/dist/core/code/engine/core/ingestion/languages/csharp.js +204 -0
  243. package/dist/core/code/engine/core/ingestion/languages/dart/arity-metadata.js +38 -0
  244. package/dist/core/code/engine/core/ingestion/languages/dart/arity.js +34 -0
  245. package/dist/core/code/engine/core/ingestion/languages/dart/built-ins.js +37 -0
  246. package/dist/core/code/engine/core/ingestion/languages/dart/cache-stats.js +30 -0
  247. package/dist/core/code/engine/core/ingestion/languages/dart/captures.js +1096 -0
  248. package/dist/core/code/engine/core/ingestion/languages/dart/expand-wildcards.js +34 -0
  249. package/dist/core/code/engine/core/ingestion/languages/dart/extension-type-preprocess.js +33 -0
  250. package/dist/core/code/engine/core/ingestion/languages/dart/import-target.js +68 -0
  251. package/dist/core/code/engine/core/ingestion/languages/dart/index.js +45 -0
  252. package/dist/core/code/engine/core/ingestion/languages/dart/interpret.js +101 -0
  253. package/dist/core/code/engine/core/ingestion/languages/dart/merge-bindings.js +42 -0
  254. package/dist/core/code/engine/core/ingestion/languages/dart/query.js +246 -0
  255. package/dist/core/code/engine/core/ingestion/languages/dart/receiver-binding.js +90 -0
  256. package/dist/core/code/engine/core/ingestion/languages/dart/scope-resolver.js +197 -0
  257. package/dist/core/code/engine/core/ingestion/languages/dart/signature-bindings.js +54 -0
  258. package/dist/core/code/engine/core/ingestion/languages/dart/simple-hooks.js +61 -0
  259. package/dist/core/code/engine/core/ingestion/languages/dart.js +138 -0
  260. package/dist/core/code/engine/core/ingestion/languages/go/arity-metadata.js +71 -0
  261. package/dist/core/code/engine/core/ingestion/languages/go/arity.js +17 -0
  262. package/dist/core/code/engine/core/ingestion/languages/go/cache-stats.js +21 -0
  263. package/dist/core/code/engine/core/ingestion/languages/go/captures.js +492 -0
  264. package/dist/core/code/engine/core/ingestion/languages/go/expand-wildcards.js +97 -0
  265. package/dist/core/code/engine/core/ingestion/languages/go/generic-type-parameters.js +146 -0
  266. package/dist/core/code/engine/core/ingestion/languages/go/import-decomposer.js +47 -0
  267. package/dist/core/code/engine/core/ingestion/languages/go/import-target.js +70 -0
  268. package/dist/core/code/engine/core/ingestion/languages/go/index.js +39 -0
  269. package/dist/core/code/engine/core/ingestion/languages/go/interface-impls.js +955 -0
  270. package/dist/core/code/engine/core/ingestion/languages/go/interpret.js +177 -0
  271. package/dist/core/code/engine/core/ingestion/languages/go/merge-bindings.js +21 -0
  272. package/dist/core/code/engine/core/ingestion/languages/go/method-owners.js +131 -0
  273. package/dist/core/code/engine/core/ingestion/languages/go/namespace-mirror.js +56 -0
  274. package/dist/core/code/engine/core/ingestion/languages/go/package-clause.js +79 -0
  275. package/dist/core/code/engine/core/ingestion/languages/go/package-siblings.js +83 -0
  276. package/dist/core/code/engine/core/ingestion/languages/go/query.js +298 -0
  277. package/dist/core/code/engine/core/ingestion/languages/go/range-binding.js +127 -0
  278. package/dist/core/code/engine/core/ingestion/languages/go/receiver-binding.js +24 -0
  279. package/dist/core/code/engine/core/ingestion/languages/go/scope-resolver.js +75 -0
  280. package/dist/core/code/engine/core/ingestion/languages/go/simple-hooks.js +31 -0
  281. package/dist/core/code/engine/core/ingestion/languages/go/type-binding.js +279 -0
  282. package/dist/core/code/engine/core/ingestion/languages/go.js +160 -0
  283. package/dist/core/code/engine/core/ingestion/languages/index.js +66 -0
  284. package/dist/core/code/engine/core/ingestion/languages/java/analysis-features.js +16 -0
  285. package/dist/core/code/engine/core/ingestion/languages/java/arity-metadata.js +43 -0
  286. package/dist/core/code/engine/core/ingestion/languages/java/arity.js +27 -0
  287. package/dist/core/code/engine/core/ingestion/languages/java/cache-stats.js +32 -0
  288. package/dist/core/code/engine/core/ingestion/languages/java/capture-side-channel.js +123 -0
  289. package/dist/core/code/engine/core/ingestion/languages/java/captures.js +791 -0
  290. package/dist/core/code/engine/core/ingestion/languages/java/import-decomposer.js +88 -0
  291. package/dist/core/code/engine/core/ingestion/languages/java/import-target.js +103 -0
  292. package/dist/core/code/engine/core/ingestion/languages/java/index.js +43 -0
  293. package/dist/core/code/engine/core/ingestion/languages/java/interpret.js +146 -0
  294. package/dist/core/code/engine/core/ingestion/languages/java/merge-bindings.js +43 -0
  295. package/dist/core/code/engine/core/ingestion/languages/java/package-facts.js +16 -0
  296. package/dist/core/code/engine/core/ingestion/languages/java/package-siblings.js +11 -0
  297. package/dist/core/code/engine/core/ingestion/languages/java/query.js +319 -0
  298. package/dist/core/code/engine/core/ingestion/languages/java/receiver-binding.js +98 -0
  299. package/dist/core/code/engine/core/ingestion/languages/java/scope-resolver.js +213 -0
  300. package/dist/core/code/engine/core/ingestion/languages/java/simple-hooks.js +39 -0
  301. package/dist/core/code/engine/core/ingestion/languages/java/spring-aop.js +53 -0
  302. package/dist/core/code/engine/core/ingestion/languages/java/spring-bean-metadata.js +11 -0
  303. package/dist/core/code/engine/core/ingestion/languages/java/spring-conditionals.js +52 -0
  304. package/dist/core/code/engine/core/ingestion/languages/java/spring-config-bindings.js +222 -0
  305. package/dist/core/code/engine/core/ingestion/languages/java/spring-di.js +165 -0
  306. package/dist/core/code/engine/core/ingestion/languages/java.js +192 -0
  307. package/dist/core/code/engine/core/ingestion/languages/javascript/arity.js +15 -0
  308. package/dist/core/code/engine/core/ingestion/languages/javascript/captures.js +1122 -0
  309. package/dist/core/code/engine/core/ingestion/languages/javascript/import-target.js +56 -0
  310. package/dist/core/code/engine/core/ingestion/languages/javascript/index.js +109 -0
  311. package/dist/core/code/engine/core/ingestion/languages/javascript/interpret.js +45 -0
  312. package/dist/core/code/engine/core/ingestion/languages/javascript/merge-bindings.js +21 -0
  313. package/dist/core/code/engine/core/ingestion/languages/javascript/query.js +659 -0
  314. package/dist/core/code/engine/core/ingestion/languages/javascript/scope-resolver.js +78 -0
  315. package/dist/core/code/engine/core/ingestion/languages/javascript/simple-hooks.js +44 -0
  316. package/dist/core/code/engine/core/ingestion/languages/jvm/package-facts.js +46 -0
  317. package/dist/core/code/engine/core/ingestion/languages/jvm/package-siblings.js +200 -0
  318. package/dist/core/code/engine/core/ingestion/languages/kotlin/arity-metadata.js +23 -0
  319. package/dist/core/code/engine/core/ingestion/languages/kotlin/arity.js +18 -0
  320. package/dist/core/code/engine/core/ingestion/languages/kotlin/cache-stats.js +21 -0
  321. package/dist/core/code/engine/core/ingestion/languages/kotlin/capture-side-channel.js +160 -0
  322. package/dist/core/code/engine/core/ingestion/languages/kotlin/captures.js +1262 -0
  323. package/dist/core/code/engine/core/ingestion/languages/kotlin/companion-scopes.js +72 -0
  324. package/dist/core/code/engine/core/ingestion/languages/kotlin/import-decomposer.js +40 -0
  325. package/dist/core/code/engine/core/ingestion/languages/kotlin/import-target.js +135 -0
  326. package/dist/core/code/engine/core/ingestion/languages/kotlin/index.js +26 -0
  327. package/dist/core/code/engine/core/ingestion/languages/kotlin/interpret.js +75 -0
  328. package/dist/core/code/engine/core/ingestion/languages/kotlin/merge-bindings.js +28 -0
  329. package/dist/core/code/engine/core/ingestion/languages/kotlin/owners.js +134 -0
  330. package/dist/core/code/engine/core/ingestion/languages/kotlin/package-facts.js +16 -0
  331. package/dist/core/code/engine/core/ingestion/languages/kotlin/package-siblings.js +11 -0
  332. package/dist/core/code/engine/core/ingestion/languages/kotlin/query.js +243 -0
  333. package/dist/core/code/engine/core/ingestion/languages/kotlin/receiver-binding.js +103 -0
  334. package/dist/core/code/engine/core/ingestion/languages/kotlin/scope-resolver.js +207 -0
  335. package/dist/core/code/engine/core/ingestion/languages/kotlin/simple-hooks.js +42 -0
  336. package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-aop.js +68 -0
  337. package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-bean-metadata.js +11 -0
  338. package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-conditionals.js +53 -0
  339. package/dist/core/code/engine/core/ingestion/languages/kotlin/spring-di.js +304 -0
  340. package/dist/core/code/engine/core/ingestion/languages/kotlin.js +189 -0
  341. package/dist/core/code/engine/core/ingestion/languages/php/arity-metadata.js +66 -0
  342. package/dist/core/code/engine/core/ingestion/languages/php/arity.js +43 -0
  343. package/dist/core/code/engine/core/ingestion/languages/php/cache-stats.js +32 -0
  344. package/dist/core/code/engine/core/ingestion/languages/php/captures.js +1166 -0
  345. package/dist/core/code/engine/core/ingestion/languages/php/import-decomposer.js +238 -0
  346. package/dist/core/code/engine/core/ingestion/languages/php/import-target.js +213 -0
  347. package/dist/core/code/engine/core/ingestion/languages/php/index.js +85 -0
  348. package/dist/core/code/engine/core/ingestion/languages/php/interpret.js +256 -0
  349. package/dist/core/code/engine/core/ingestion/languages/php/merge-bindings.js +50 -0
  350. package/dist/core/code/engine/core/ingestion/languages/php/namespace-siblings.js +353 -0
  351. package/dist/core/code/engine/core/ingestion/languages/php/query.js +391 -0
  352. package/dist/core/code/engine/core/ingestion/languages/php/receiver-binding.js +135 -0
  353. package/dist/core/code/engine/core/ingestion/languages/php/scope-resolver.js +361 -0
  354. package/dist/core/code/engine/core/ingestion/languages/php/simple-hooks.js +116 -0
  355. package/dist/core/code/engine/core/ingestion/languages/php.js +302 -0
  356. package/dist/core/code/engine/core/ingestion/languages/python/arity-metadata.js +49 -0
  357. package/dist/core/code/engine/core/ingestion/languages/python/arity.js +41 -0
  358. package/dist/core/code/engine/core/ingestion/languages/python/cache-stats.js +34 -0
  359. package/dist/core/code/engine/core/ingestion/languages/python/captures.js +299 -0
  360. package/dist/core/code/engine/core/ingestion/languages/python/depends-references.js +68 -0
  361. package/dist/core/code/engine/core/ingestion/languages/python/import-decomposer.js +115 -0
  362. package/dist/core/code/engine/core/ingestion/languages/python/import-target.js +440 -0
  363. package/dist/core/code/engine/core/ingestion/languages/python/index-stats.js +30 -0
  364. package/dist/core/code/engine/core/ingestion/languages/python/index.js +96 -0
  365. package/dist/core/code/engine/core/ingestion/languages/python/interpret.js +430 -0
  366. package/dist/core/code/engine/core/ingestion/languages/python/merge-bindings.js +47 -0
  367. package/dist/core/code/engine/core/ingestion/languages/python/query.js +323 -0
  368. package/dist/core/code/engine/core/ingestion/languages/python/receiver-binding.js +310 -0
  369. package/dist/core/code/engine/core/ingestion/languages/python/scope-resolver.js +80 -0
  370. package/dist/core/code/engine/core/ingestion/languages/python/simple-hooks.js +53 -0
  371. package/dist/core/code/engine/core/ingestion/languages/python.js +140 -0
  372. package/dist/core/code/engine/core/ingestion/languages/ruby/arity.js +41 -0
  373. package/dist/core/code/engine/core/ingestion/languages/ruby/cache-stats.js +21 -0
  374. package/dist/core/code/engine/core/ingestion/languages/ruby/captures.js +864 -0
  375. package/dist/core/code/engine/core/ingestion/languages/ruby/import-target.js +88 -0
  376. package/dist/core/code/engine/core/ingestion/languages/ruby/index.js +29 -0
  377. package/dist/core/code/engine/core/ingestion/languages/ruby/interpret.js +115 -0
  378. package/dist/core/code/engine/core/ingestion/languages/ruby/merge-bindings.js +21 -0
  379. package/dist/core/code/engine/core/ingestion/languages/ruby/query.js +349 -0
  380. package/dist/core/code/engine/core/ingestion/languages/ruby/receiver-binding.js +70 -0
  381. package/dist/core/code/engine/core/ingestion/languages/ruby/scope-resolver.js +263 -0
  382. package/dist/core/code/engine/core/ingestion/languages/ruby/simple-hooks.js +68 -0
  383. package/dist/core/code/engine/core/ingestion/languages/ruby.js +215 -0
  384. package/dist/core/code/engine/core/ingestion/languages/rust/arity.js +16 -0
  385. package/dist/core/code/engine/core/ingestion/languages/rust/cache-stats.js +21 -0
  386. package/dist/core/code/engine/core/ingestion/languages/rust/captures.js +304 -0
  387. package/dist/core/code/engine/core/ingestion/languages/rust/import-decomposer.js +167 -0
  388. package/dist/core/code/engine/core/ingestion/languages/rust/import-target.js +108 -0
  389. package/dist/core/code/engine/core/ingestion/languages/rust/index.js +29 -0
  390. package/dist/core/code/engine/core/ingestion/languages/rust/interpret.js +201 -0
  391. package/dist/core/code/engine/core/ingestion/languages/rust/merge-bindings.js +21 -0
  392. package/dist/core/code/engine/core/ingestion/languages/rust/method-owners.js +76 -0
  393. package/dist/core/code/engine/core/ingestion/languages/rust/module-path.js +222 -0
  394. package/dist/core/code/engine/core/ingestion/languages/rust/qualified-call.js +482 -0
  395. package/dist/core/code/engine/core/ingestion/languages/rust/query.js +280 -0
  396. package/dist/core/code/engine/core/ingestion/languages/rust/range-binding.js +687 -0
  397. package/dist/core/code/engine/core/ingestion/languages/rust/receiver-binding.js +148 -0
  398. package/dist/core/code/engine/core/ingestion/languages/rust/scope-resolver.js +151 -0
  399. package/dist/core/code/engine/core/ingestion/languages/rust/simple-hooks.js +32 -0
  400. package/dist/core/code/engine/core/ingestion/languages/rust.js +183 -0
  401. package/dist/core/code/engine/core/ingestion/languages/swift/arity-metadata.js +44 -0
  402. package/dist/core/code/engine/core/ingestion/languages/swift/arity.js +45 -0
  403. package/dist/core/code/engine/core/ingestion/languages/swift/base-type.js +30 -0
  404. package/dist/core/code/engine/core/ingestion/languages/swift/cache-stats.js +32 -0
  405. package/dist/core/code/engine/core/ingestion/languages/swift/captures.js +594 -0
  406. package/dist/core/code/engine/core/ingestion/languages/swift/conditional-directive-preprocess.js +256 -0
  407. package/dist/core/code/engine/core/ingestion/languages/swift/implicit-imports.js +60 -0
  408. package/dist/core/code/engine/core/ingestion/languages/swift/import-decomposer.js +87 -0
  409. package/dist/core/code/engine/core/ingestion/languages/swift/import-target.js +84 -0
  410. package/dist/core/code/engine/core/ingestion/languages/swift/index.js +56 -0
  411. package/dist/core/code/engine/core/ingestion/languages/swift/interpret.js +93 -0
  412. package/dist/core/code/engine/core/ingestion/languages/swift/merge-bindings.js +51 -0
  413. package/dist/core/code/engine/core/ingestion/languages/swift/query.js +226 -0
  414. package/dist/core/code/engine/core/ingestion/languages/swift/receiver-binding.js +169 -0
  415. package/dist/core/code/engine/core/ingestion/languages/swift/scope-resolver.js +192 -0
  416. package/dist/core/code/engine/core/ingestion/languages/swift/sibling-type-bindings.js +68 -0
  417. package/dist/core/code/engine/core/ingestion/languages/swift/signature-bindings.js +69 -0
  418. package/dist/core/code/engine/core/ingestion/languages/swift/simple-hooks.js +65 -0
  419. package/dist/core/code/engine/core/ingestion/languages/swift/target-grouping.js +97 -0
  420. package/dist/core/code/engine/core/ingestion/languages/swift/target-siblings.js +74 -0
  421. package/dist/core/code/engine/core/ingestion/languages/swift.js +246 -0
  422. package/dist/core/code/engine/core/ingestion/languages/typescript/arity-metadata.js +106 -0
  423. package/dist/core/code/engine/core/ingestion/languages/typescript/arity.js +57 -0
  424. package/dist/core/code/engine/core/ingestion/languages/typescript/array-callback.js +58 -0
  425. package/dist/core/code/engine/core/ingestion/languages/typescript/cache-stats.js +34 -0
  426. package/dist/core/code/engine/core/ingestion/languages/typescript/captures.js +956 -0
  427. package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-export-assignment.js +535 -0
  428. package/dist/core/code/engine/core/ingestion/languages/typescript/cjs-module-exports.js +196 -0
  429. package/dist/core/code/engine/core/ingestion/languages/typescript/import-decomposer.js +374 -0
  430. package/dist/core/code/engine/core/ingestion/languages/typescript/import-target.js +65 -0
  431. package/dist/core/code/engine/core/ingestion/languages/typescript/index.js +108 -0
  432. package/dist/core/code/engine/core/ingestion/languages/typescript/interpret.js +344 -0
  433. package/dist/core/code/engine/core/ingestion/languages/typescript/merge-bindings.js +161 -0
  434. package/dist/core/code/engine/core/ingestion/languages/typescript/nuxt-auto-imports.js +325 -0
  435. package/dist/core/code/engine/core/ingestion/languages/typescript/query.js +1328 -0
  436. package/dist/core/code/engine/core/ingestion/languages/typescript/receiver-binding.js +201 -0
  437. package/dist/core/code/engine/core/ingestion/languages/typescript/scope-resolver.js +293 -0
  438. package/dist/core/code/engine/core/ingestion/languages/typescript/simple-hooks.js +139 -0
  439. package/dist/core/code/engine/core/ingestion/languages/typescript.js +455 -0
  440. package/dist/core/code/engine/core/ingestion/languages/vue/captures.js +70 -0
  441. package/dist/core/code/engine/core/ingestion/languages/vue/import-target.js +61 -0
  442. package/dist/core/code/engine/core/ingestion/languages/vue/index.js +55 -0
  443. package/dist/core/code/engine/core/ingestion/languages/vue/scope-resolver.js +295 -0
  444. package/dist/core/code/engine/core/ingestion/languages/vue.js +96 -0
  445. package/dist/core/code/engine/core/ingestion/local-symbol-pruner.js +68 -0
  446. package/dist/core/code/engine/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
  447. package/dist/core/code/engine/core/ingestion/method-extractors/configs/csharp.js +290 -0
  448. package/dist/core/code/engine/core/ingestion/method-extractors/configs/dart.js +392 -0
  449. package/dist/core/code/engine/core/ingestion/method-extractors/configs/go.js +179 -0
  450. package/dist/core/code/engine/core/ingestion/method-extractors/configs/jvm.js +350 -0
  451. package/dist/core/code/engine/core/ingestion/method-extractors/configs/php.js +306 -0
  452. package/dist/core/code/engine/core/ingestion/method-extractors/configs/python.js +312 -0
  453. package/dist/core/code/engine/core/ingestion/method-extractors/configs/ruby.js +289 -0
  454. package/dist/core/code/engine/core/ingestion/method-extractors/configs/rust.js +198 -0
  455. package/dist/core/code/engine/core/ingestion/method-extractors/configs/swift.js +286 -0
  456. package/dist/core/code/engine/core/ingestion/method-extractors/configs/typescript-javascript.js +341 -0
  457. package/dist/core/code/engine/core/ingestion/method-extractors/generic.js +209 -0
  458. package/dist/core/code/engine/core/ingestion/method-types.js +3 -0
  459. package/dist/core/code/engine/core/ingestion/model/field-registry.js +41 -0
  460. package/dist/core/code/engine/core/ingestion/model/index.js +52 -0
  461. package/dist/core/code/engine/core/ingestion/model/method-registry.js +138 -0
  462. package/dist/core/code/engine/core/ingestion/model/owned-members-lookup.js +46 -0
  463. package/dist/core/code/engine/core/ingestion/model/registration-table.js +234 -0
  464. package/dist/core/code/engine/core/ingestion/model/resolve.js +183 -0
  465. package/dist/core/code/engine/core/ingestion/model/scope-resolution-indexes.js +43 -0
  466. package/dist/core/code/engine/core/ingestion/model/semantic-model.js +179 -0
  467. package/dist/core/code/engine/core/ingestion/model/symbol-table.js +216 -0
  468. package/dist/core/code/engine/core/ingestion/model/type-registry.js +84 -0
  469. package/dist/core/code/engine/core/ingestion/mro-processor.js +709 -0
  470. package/dist/core/code/engine/core/ingestion/parsing-processor.js +312 -0
  471. package/dist/core/code/engine/core/ingestion/pipeline-phases/communities.js +69 -0
  472. package/dist/core/code/engine/core/ingestion/pipeline-phases/cross-file.js +71 -0
  473. package/dist/core/code/engine/core/ingestion/pipeline-phases/di.js +338 -0
  474. package/dist/core/code/engine/core/ingestion/pipeline-phases/http-api-calls.js +312 -0
  475. package/dist/core/code/engine/core/ingestion/pipeline-phases/index.js +54 -0
  476. package/dist/core/code/engine/core/ingestion/pipeline-phases/mro.js +40 -0
  477. package/dist/core/code/engine/core/ingestion/pipeline-phases/orm.js +78 -0
  478. package/dist/core/code/engine/core/ingestion/pipeline-phases/parse-impl.js +1286 -0
  479. package/dist/core/code/engine/core/ingestion/pipeline-phases/parse.js +41 -0
  480. package/dist/core/code/engine/core/ingestion/pipeline-phases/processes.js +193 -0
  481. package/dist/core/code/engine/core/ingestion/pipeline-phases/prune-local-symbols.js +29 -0
  482. package/dist/core/code/engine/core/ingestion/pipeline-phases/registry.js +52 -0
  483. package/dist/core/code/engine/core/ingestion/pipeline-phases/routes.js +409 -0
  484. package/dist/core/code/engine/core/ingestion/pipeline-phases/rpc-edges.js +301 -0
  485. package/dist/core/code/engine/core/ingestion/pipeline-phases/runner.js +207 -0
  486. package/dist/core/code/engine/core/ingestion/pipeline-phases/scan.js +49 -0
  487. package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-aop.js +442 -0
  488. package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-auto-configuration.js +264 -0
  489. package/dist/core/code/engine/core/ingestion/pipeline-phases/spring-config.js +440 -0
  490. package/dist/core/code/engine/core/ingestion/pipeline-phases/structure.js +38 -0
  491. package/dist/core/code/engine/core/ingestion/pipeline-phases/tools.js +89 -0
  492. package/dist/core/code/engine/core/ingestion/pipeline-phases/types.js +40 -0
  493. package/dist/core/code/engine/core/ingestion/pipeline.js +152 -0
  494. package/dist/core/code/engine/core/ingestion/process-processor.js +325 -0
  495. package/dist/core/code/engine/core/ingestion/resolve-references.js +205 -0
  496. package/dist/core/code/engine/core/ingestion/route-extractors/constant-resolver.js +135 -0
  497. package/dist/core/code/engine/core/ingestion/route-extractors/django-root-discovery.js +221 -0
  498. package/dist/core/code/engine/core/ingestion/route-extractors/django.js +428 -0
  499. package/dist/core/code/engine/core/ingestion/route-extractors/expo.js +39 -0
  500. package/dist/core/code/engine/core/ingestion/route-extractors/fastapi-router-bindings.js +264 -0
  501. package/dist/core/code/engine/core/ingestion/route-extractors/laravel.js +501 -0
  502. package/dist/core/code/engine/core/ingestion/route-extractors/middleware.js +175 -0
  503. package/dist/core/code/engine/core/ingestion/route-extractors/nextjs.js +81 -0
  504. package/dist/core/code/engine/core/ingestion/route-extractors/php.js +25 -0
  505. package/dist/core/code/engine/core/ingestion/route-extractors/python-const-resolver.js +307 -0
  506. package/dist/core/code/engine/core/ingestion/route-extractors/response-shapes.js +299 -0
  507. package/dist/core/code/engine/core/ingestion/route-extractors/route-path.js +71 -0
  508. package/dist/core/code/engine/core/ingestion/route-extractors/spring-shared.js +310 -0
  509. package/dist/core/code/engine/core/ingestion/route-extractors/spring.js +441 -0
  510. package/dist/core/code/engine/core/ingestion/scope-extractor-bridge.js +60 -0
  511. package/dist/core/code/engine/core/ingestion/scope-extractor.js +1373 -0
  512. package/dist/core/code/engine/core/ingestion/scope-resolution/contract/scope-resolver.js +282 -0
  513. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +72 -0
  514. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/edges.js +194 -0
  515. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/ids.js +472 -0
  516. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +49 -0
  517. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +43 -0
  518. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +274 -0
  519. package/dist/core/code/engine/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +93 -0
  520. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/callable-value-flow.js +1240 -0
  521. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/compound-receiver.js +1174 -0
  522. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/free-call-fallback.js +873 -0
  523. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/imported-return-types.js +226 -0
  524. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/mro.js +107 -0
  525. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/overload-narrowing.js +441 -0
  526. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/property-dispatch.js +122 -0
  527. package/dist/core/code/engine/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1720 -0
  528. package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/phase.js +395 -0
  529. package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +208 -0
  530. package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/registry.js +49 -0
  531. package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/run.js +632 -0
  532. package/dist/core/code/engine/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +112 -0
  533. package/dist/core/code/engine/core/ingestion/scope-resolution/resolution-outcome.js +41 -0
  534. package/dist/core/code/engine/core/ingestion/scope-resolution/scope/namespace-targets.js +81 -0
  535. package/dist/core/code/engine/core/ingestion/scope-resolution/scope/walkers.js +1835 -0
  536. package/dist/core/code/engine/core/ingestion/scope-resolution/unresolved-receivers.js +242 -0
  537. package/dist/core/code/engine/core/ingestion/scope-resolution/utils/definition-id.js +22 -0
  538. package/dist/core/code/engine/core/ingestion/scope-resolution/workspace-index.js +151 -0
  539. package/dist/core/code/engine/core/ingestion/structure-processor.js +40 -0
  540. package/dist/core/code/engine/core/ingestion/tree-sitter-queries.js +2244 -0
  541. package/dist/core/code/engine/core/ingestion/ts-js-hoc-utils.js +115 -0
  542. package/dist/core/code/engine/core/ingestion/type-env.js +1136 -0
  543. package/dist/core/code/engine/core/ingestion/type-extractors/c-cpp.js +555 -0
  544. package/dist/core/code/engine/core/ingestion/type-extractors/csharp.js +570 -0
  545. package/dist/core/code/engine/core/ingestion/type-extractors/dart.js +372 -0
  546. package/dist/core/code/engine/core/ingestion/type-extractors/go.js +508 -0
  547. package/dist/core/code/engine/core/ingestion/type-extractors/jvm.js +875 -0
  548. package/dist/core/code/engine/core/ingestion/type-extractors/php.js +537 -0
  549. package/dist/core/code/engine/core/ingestion/type-extractors/python.js +477 -0
  550. package/dist/core/code/engine/core/ingestion/type-extractors/ruby.js +380 -0
  551. package/dist/core/code/engine/core/ingestion/type-extractors/rust.js +502 -0
  552. package/dist/core/code/engine/core/ingestion/type-extractors/shared.js +843 -0
  553. package/dist/core/code/engine/core/ingestion/type-extractors/swift.js +490 -0
  554. package/dist/core/code/engine/core/ingestion/type-extractors/types.js +2 -0
  555. package/dist/core/code/engine/core/ingestion/type-extractors/typescript.js +690 -0
  556. package/dist/core/code/engine/core/ingestion/utils/ast-helpers.js +1693 -0
  557. package/dist/core/code/engine/core/ingestion/utils/call-analysis.js +779 -0
  558. package/dist/core/code/engine/core/ingestion/utils/callable-flow-captures.js +932 -0
  559. package/dist/core/code/engine/core/ingestion/utils/callable-labels.js +49 -0
  560. package/dist/core/code/engine/core/ingestion/utils/deferred-resolution-profile.js +151 -0
  561. package/dist/core/code/engine/core/ingestion/utils/effective-ram.js +67 -0
  562. package/dist/core/code/engine/core/ingestion/utils/env.js +60 -0
  563. package/dist/core/code/engine/core/ingestion/utils/event-loop.js +9 -0
  564. package/dist/core/code/engine/core/ingestion/utils/graph-sort.js +103 -0
  565. package/dist/core/code/engine/core/ingestion/utils/heap-probe.js +45 -0
  566. package/dist/core/code/engine/core/ingestion/utils/heritage-marker.js +47 -0
  567. package/dist/core/code/engine/core/ingestion/utils/line-base.js +24 -0
  568. package/dist/core/code/engine/core/ingestion/utils/max-file-size.js +59 -0
  569. package/dist/core/code/engine/core/ingestion/utils/method-props.js +198 -0
  570. package/dist/core/code/engine/core/ingestion/utils/qualified-name.js +73 -0
  571. package/dist/core/code/engine/core/ingestion/utils/receiver-chain-captures.js +60 -0
  572. package/dist/core/code/engine/core/ingestion/utils/receiver-chain-codec.js +188 -0
  573. package/dist/core/code/engine/core/ingestion/utils/scope-tree-walk.js +36 -0
  574. package/dist/core/code/engine/core/ingestion/utils/symbol-labels.js +48 -0
  575. package/dist/core/code/engine/core/ingestion/utils/template-arguments.js +187 -0
  576. package/dist/core/code/engine/core/ingestion/utils/type-parameters.js +209 -0
  577. package/dist/core/code/engine/core/ingestion/utils/verbose.js +6 -0
  578. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/c-cpp.js +133 -0
  579. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/csharp.js +66 -0
  580. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/dart.js +111 -0
  581. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/go.js +153 -0
  582. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/jvm.js +145 -0
  583. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/php.js +61 -0
  584. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/python.js +104 -0
  585. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/ruby.js +55 -0
  586. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/rust.js +79 -0
  587. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/swift.js +91 -0
  588. package/dist/core/code/engine/core/ingestion/variable-extractors/configs/typescript-javascript.js +86 -0
  589. package/dist/core/code/engine/core/ingestion/variable-extractors/generic.js +111 -0
  590. package/dist/core/code/engine/core/ingestion/variable-types.js +3 -0
  591. package/dist/core/code/engine/core/ingestion/vue-sfc-extractor.js +544 -0
  592. package/dist/core/code/engine/core/ingestion/workers/callable-id.js +122 -0
  593. package/dist/core/code/engine/core/ingestion/workers/clone-safety.js +470 -0
  594. package/dist/core/code/engine/core/ingestion/workers/parse-worker.js +2456 -0
  595. package/dist/core/code/engine/core/ingestion/workers/post-result.js +90 -0
  596. package/dist/core/code/engine/core/ingestion/workers/quarantine.js +41 -0
  597. package/dist/core/code/engine/core/ingestion/workers/result-merge.js +59 -0
  598. package/dist/core/code/engine/core/ingestion/workers/worker-pool.js +1725 -0
  599. package/dist/core/code/engine/core/ingestion/workspace-config.js +139 -0
  600. package/dist/core/code/engine/core/lbug/conn-lock.js +72 -0
  601. package/dist/core/code/engine/core/lbug/csv-generator.js +710 -0
  602. package/dist/core/code/engine/core/lbug/cypher-escape.js +24 -0
  603. package/dist/core/code/engine/core/lbug/extension-load-error.js +339 -0
  604. package/dist/core/code/engine/core/lbug/extension-loader.js +261 -0
  605. package/dist/core/code/engine/core/lbug/graph-emit-sink.js +584 -0
  606. package/dist/core/code/engine/core/lbug/lbug-adapter.js +2703 -0
  607. package/dist/core/code/engine/core/lbug/lbug-config.js +1029 -0
  608. package/dist/core/code/engine/core/lbug/native-check.js +435 -0
  609. package/dist/core/code/engine/core/lbug/pool-adapter.js +973 -0
  610. package/dist/core/code/engine/core/lbug/query-params.js +25 -0
  611. package/dist/core/code/engine/core/lbug/query-result-utils.js +31 -0
  612. package/dist/core/code/engine/core/lbug/rel-pair-routing.js +373 -0
  613. package/dist/core/code/engine/core/lbug/schema.js +771 -0
  614. package/dist/core/code/engine/core/lbug/shutdown-helpers.js +40 -0
  615. package/dist/core/code/engine/core/lbug/sidecar-recovery.js +716 -0
  616. package/dist/core/code/engine/core/lbug/stdio-capture.js +49 -0
  617. package/dist/core/code/engine/core/lbug/sync-csv-writer.js +115 -0
  618. package/dist/core/code/engine/core/lbug/wal-checkpoint-driver.js +215 -0
  619. package/dist/core/code/engine/core/lbug/wal-driver-state.js +28 -0
  620. package/dist/core/code/engine/core/logger.js +339 -0
  621. package/dist/core/code/engine/core/platform/capabilities.js +91 -0
  622. package/dist/core/code/engine/core/run-analyze.js +1098 -0
  623. package/dist/core/code/engine/core/tree-sitter/parser-loader.js +281 -0
  624. package/dist/core/code/engine/core/tree-sitter/safe-parse.js +258 -0
  625. package/dist/core/code/engine/core/tree-sitter/vendored-grammars.js +64 -0
  626. package/dist/core/code/engine/lib/utils.js +121 -0
  627. package/dist/core/code/engine/mcp/core/lbug-adapter.js +27 -0
  628. package/dist/core/code/engine/mcp/local/aop-metadata.js +230 -0
  629. package/dist/core/code/engine/mcp/local/bean-metadata.js +49 -0
  630. package/dist/core/code/engine/mcp/local/limits.js +15 -0
  631. package/dist/core/code/engine/mcp/local/line-display.js +6 -0
  632. package/dist/core/code/engine/mcp/local/local-backend.js +4142 -0
  633. package/dist/core/code/engine/storage/branch-index.js +72 -0
  634. package/dist/core/code/engine/storage/file-hash.js +95 -0
  635. package/dist/core/code/engine/storage/fs-atomic.js +34 -0
  636. package/dist/core/code/engine/storage/git.js +555 -0
  637. package/dist/core/code/engine/storage/index-lock.js +664 -0
  638. package/dist/core/code/engine/storage/parse-cache.js +650 -0
  639. package/dist/core/code/engine/storage/parsedfile-store.js +620 -0
  640. package/dist/core/code/engine/storage/repo-manager.js +1061 -0
  641. package/dist/core/code/engine/storage/scope-index-store.js +247 -0
  642. package/dist/core/code/engine/types/pipeline.js +2 -0
  643. package/dist/core/code/scripts/install-duckdb-extension.mjs +125 -0
  644. package/dist/core/code/scripts/resolve-analyze-cmd.cjs +346 -0
  645. package/dist/core/code/shared/graph/types.js +8 -0
  646. package/dist/core/code/shared/index.js +105 -0
  647. package/dist/core/code/shared/integrations/circuit-breaker.js +242 -0
  648. package/dist/core/code/shared/integrations/resilient-fetch.js +224 -0
  649. package/dist/core/code/shared/integrations/retry.js +70 -0
  650. package/dist/core/code/shared/integrations/understand-quickly.js +145 -0
  651. package/dist/core/code/shared/language-detection.js +162 -0
  652. package/dist/core/code/shared/languages.js +27 -0
  653. package/dist/core/code/shared/lbug/schema-constants.js +98 -0
  654. package/dist/core/code/shared/mro-strategy.js +2 -0
  655. package/dist/core/code/shared/pipeline.js +5 -0
  656. package/dist/core/code/shared/scope-resolution/callable-flow-site.js +11 -0
  657. package/dist/core/code/shared/scope-resolution/def-index.js +53 -0
  658. package/dist/core/code/shared/scope-resolution/evidence-weights.js +87 -0
  659. package/dist/core/code/shared/scope-resolution/finalize-algorithm.js +807 -0
  660. package/dist/core/code/shared/scope-resolution/language-classification.js +46 -0
  661. package/dist/core/code/shared/scope-resolution/method-dispatch-index.js +100 -0
  662. package/dist/core/code/shared/scope-resolution/module-scope-index.js +59 -0
  663. package/dist/core/code/shared/scope-resolution/origin-priority.js +23 -0
  664. package/dist/core/code/shared/scope-resolution/parsed-file.js +54 -0
  665. package/dist/core/code/shared/scope-resolution/position-index.js +136 -0
  666. package/dist/core/code/shared/scope-resolution/qualified-name-index.js +77 -0
  667. package/dist/core/code/shared/scope-resolution/reference-site.js +24 -0
  668. package/dist/core/code/shared/scope-resolution/registries/class-registry.js +32 -0
  669. package/dist/core/code/shared/scope-resolution/registries/context.js +52 -0
  670. package/dist/core/code/shared/scope-resolution/registries/evidence.js +152 -0
  671. package/dist/core/code/shared/scope-resolution/registries/field-registry.js +33 -0
  672. package/dist/core/code/shared/scope-resolution/registries/lookup-core.js +392 -0
  673. package/dist/core/code/shared/scope-resolution/registries/lookup-qualified.js +58 -0
  674. package/dist/core/code/shared/scope-resolution/registries/macro-registry.js +34 -0
  675. package/dist/core/code/shared/scope-resolution/registries/method-registry.js +34 -0
  676. package/dist/core/code/shared/scope-resolution/registries/tie-breaks.js +63 -0
  677. package/dist/core/code/shared/scope-resolution/resolve-type-ref.js +128 -0
  678. package/dist/core/code/shared/scope-resolution/scope-id.js +49 -0
  679. package/dist/core/code/shared/scope-resolution/scope-tree.js +225 -0
  680. package/dist/core/code/shared/scope-resolution/symbol-definition.js +12 -0
  681. package/dist/core/code/shared/scope-resolution/types.js +25 -0
  682. package/dist/core/code/shared/test-helpers.js +17 -0
  683. package/dist/core/code/vendor/leiden/index.cjs +355 -0
  684. package/dist/core/code/vendor/leiden/utils.cjs +419 -0
  685. package/dist/core/dbquery/cli.d.ts.map +1 -1
  686. package/dist/core/dbquery/cli.js +5 -4
  687. package/dist/core/dbquery/cli.js.map +1 -1
  688. package/dist/core/dbquery/config.d.ts.map +1 -1
  689. package/dist/core/dbquery/config.js +39 -3
  690. package/dist/core/dbquery/config.js.map +1 -1
  691. package/dist/core/dbquery/drivers/http.d.ts +23 -0
  692. package/dist/core/dbquery/drivers/http.d.ts.map +1 -0
  693. package/dist/core/dbquery/drivers/http.js +125 -0
  694. package/dist/core/dbquery/drivers/http.js.map +1 -0
  695. package/dist/core/dbquery/drivers/mysql.js +1 -1
  696. package/dist/core/dbquery/drivers/mysql.js.map +1 -1
  697. package/dist/core/dbquery/drivers/postgres.js +1 -1
  698. package/dist/core/dbquery/drivers/postgres.js.map +1 -1
  699. package/dist/core/dbquery/executor.d.ts.map +1 -1
  700. package/dist/core/dbquery/executor.js +46 -12
  701. package/dist/core/dbquery/executor.js.map +1 -1
  702. package/dist/core/dbquery/format.d.ts.map +1 -1
  703. package/dist/core/dbquery/format.js +2 -1
  704. package/dist/core/dbquery/format.js.map +1 -1
  705. package/dist/core/dbquery/init.d.ts.map +1 -1
  706. package/dist/core/dbquery/init.js +7 -0
  707. package/dist/core/dbquery/init.js.map +1 -1
  708. package/dist/core/dbquery/types.d.ts +55 -7
  709. package/dist/core/dbquery/types.d.ts.map +1 -1
  710. package/dist/core/directory.d.ts +17 -0
  711. package/dist/core/directory.d.ts.map +1 -1
  712. package/dist/core/directory.js +37 -0
  713. package/dist/core/directory.js.map +1 -1
  714. package/dist/core/features/cli.d.ts.map +1 -1
  715. package/dist/core/features/cli.js +3 -2
  716. package/dist/core/features/cli.js.map +1 -1
  717. package/dist/core/features/scanner.d.ts +1 -1
  718. package/dist/core/features/scanner.d.ts.map +1 -1
  719. package/dist/core/features/scanner.js +20 -4
  720. package/dist/core/features/scanner.js.map +1 -1
  721. package/dist/core/markdown/cli.d.ts.map +1 -1
  722. package/dist/core/markdown/cli.js +9 -8
  723. package/dist/core/markdown/cli.js.map +1 -1
  724. package/dist/core/timeline/cli.d.ts.map +1 -1
  725. package/dist/core/timeline/cli.js +13 -6
  726. package/dist/core/timeline/cli.js.map +1 -1
  727. package/dist/core/timeline/debris.d.ts +20 -0
  728. package/dist/core/timeline/debris.d.ts.map +1 -0
  729. package/dist/core/timeline/debris.js +124 -0
  730. package/dist/core/timeline/debris.js.map +1 -0
  731. package/dist/core/timeline/hook-runner.d.ts.map +1 -1
  732. package/dist/core/timeline/hook-runner.js +3 -1
  733. package/dist/core/timeline/hook-runner.js.map +1 -1
  734. package/dist/core/timeline/hooks.d.ts.map +1 -1
  735. package/dist/core/timeline/hooks.js +13 -5
  736. package/dist/core/timeline/hooks.js.map +1 -1
  737. package/dist/core/timeline/installer.d.ts +2 -0
  738. package/dist/core/timeline/installer.d.ts.map +1 -1
  739. package/dist/core/timeline/installer.js +12 -0
  740. package/dist/core/timeline/installer.js.map +1 -1
  741. package/dist/core/timeline/project-root.d.ts +21 -0
  742. package/dist/core/timeline/project-root.d.ts.map +1 -0
  743. package/dist/core/timeline/project-root.js +83 -0
  744. package/dist/core/timeline/project-root.js.map +1 -0
  745. package/dist/web/register.d.ts.map +1 -1
  746. package/dist/web/register.js +2 -1
  747. package/dist/web/register.js.map +1 -1
  748. package/package.json +1 -1
  749. package/dist/.claude-template/.cgraphx/timeline-current-turn.json +0 -1
  750. package/dist/.claude-template/skills/.cgraphx/timeline-current-turn.json +0 -1
  751. package/dist/.claude-template/skills/handdrawn-deck/.cgraphx/timeline-current-turn.json +0 -1
  752. package/dist/.claude-template/skills/handdrawn-deck/references/.cgraphx/timeline-current-turn.json +0 -1
  753. package/dist/.claude-template/skills/handdrawn-sketch-engine/.cgraphx/timeline-current-turn.json +0 -1
  754. /package/dist/.claude-template/skills/run-api-test/assets/{template-test-verify.jsonl → template-/346/216/245/345/217/243/346/265/213/350/257/225/351/252/214/350/257/201.jsonl"} +0 -0
@@ -0,0 +1,2244 @@
1
+ "use strict";
2
+ /*
3
+ * Tree-sitter queries for extracting code definitions.
4
+ *
5
+ * Note: Different grammars (typescript vs tsx vs javascript) may have
6
+ * slightly different node types. These queries are designed to be
7
+ * compatible with the standard tree-sitter grammars.
8
+ *
9
+ * Heritage (extends/implements/embed/trait) is NOT captured here. The legacy
10
+ * heritage-capture leg was removed (issue #942); inheritance edges are
11
+ * produced by the registry-primary scope-resolution path, which synthesizes
12
+ * `@reference.inherits` captures in each language's `languages/<lang>/captures.ts`.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.LANGUAGE_QUERIES = exports.DART_QUERIES = exports.SWIFT_QUERIES = exports.KOTLIN_QUERIES = exports.RUBY_QUERIES = exports.PHP_QUERIES = exports.RUST_QUERIES = exports.CSHARP_QUERIES = exports.CPP_QUERIES = exports.GO_QUERIES = exports.C_QUERIES = exports.JAVA_QUERIES = exports.PYTHON_QUERIES = exports.JAVASCRIPT_QUERIES = exports.TYPESCRIPT_QUERIES = void 0;
16
+ const ts_js_hoc_utils_js_1 = require("./ts-js-hoc-utils.js");
17
+ // TypeScript queries - works with tree-sitter-typescript
18
+ exports.TYPESCRIPT_QUERIES = `
19
+ (class_declaration
20
+ name: (type_identifier) @name) @definition.class
21
+
22
+ (abstract_class_declaration
23
+ name: (type_identifier) @name) @definition.class
24
+
25
+ (interface_declaration
26
+ name: (type_identifier) @name) @definition.interface
27
+
28
+ (function_declaration
29
+ name: (identifier) @name) @definition.function
30
+
31
+ (generator_function_declaration
32
+ name: (identifier) @name) @definition.function
33
+
34
+ ; TypeScript overload signatures (function_signature is a separate node type from function_declaration)
35
+ (function_signature
36
+ name: (identifier) @name) @definition.function
37
+
38
+ (method_definition
39
+ name: (property_identifier) @name) @definition.method
40
+
41
+ ; ES2022 #private methods (private_property_identifier not matched by property_identifier)
42
+ (method_definition
43
+ name: (private_property_identifier) @name) @definition.method
44
+
45
+ ; Abstract method signatures in abstract classes
46
+ (abstract_method_signature
47
+ name: (property_identifier) @name) @definition.method
48
+
49
+ ; Interface method signatures
50
+ (method_signature
51
+ name: (property_identifier) @name) @definition.method
52
+
53
+ (lexical_declaration
54
+ (variable_declarator
55
+ name: (identifier) @name
56
+ value: (arrow_function))) @definition.function
57
+
58
+ (lexical_declaration
59
+ (variable_declarator
60
+ name: (identifier) @name
61
+ value: (function_expression))) @definition.function
62
+
63
+ ; Generator EXPRESSIONS bound to a name (\`const g = function* () {}\`). Without
64
+ ; these, the binding emitted a \`Const\` node rather than a \`Function\` one, so
65
+ ; \`g()\` resolved to nothing: \`buildGraphTargetIndex\` only admits a callable
66
+ ; node. Same construct and same binding semantics as the \`function_expression\`
67
+ ; rules directly above, so same label. Covers the four variable-binding shapes
68
+ ; (const/let and var, each plain and exported); a generator in an object-literal
69
+ ; pair or a HOC wrapper is NOT covered and still falls through anonymous.
70
+ (lexical_declaration
71
+ (variable_declarator
72
+ name: (identifier) @name
73
+ value: (generator_function))) @definition.function
74
+
75
+ (export_statement
76
+ declaration: (lexical_declaration
77
+ (variable_declarator
78
+ name: (identifier) @name
79
+ value: (arrow_function)))) @definition.function
80
+
81
+ (export_statement
82
+ declaration: (lexical_declaration
83
+ (variable_declarator
84
+ name: (identifier) @name
85
+ value: (function_expression)))) @definition.function
86
+
87
+ (export_statement
88
+ declaration: (lexical_declaration
89
+ (variable_declarator
90
+ name: (identifier) @name
91
+ value: (generator_function)))) @definition.function
92
+
93
+ ; \`var\` closure bindings (#2693). The lexical rules above cover const/let;
94
+ ; \`var\` is a different grammar node, so \`var f = (x) => x\` kept a Variable
95
+ ; label while const/let got Function — and the CALLS edge that resolved through
96
+ ; the declaration route therefore pointed at a NON-callable node. Same construct,
97
+ ; same binding semantics for this purpose, so same label.
98
+ (variable_declaration
99
+ (variable_declarator
100
+ name: (identifier) @name
101
+ value: (arrow_function))) @definition.function
102
+
103
+ (variable_declaration
104
+ (variable_declarator
105
+ name: (identifier) @name
106
+ value: (function_expression))) @definition.function
107
+
108
+ (variable_declaration
109
+ (variable_declarator
110
+ name: (identifier) @name
111
+ value: (generator_function))) @definition.function
112
+
113
+ (export_statement
114
+ declaration: (variable_declaration
115
+ (variable_declarator
116
+ name: (identifier) @name
117
+ value: (arrow_function)))) @definition.function
118
+
119
+ (export_statement
120
+ declaration: (variable_declaration
121
+ (variable_declarator
122
+ name: (identifier) @name
123
+ value: (function_expression)))) @definition.function
124
+
125
+ (export_statement
126
+ declaration: (variable_declaration
127
+ (variable_declarator
128
+ name: (identifier) @name
129
+ value: (generator_function)))) @definition.function
130
+
131
+ ; Object-property arrows / function expressions: \`{ addItem: () => ... }\`.
132
+ ; The pair's key field carries the meaningful name. Without these patterns,
133
+ ; calls inside the arrow are attributed to the file (issue #1166), and the
134
+ ; arrow itself is invisible to context() / impact() despite carrying real
135
+ ; behaviour (Zustand actions, TanStack queryFn, React Context providers).
136
+ ; String-key variant covers \`"add-item": () => ...\`; computed keys
137
+ ; (\`[K]: () => ...\`) intentionally fall through anonymous.
138
+ (pair
139
+ key: (property_identifier) @name
140
+ value: (arrow_function)) @definition.function
141
+
142
+ (pair
143
+ key: (property_identifier) @name
144
+ value: (function_expression)) @definition.function
145
+
146
+ (pair
147
+ key: (string (string_fragment) @name)
148
+ value: (arrow_function)) @definition.function
149
+
150
+ (pair
151
+ key: (string (string_fragment) @name)
152
+ value: (function_expression)) @definition.function
153
+
154
+ ; HOC-wrapped variable declarations: \`const X = HOC((args) => { ... })\`.
155
+ ; Mirrors the registry-primary patterns in \`languages/typescript/query.ts\`
156
+ ; so the legacy Call-Resolution DAG and the registry-primary pipeline
157
+ ; produce the same set of \`Function\` nodes — required for the CI parity
158
+ ; gate. Covers React.forwardRef / memo / useCallback / useMemo / observer
159
+ ; / debounce / user-defined HOC factories. The \`var X = HOC(...)\` form is
160
+ ; mirrored too (registry-primary has it) so that codebases mixing \`var\` and
161
+ ; \`const\` see identical attribution on both pipelines. See
162
+ ; \`tsExtractFunctionName\` for the resolution logic and the \`query.ts\`
163
+ ; comment for the full anchor-discipline rationale and the chained-
164
+ ; array-method trade-off.
165
+ ;
166
+ ; NOTE: Excludes member-expression calls to common array methods (map, filter,
167
+ ; reduce, etc.) to avoid false positives like \`const x = arr.map(a => ...)\`
168
+ ; being classified as a Function when it's actually a Const holding an array.
169
+ ; Direct identifier calls and member expressions on non-array-methods (like
170
+ ; React.memo) are still matched.
171
+ (lexical_declaration
172
+ (variable_declarator
173
+ name: (identifier) @name
174
+ value: (call_expression
175
+ function: (identifier)
176
+ arguments: (arguments
177
+ (arrow_function))))) @definition.function
178
+
179
+ (lexical_declaration
180
+ (variable_declarator
181
+ name: (identifier) @name
182
+ value: (call_expression
183
+ function: (identifier)
184
+ arguments: (arguments
185
+ (function_expression))))) @definition.function
186
+
187
+ (lexical_declaration
188
+ (variable_declarator
189
+ name: (identifier) @name
190
+ value: (call_expression
191
+ function: (member_expression
192
+ property: (property_identifier) @callee)
193
+ arguments: (arguments
194
+ (arrow_function))))
195
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
196
+
197
+ (lexical_declaration
198
+ (variable_declarator
199
+ name: (identifier) @name
200
+ value: (call_expression
201
+ function: (member_expression
202
+ property: (property_identifier) @callee)
203
+ arguments: (arguments
204
+ (function_expression))))
205
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
206
+
207
+ (export_statement
208
+ declaration: (lexical_declaration
209
+ (variable_declarator
210
+ name: (identifier) @name
211
+ value: (call_expression
212
+ function: (identifier)
213
+ arguments: (arguments
214
+ (arrow_function)))))) @definition.function
215
+
216
+ (export_statement
217
+ declaration: (lexical_declaration
218
+ (variable_declarator
219
+ name: (identifier) @name
220
+ value: (call_expression
221
+ function: (identifier)
222
+ arguments: (arguments
223
+ (function_expression)))))) @definition.function
224
+
225
+ (export_statement
226
+ declaration: (lexical_declaration
227
+ (variable_declarator
228
+ name: (identifier) @name
229
+ value: (call_expression
230
+ function: (member_expression
231
+ property: (property_identifier) @callee)
232
+ arguments: (arguments
233
+ (arrow_function)))))
234
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
235
+
236
+ (export_statement
237
+ declaration: (lexical_declaration
238
+ (variable_declarator
239
+ name: (identifier) @name
240
+ value: (call_expression
241
+ function: (member_expression
242
+ property: (property_identifier) @callee)
243
+ arguments: (arguments
244
+ (function_expression)))))
245
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
246
+
247
+ ; \`var X = HOC(...)\` parity with registry-primary. Legacy code (and any
248
+ ; transpiler output that downlevels \`const\` to \`var\`) hits this shape.
249
+ ; Same array-method exclusions as const/let patterns above.
250
+ (variable_declaration
251
+ (variable_declarator
252
+ name: (identifier) @name
253
+ value: (call_expression
254
+ function: (identifier)
255
+ arguments: (arguments
256
+ (arrow_function))))) @definition.function
257
+
258
+ (variable_declaration
259
+ (variable_declarator
260
+ name: (identifier) @name
261
+ value: (call_expression
262
+ function: (identifier)
263
+ arguments: (arguments
264
+ (function_expression))))) @definition.function
265
+
266
+ (variable_declaration
267
+ (variable_declarator
268
+ name: (identifier) @name
269
+ value: (call_expression
270
+ function: (member_expression
271
+ property: (property_identifier) @callee)
272
+ arguments: (arguments
273
+ (arrow_function))))
274
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
275
+
276
+ (variable_declaration
277
+ (variable_declarator
278
+ name: (identifier) @name
279
+ value: (call_expression
280
+ function: (member_expression
281
+ property: (property_identifier) @callee)
282
+ arguments: (arguments
283
+ (function_expression))))
284
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
285
+
286
+ ; HOC-wrapped default exports: \`export default defineEventHandler(async (e) => { ... })\`.
287
+ ; The worker rewrites the wrapper-derived @name to a file-derived symbol name
288
+ ; so helpers like \`defineEventHandler\` / \`React.memo\` do not collapse
289
+ ; unrelated modules onto the same Function name.
290
+ (export_statement
291
+ value: (call_expression
292
+ function: (identifier) @hoc
293
+ arguments: (arguments
294
+ (arrow_function)))) @definition.function
295
+
296
+ (export_statement
297
+ value: (call_expression
298
+ function: (identifier) @hoc
299
+ arguments: (arguments
300
+ (function_expression)))) @definition.function
301
+
302
+ (export_statement
303
+ value: (call_expression
304
+ function: (member_expression
305
+ property: (property_identifier) @callee)
306
+ arguments: (arguments
307
+ (arrow_function)))) @definition.function
308
+
309
+ (export_statement
310
+ value: (call_expression
311
+ function: (member_expression
312
+ property: (property_identifier) @callee)
313
+ arguments: (arguments
314
+ (function_expression)))) @definition.function
315
+
316
+ ; Variable/constant declarations (non-function values).
317
+ ; Overlap with @definition.function patterns is handled by parse-worker dedup.
318
+ (lexical_declaration
319
+ (variable_declarator
320
+ name: (identifier) @name)) @definition.const
321
+
322
+ (export_statement
323
+ declaration: (lexical_declaration
324
+ (variable_declarator
325
+ name: (identifier) @name))) @definition.const
326
+
327
+ ; var declarations (mutable, function-scoped)
328
+ (variable_declaration
329
+ (variable_declarator
330
+ name: (identifier) @name)) @definition.variable
331
+
332
+ (import_statement
333
+ source: (string) @import.source) @import
334
+
335
+ ; Re-export statements: export { X } from './y'
336
+ (export_statement
337
+ source: (string) @import.source) @import
338
+
339
+ (call_expression
340
+ function: (identifier) @call.name) @call
341
+
342
+ (call_expression
343
+ function: (member_expression
344
+ property: (property_identifier) @call.name)) @call
345
+
346
+ ; Generic awaited free call: await fn<T>(args)
347
+ ; tree-sitter-typescript parses "await fn<T>(args)" as a call_expression whose
348
+ ; "function" field is an await_expression (not a bare identifier), because the
349
+ ; grammar resolves the ambiguity between generics and comparisons by consuming
350
+ ; "await fn" as an expression before attaching <T> as type_arguments.
351
+ (call_expression
352
+ function: (await_expression
353
+ (identifier) @call.name)
354
+ (type_arguments)) @call
355
+
356
+ ; Generic awaited member call: await obj.fn<T>(args)
357
+ (call_expression
358
+ function: (await_expression
359
+ (member_expression
360
+ property: (property_identifier) @call.name))
361
+ (type_arguments)) @call
362
+
363
+ ; Constructor calls: new Foo()
364
+ (new_expression
365
+ constructor: (identifier) @call.name) @call
366
+
367
+ ; Class properties — public_field_definition covers most TS class fields
368
+ (public_field_definition
369
+ name: (property_identifier) @name) @definition.property
370
+
371
+ ; Private class fields: #address: Address
372
+ (public_field_definition
373
+ name: (private_property_identifier) @name) @definition.property
374
+
375
+ ; Closure-valued class fields (#2693): \`handler = (x) => x\` is a CALLABLE
376
+ ; member, so it emits Method like every other closure binding rather than a
377
+ ; Property that CALLS edges would point at — a call target must be callable.
378
+ ; Kotlin already models its class-body closure this way (Method + HAS_METHOD).
379
+ ;
380
+ ; Note this diverges from tsc's SymbolFlags and SCIP's descriptor, which both
381
+ ; class an arrow-initialized field as a PROPERTY/term. That is deliberate: the
382
+ ; label here means "is a call target", not "is a tsc symbol kind", and #2687 set
383
+ ; that convention for closure bindings in every language. Anchored on
384
+ ; public_field_definition — the same node the property rules use — so the
385
+ ; parse-worker dedup collapses the pair (callable ranks highest).
386
+ (public_field_definition
387
+ name: (property_identifier) @name
388
+ value: (arrow_function)) @definition.method
389
+
390
+ (public_field_definition
391
+ name: (property_identifier) @name
392
+ value: (function_expression)) @definition.method
393
+
394
+ ; CJS property-assignment exports (#2723) — see JAVASCRIPT_QUERIES for the
395
+ ; rationale and for why the receiver is pinned to \`exports\`/\`module.exports\`.
396
+ ; Mirrored here because \`.ts\` files in a CommonJS package use the same form.
397
+ (assignment_expression
398
+ left: (member_expression
399
+ object: (identifier) @_cjs.receiver
400
+ property: (property_identifier) @name)
401
+ right: [(function_expression) (arrow_function) (generator_function)]) @definition.function
402
+
403
+ (assignment_expression
404
+ left: (member_expression
405
+ object: (member_expression
406
+ object: (identifier) @_cjs.module
407
+ property: (property_identifier) @_cjs.exports)
408
+ property: (property_identifier) @name)
409
+ right: [(function_expression) (arrow_function) (generator_function)]
410
+ (#eq? @_cjs.module "module")
411
+ (#eq? @_cjs.exports "exports")) @definition.function
412
+
413
+ ; Instance members assigned through \`this\` (#2723 follow-up) — see
414
+ ; JAVASCRIPT_QUERIES for rationale.
415
+ (assignment_expression
416
+ left: (member_expression
417
+ object: (this)
418
+ property: (property_identifier) @name)
419
+ right: [
420
+ (function_expression)
421
+ (arrow_function)
422
+ (generator_function)
423
+ ]) @definition.function
424
+
425
+ ; Prototype methods (#2723 follow-up) — see JAVASCRIPT_QUERIES for rationale.
426
+ (assignment_expression
427
+ left: (member_expression
428
+ object: (member_expression
429
+ property: (property_identifier) @_proto.kw)
430
+ property: (property_identifier) @name)
431
+ right: [
432
+ (function_expression)
433
+ (arrow_function)
434
+ (generator_function)
435
+ ]
436
+ (#eq? @_proto.kw "prototype")) @definition.function
437
+
438
+ ; Constructor parameter properties: constructor(public address: Address)
439
+ (required_parameter
440
+ (accessibility_modifier)
441
+ pattern: (identifier) @name) @definition.property
442
+
443
+ ; Write access: obj.field = value
444
+ (assignment_expression
445
+ left: (member_expression
446
+ object: (_) @assignment.receiver
447
+ property: (property_identifier) @assignment.property)
448
+ right: (_)) @assignment
449
+
450
+ ; Write access: obj.field += value (compound assignment)
451
+ (augmented_assignment_expression
452
+ left: (member_expression
453
+ object: (_) @assignment.receiver
454
+ property: (property_identifier) @assignment.property)
455
+ right: (_)) @assignment
456
+
457
+ ; HTTP consumers: fetch('/path'), axios.get('/path'), $.get('/path'), etc.
458
+ ; fetch() — global function
459
+ (call_expression
460
+ function: (identifier) @_fetch_fn (#eq? @_fetch_fn "fetch")
461
+ arguments: (arguments
462
+ [(string (string_fragment) @route.url)
463
+ (template_string) @route.template_url])) @route.fetch
464
+
465
+ ; Custom fetch wrappers: apiFetch('/path'), fetchJSON('/api/data'), httpGet('/users'), etc.
466
+ (call_expression
467
+ function: (identifier) @_wrapper_fn (#match? @_wrapper_fn "^(api(Fetch|Get|Post|Put|Delete|Patch|Request)|fetch(API|JSON|Data|Endpoint|Resource|Url)|http(Fetch|Get|Post|Put|Delete|Patch|Request))$")
468
+ arguments: (arguments
469
+ (string (string_fragment) @route.url))) @route.fetch
470
+
471
+ ; axios.get/post/put/delete/patch('/path'), $.get/post/ajax({url:'/path'})
472
+ (call_expression
473
+ function: (member_expression
474
+ property: (property_identifier) @http_client.method)
475
+ arguments: (arguments
476
+ (string (string_fragment) @http_client.url))) @http_client
477
+
478
+ ; Decorators: @Controller, @Get, @Post, etc.
479
+ (decorator
480
+ (call_expression
481
+ function: (identifier) @decorator.name
482
+ arguments: (arguments (string (string_fragment) @decorator.arg)?))) @decorator
483
+
484
+ ; Express/Hono route registration: app.get('/path', handler), router.post('/path', fn)
485
+ (call_expression
486
+ function: (member_expression
487
+ property: (property_identifier) @express_route.method)
488
+ arguments: (arguments
489
+ (string (string_fragment) @express_route.path))) @express_route
490
+ `;
491
+ // JavaScript queries - works with tree-sitter-javascript
492
+ exports.JAVASCRIPT_QUERIES = `
493
+ (class_declaration
494
+ name: (identifier) @name) @definition.class
495
+
496
+ (function_declaration
497
+ name: (identifier) @name) @definition.function
498
+
499
+ (generator_function_declaration
500
+ name: (identifier) @name) @definition.function
501
+
502
+ (method_definition
503
+ name: (property_identifier) @name) @definition.method
504
+
505
+ ; ES2022 #private methods
506
+ (method_definition
507
+ name: (private_property_identifier) @name) @definition.method
508
+
509
+ (lexical_declaration
510
+ (variable_declarator
511
+ name: (identifier) @name
512
+ value: (arrow_function))) @definition.function
513
+
514
+ (lexical_declaration
515
+ (variable_declarator
516
+ name: (identifier) @name
517
+ value: (function_expression))) @definition.function
518
+
519
+ ; Generator EXPRESSIONS bound to a name (\`const g = function* () {}\`). Without
520
+ ; these, the binding emitted a \`Const\` node rather than a \`Function\` one, so
521
+ ; \`g()\` resolved to nothing: \`buildGraphTargetIndex\` only admits a callable
522
+ ; node. Same construct and same binding semantics as the \`function_expression\`
523
+ ; rules directly above, so same label. Covers the four variable-binding shapes
524
+ ; (const/let and var, each plain and exported); a generator in an object-literal
525
+ ; pair or a HOC wrapper is NOT covered and still falls through anonymous.
526
+ (lexical_declaration
527
+ (variable_declarator
528
+ name: (identifier) @name
529
+ value: (generator_function))) @definition.function
530
+
531
+ (export_statement
532
+ declaration: (lexical_declaration
533
+ (variable_declarator
534
+ name: (identifier) @name
535
+ value: (arrow_function)))) @definition.function
536
+
537
+ (export_statement
538
+ declaration: (lexical_declaration
539
+ (variable_declarator
540
+ name: (identifier) @name
541
+ value: (function_expression)))) @definition.function
542
+
543
+ (export_statement
544
+ declaration: (lexical_declaration
545
+ (variable_declarator
546
+ name: (identifier) @name
547
+ value: (generator_function)))) @definition.function
548
+
549
+ ; \`var\` closure bindings (#2693). The lexical rules above cover const/let;
550
+ ; \`var\` is a different grammar node, so \`var f = (x) => x\` kept a Variable
551
+ ; label while const/let got Function — and the CALLS edge that resolved through
552
+ ; the declaration route therefore pointed at a NON-callable node. Same construct,
553
+ ; same binding semantics for this purpose, so same label.
554
+ (variable_declaration
555
+ (variable_declarator
556
+ name: (identifier) @name
557
+ value: (arrow_function))) @definition.function
558
+
559
+ (variable_declaration
560
+ (variable_declarator
561
+ name: (identifier) @name
562
+ value: (function_expression))) @definition.function
563
+
564
+ (variable_declaration
565
+ (variable_declarator
566
+ name: (identifier) @name
567
+ value: (generator_function))) @definition.function
568
+
569
+ (export_statement
570
+ declaration: (variable_declaration
571
+ (variable_declarator
572
+ name: (identifier) @name
573
+ value: (arrow_function)))) @definition.function
574
+
575
+ (export_statement
576
+ declaration: (variable_declaration
577
+ (variable_declarator
578
+ name: (identifier) @name
579
+ value: (function_expression)))) @definition.function
580
+
581
+ (export_statement
582
+ declaration: (variable_declaration
583
+ (variable_declarator
584
+ name: (identifier) @name
585
+ value: (generator_function)))) @definition.function
586
+
587
+ ; CJS property-assignment exports (#2723): \`exports.foo = function () {}\`,
588
+ ; \`module.exports.foo = (a) => a\`. This is the dominant export style in
589
+ ; pre-ESM Node (Express, Firebase Functions), and without these rules a
590
+ ; CommonJS codebase indexed its internals while every symbol on its public
591
+ ; API was missing — \`impact\`/\`context\`/\`rename\` all answered "not found".
592
+ ;
593
+ ; Scoped to the \`exports\` / \`module.exports\` receivers on purpose. The
594
+ ; general \`X.foo = function () {}\` shape also covers \`Foo.prototype.bar\` and
595
+ ; \`this.handler\`, which are member constructs with their own ownership
596
+ ; questions (an owning Class, a function-local binding) — a broader rule
597
+ ; would emit ownerless top-level Functions for them. Same rationale as the
598
+ ; other closure-binding rules above: the label means "is a call target".
599
+ (assignment_expression
600
+ left: (member_expression
601
+ object: (identifier) @_cjs.receiver
602
+ property: (property_identifier) @name)
603
+ right: [(function_expression) (arrow_function) (generator_function)]) @definition.function
604
+
605
+ (assignment_expression
606
+ left: (member_expression
607
+ object: (member_expression
608
+ object: (identifier) @_cjs.module
609
+ property: (property_identifier) @_cjs.exports)
610
+ property: (property_identifier) @name)
611
+ right: [(function_expression) (arrow_function) (generator_function)]
612
+ (#eq? @_cjs.module "module")
613
+ (#eq? @_cjs.exports "exports")) @definition.function
614
+
615
+ ; Prototype methods (#2723 follow-up): \`Foo.prototype.bar = function () {}\`.
616
+ ; The dominant pre-ES6 method form, and previously invisible — no node at all,
617
+ ; so \`impact\` could not reach a single prototype method. Emitted as a MEMBER:
618
+ ; \`labelOverride\` reclassifies it to Method and the owner resolves to whatever
619
+ ; \`Foo\` names, so \`HAS_METHOD\` makes it reachable the way a class method is.
620
+ (assignment_expression
621
+ left: (member_expression
622
+ object: (member_expression
623
+ property: (property_identifier) @_proto.kw)
624
+ property: (property_identifier) @name)
625
+ right: [
626
+ (function_expression)
627
+ (arrow_function)
628
+ (generator_function)
629
+ ]
630
+ (#eq? @_proto.kw "prototype")) @definition.function
631
+
632
+ ; Instance members assigned through \`this\` (#2723 follow-up):
633
+ ; \`function Widget() { this.handler = function () {}; }\`. The pre-ES6 sibling
634
+ ; of a closure-valued class field, which #2693 already models as a Method.
635
+ ; Ownership resolves to the enclosing constructor/class; a \`this\` at module
636
+ ; top level owns nothing and stays a plain top-level definition.
637
+ (assignment_expression
638
+ left: (member_expression
639
+ object: (this)
640
+ property: (property_identifier) @name)
641
+ right: [
642
+ (function_expression)
643
+ (arrow_function)
644
+ (generator_function)
645
+ ]) @definition.function
646
+
647
+ ; Object-property arrows / function expressions: \`{ addItem: () => ... }\`.
648
+ ; See TYPESCRIPT_QUERIES for rationale (issue #1166).
649
+ (pair
650
+ key: (property_identifier) @name
651
+ value: (arrow_function)) @definition.function
652
+
653
+ (pair
654
+ key: (property_identifier) @name
655
+ value: (function_expression)) @definition.function
656
+
657
+ (pair
658
+ key: (string (string_fragment) @name)
659
+ value: (arrow_function)) @definition.function
660
+
661
+ (pair
662
+ key: (string (string_fragment) @name)
663
+ value: (function_expression)) @definition.function
664
+
665
+ ; HOC-wrapped variable declarations: \`const X = HOC((args) => { ... })\`.
666
+ ; See TYPESCRIPT_QUERIES section above for the full rationale (issue #1166
667
+ ; follow-up — covers forwardRef / memo / useCallback / useMemo / observer
668
+ ; / debounce / user-defined HOC factories). Both \`const\` and \`var\` forms
669
+ ; are mirrored so JS code that uses \`var\` (or transpiler output) gets the
670
+ ; same attribution as the registry-primary path.
671
+ ; Excludes common array methods (map, filter, reduce, etc.) to avoid false positives.
672
+ (lexical_declaration
673
+ (variable_declarator
674
+ name: (identifier) @name
675
+ value: (call_expression
676
+ function: (identifier)
677
+ arguments: (arguments
678
+ (arrow_function))))) @definition.function
679
+
680
+ (lexical_declaration
681
+ (variable_declarator
682
+ name: (identifier) @name
683
+ value: (call_expression
684
+ function: (identifier)
685
+ arguments: (arguments
686
+ (function_expression))))) @definition.function
687
+
688
+ (lexical_declaration
689
+ (variable_declarator
690
+ name: (identifier) @name
691
+ value: (call_expression
692
+ function: (member_expression
693
+ property: (property_identifier) @callee)
694
+ arguments: (arguments
695
+ (arrow_function))))
696
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
697
+
698
+ (lexical_declaration
699
+ (variable_declarator
700
+ name: (identifier) @name
701
+ value: (call_expression
702
+ function: (member_expression
703
+ property: (property_identifier) @callee)
704
+ arguments: (arguments
705
+ (function_expression))))
706
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
707
+
708
+ (export_statement
709
+ declaration: (lexical_declaration
710
+ (variable_declarator
711
+ name: (identifier) @name
712
+ value: (call_expression
713
+ function: (identifier)
714
+ arguments: (arguments
715
+ (arrow_function)))))) @definition.function
716
+
717
+ (export_statement
718
+ declaration: (lexical_declaration
719
+ (variable_declarator
720
+ name: (identifier) @name
721
+ value: (call_expression
722
+ function: (identifier)
723
+ arguments: (arguments
724
+ (function_expression)))))) @definition.function
725
+
726
+ (export_statement
727
+ declaration: (lexical_declaration
728
+ (variable_declarator
729
+ name: (identifier) @name
730
+ value: (call_expression
731
+ function: (member_expression
732
+ property: (property_identifier) @callee)
733
+ arguments: (arguments
734
+ (arrow_function)))))
735
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
736
+
737
+ (export_statement
738
+ declaration: (lexical_declaration
739
+ (variable_declarator
740
+ name: (identifier) @name
741
+ value: (call_expression
742
+ function: (member_expression
743
+ property: (property_identifier) @callee)
744
+ arguments: (arguments
745
+ (function_expression)))))
746
+ ${ts_js_hoc_utils_js_1.ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
747
+
748
+ ; \`var X = HOC(...)\` parity with registry-primary.
749
+ ; Same array-method exclusions as const/let patterns.
750
+ (variable_declaration
751
+ (variable_declarator
752
+ name: (identifier) @name
753
+ value: (call_expression
754
+ function: (identifier)
755
+ arguments: (arguments
756
+ (arrow_function))))) @definition.function
757
+
758
+ (variable_declaration
759
+ (variable_declarator
760
+ name: (identifier) @name
761
+ value: (call_expression
762
+ function: (identifier)
763
+ arguments: (arguments
764
+ (function_expression))))) @definition.function
765
+
766
+ (variable_declaration
767
+ (variable_declarator
768
+ name: (identifier) @name
769
+ value: (call_expression
770
+ function: (member_expression
771
+ property: (property_identifier) @callee)
772
+ arguments: (arguments
773
+ (arrow_function))))
774
+ (#not-any-of? @callee "map" "filter" "reduce" "forEach" "find" "findIndex" "some" "every" "flatMap" "sort" "splice" "slice" "concat" "fill" "copyWithin" "join" "flat" "at" "entries" "keys" "values" "indexOf" "lastIndexOf" "includes" "pop" "push" "shift" "unshift" "reverse" "reduceRight" "toSorted" "toReversed" "toSpliced" "with")) @definition.function
775
+
776
+ (variable_declaration
777
+ (variable_declarator
778
+ name: (identifier) @name
779
+ value: (call_expression
780
+ function: (member_expression
781
+ property: (property_identifier) @callee)
782
+ arguments: (arguments
783
+ (function_expression))))
784
+ (#not-any-of? @callee "map" "filter" "reduce" "forEach" "find" "findIndex" "some" "every" "flatMap" "sort" "splice" "slice" "concat" "fill" "copyWithin" "join" "flat" "at" "entries" "keys" "values" "indexOf" "lastIndexOf" "includes" "pop" "push" "shift" "unshift" "reverse" "reduceRight" "toSorted" "toReversed" "toSpliced" "with")) @definition.function
785
+
786
+ ; HOC-wrapped default exports (JS parity with TS patterns above).
787
+ (export_statement
788
+ value: (call_expression
789
+ function: (identifier) @hoc
790
+ arguments: (arguments
791
+ (arrow_function)))) @definition.function
792
+
793
+ (export_statement
794
+ value: (call_expression
795
+ function: (identifier) @hoc
796
+ arguments: (arguments
797
+ (function_expression)))) @definition.function
798
+
799
+ (export_statement
800
+ value: (call_expression
801
+ function: (member_expression
802
+ property: (property_identifier) @callee)
803
+ arguments: (arguments
804
+ (arrow_function)))) @definition.function
805
+
806
+ (export_statement
807
+ value: (call_expression
808
+ function: (member_expression
809
+ property: (property_identifier) @callee)
810
+ arguments: (arguments
811
+ (function_expression)))) @definition.function
812
+
813
+ ; Variable/constant declarations (non-function values).
814
+ ; Overlap with @definition.function patterns is handled by parse-worker dedup.
815
+ (lexical_declaration
816
+ (variable_declarator
817
+ name: (identifier) @name)) @definition.const
818
+
819
+ (export_statement
820
+ declaration: (lexical_declaration
821
+ (variable_declarator
822
+ name: (identifier) @name))) @definition.const
823
+
824
+ ; var declarations (mutable, function-scoped)
825
+ (variable_declaration
826
+ (variable_declarator
827
+ name: (identifier) @name)) @definition.variable
828
+
829
+ (import_statement
830
+ source: (string) @import.source) @import
831
+
832
+ ; Re-export statements: export { X } from './y'
833
+ (export_statement
834
+ source: (string) @import.source) @import
835
+
836
+ (call_expression
837
+ function: (identifier) @call.name) @call
838
+
839
+ (call_expression
840
+ function: (member_expression
841
+ property: (property_identifier) @call.name)) @call
842
+
843
+ ; Constructor calls: new Foo()
844
+ (new_expression
845
+ constructor: (identifier) @call.name) @call
846
+
847
+ ; Class fields — field_definition captures JS class fields (class User { address = ... })
848
+ (field_definition
849
+ property: (property_identifier) @name) @definition.property
850
+
851
+ ; Closure-valued class fields (#2693) — see the TypeScript block for why these
852
+ ; are Method rather than Property.
853
+ (field_definition
854
+ property: (property_identifier) @name
855
+ value: (arrow_function)) @definition.method
856
+
857
+ (field_definition
858
+ property: (property_identifier) @name
859
+ value: (function_expression)) @definition.method
860
+
861
+ ; Write access: obj.field = value
862
+ (assignment_expression
863
+ left: (member_expression
864
+ object: (_) @assignment.receiver
865
+ property: (property_identifier) @assignment.property)
866
+ right: (_)) @assignment
867
+
868
+ ; Write access: obj.field += value (compound assignment)
869
+ (augmented_assignment_expression
870
+ left: (member_expression
871
+ object: (_) @assignment.receiver
872
+ property: (property_identifier) @assignment.property)
873
+ right: (_)) @assignment
874
+
875
+ ; HTTP consumers: fetch('/path'), axios.get('/path'), $.get('/path'), etc.
876
+ (call_expression
877
+ function: (identifier) @_fetch_fn (#eq? @_fetch_fn "fetch")
878
+ arguments: (arguments
879
+ [(string (string_fragment) @route.url)
880
+ (template_string) @route.template_url])) @route.fetch
881
+
882
+ ; Custom fetch wrappers: apiFetch('/path'), fetchJSON('/api/data'), httpGet('/users'), etc.
883
+ (call_expression
884
+ function: (identifier) @_wrapper_fn (#match? @_wrapper_fn "^(api(Fetch|Get|Post|Put|Delete|Patch|Request)|fetch(API|JSON|Data|Endpoint|Resource|Url)|http(Fetch|Get|Post|Put|Delete|Patch|Request))$")
885
+ arguments: (arguments
886
+ (string (string_fragment) @route.url))) @route.fetch
887
+
888
+ ; axios.get/post, $.get/post/ajax
889
+ (call_expression
890
+ function: (member_expression
891
+ property: (property_identifier) @http_client.method)
892
+ arguments: (arguments
893
+ (string (string_fragment) @http_client.url))) @http_client
894
+
895
+ ; Express/Hono route registration
896
+ (call_expression
897
+ function: (member_expression
898
+ property: (property_identifier) @express_route.method)
899
+ arguments: (arguments
900
+ (string (string_fragment) @express_route.path))) @express_route
901
+ `;
902
+ // Python queries - works with tree-sitter-python
903
+ exports.PYTHON_QUERIES = `
904
+ (class_definition
905
+ name: (identifier) @name) @definition.class
906
+
907
+ (function_definition
908
+ name: (identifier) @name) @definition.function
909
+
910
+ (import_statement
911
+ name: (dotted_name) @import.source) @import
912
+
913
+ ; import numpy as np → aliased_import captures the module name so the
914
+ ; import path is resolved and named-binding extraction stores "np" → "numpy".
915
+ (import_statement
916
+ name: (aliased_import
917
+ name: (dotted_name) @import.source)) @import
918
+
919
+ (import_from_statement
920
+ module_name: (dotted_name) @import.source) @import
921
+
922
+ (import_from_statement
923
+ module_name: (relative_import) @import.source) @import
924
+
925
+ (call
926
+ function: (identifier) @call.name) @call
927
+
928
+ (call
929
+ function: (attribute
930
+ attribute: (identifier) @call.name)) @call
931
+
932
+ ; Class attribute type annotations — PEP 526: address: Address or address: Address = Address()
933
+ ; Both bare annotations (address: Address) and annotated assignments (name: str = "test")
934
+ ; are parsed as (assignment left: ... type: ...) in tree-sitter-python.
935
+ (expression_statement
936
+ (assignment
937
+ left: (identifier) @name
938
+ type: (type)) @definition.property)
939
+
940
+ ; Plain variable assignments without type annotation: x = 5, MAX_SIZE = 100
941
+ ; Overlap with @definition.property (typed) is handled by parse-worker dedup.
942
+ (expression_statement
943
+ (assignment
944
+ left: (identifier) @name)) @definition.variable
945
+
946
+ ; Lambda bindings: \`f = lambda x: x\` binds a CALLABLE, so it emits Function
947
+ ; rather than Variable, matching what TS/JS already do for \`const f = () => {}\`.
948
+ ; This aligns the LABEL only — call resolution runs off the scope-resolution
949
+ ; query, which still models the binding as a value, so \`f()\` does not resolve
950
+ ; here yet. Overlap with the assignment pattern above is collapsed by the
951
+ ; parse-worker dedup (#2687).
952
+ (expression_statement
953
+ (assignment
954
+ left: (identifier) @name
955
+ right: (lambda))) @definition.function
956
+
957
+ ; Write access: obj.field = value
958
+ (assignment
959
+ left: (attribute
960
+ object: (_) @assignment.receiver
961
+ attribute: (identifier) @assignment.property)
962
+ right: (_)) @assignment
963
+
964
+ ; Write access: obj.field += value (compound assignment)
965
+ (augmented_assignment
966
+ left: (attribute
967
+ object: (_) @assignment.receiver
968
+ attribute: (identifier) @assignment.property)
969
+ right: (_)) @assignment
970
+
971
+ ; Python HTTP clients: requests.get('/path'), httpx.post('/path'), session.get('/path')
972
+ (call
973
+ function: (attribute
974
+ attribute: (identifier) @http_client.method)
975
+ arguments: (argument_list
976
+ (string (string_content) @http_client.url))) @http_client
977
+
978
+ ; Python decorators: @app.route, @router.get, etc.
979
+ ; The first positional argument is captured three ways (#2391): a string literal
980
+ ; path via @decorator.arg (quote-free, the fast path); a bare constant name or a
981
+ ; plus-concatenation via @decorator.arg_expr (resolved cross-file by the constant
982
+ ; resolver). The anchored optional alternation pins to the FIRST arg and stays
983
+ ; optional, so no-arg decorators (@app.tool(), etc.) and non-path first args still
984
+ ; match.
985
+ (decorator
986
+ (call
987
+ function: (attribute
988
+ object: (identifier) @decorator.receiver
989
+ attribute: (identifier) @decorator.name)
990
+ arguments: (argument_list
991
+ .
992
+ [
993
+ (string (string_content)? @decorator.arg) @decorator.arg_str
994
+ (identifier) @decorator.arg_expr
995
+ (binary_operator) @decorator.arg_expr
996
+ ]?))) @decorator
997
+ `;
998
+ // Java queries - works with tree-sitter-java
999
+ exports.JAVA_QUERIES = `
1000
+ ; Classes, Interfaces, Enums, Records, Annotations
1001
+ (class_declaration name: (identifier) @name) @definition.class
1002
+ (interface_declaration name: (identifier) @name) @definition.interface
1003
+ (enum_declaration name: (identifier) @name) @definition.enum
1004
+ (record_declaration name: (identifier) @name) @definition.record
1005
+ (annotation_type_declaration name: (identifier) @name) @definition.annotation
1006
+
1007
+ ; Anonymous class bodies: new Runnable() { ... } — no @name capture; the
1008
+ ; class extractor synthesizes the javac-style Worker$N name (#2550)
1009
+ (object_creation_expression (class_body)) @definition.class
1010
+
1011
+ ; Enum constant bodies: enum E { A { ... } } — javac's other anonymous
1012
+ ; shape, synthesized as E$N by the same naming authority (#2555)
1013
+ (enum_constant body: (class_body)) @definition.class
1014
+
1015
+ ; Methods & Constructors
1016
+ (method_declaration name: (identifier) @name) @definition.method
1017
+ (constructor_declaration name: (identifier) @name) @definition.constructor
1018
+
1019
+ ; Fields — typed field declarations inside class bodies
1020
+ (field_declaration
1021
+ declarator: (variable_declarator
1022
+ name: (identifier) @name)) @definition.property
1023
+
1024
+ ; Imports - capture any import declaration child as source
1025
+ (import_declaration (_) @import.source) @import
1026
+
1027
+ ; Calls
1028
+ (method_invocation name: (identifier) @call.name) @call
1029
+ (method_invocation object: (_) name: (identifier) @call.name) @call
1030
+ (method_reference) @call
1031
+
1032
+ ; Constructor calls: new Foo()
1033
+ (object_creation_expression type: (type_identifier) @call.name) @call
1034
+
1035
+ ; Local variable declarations inside method bodies
1036
+ (local_variable_declaration
1037
+ declarator: (variable_declarator
1038
+ name: (identifier) @name)) @definition.variable
1039
+
1040
+ ; Write access: obj.field = value
1041
+ (assignment_expression
1042
+ left: (field_access
1043
+ object: (_) @assignment.receiver
1044
+ field: (identifier) @assignment.property)
1045
+ right: (_)) @assignment
1046
+
1047
+ ; ── Closure bindings (#2693) ────────────────────────────────────────────────
1048
+ ; A name bound to a closure literal IS a callable, so it emits Function rather
1049
+ ; than a value label — matching TS/JS and the languages #2687 already covered.
1050
+ ; The callable node is what callable-value-flow joins the binding to (by file,
1051
+ ; line and name), which is what makes handler.apply(1) resolve. Overlap with the value
1052
+ ; rules above is collapsed by the parse-worker dedup, which ranks callable
1053
+ ; highest (#2687).
1054
+ ; Anchored on field_declaration / local_variable_declaration — the SAME nodes
1055
+ ; the value rules above use — so the parse-worker dedup (keyed by definition
1056
+ ; node + name) actually collapses the pair. Anchoring on the inner
1057
+ ; variable_declarator instead produced a Function AND a Property twin, the exact
1058
+ ; double-indexing #2687 removed.
1059
+ (field_declaration
1060
+ declarator: (variable_declarator
1061
+ name: (identifier) @name
1062
+ value: (lambda_expression))) @definition.function
1063
+ (local_variable_declaration
1064
+ declarator: (variable_declarator
1065
+ name: (identifier) @name
1066
+ value: (lambda_expression))) @definition.function
1067
+ `;
1068
+ // C queries - works with tree-sitter-c
1069
+ exports.C_QUERIES = `
1070
+ ; Functions (direct declarator)
1071
+ (function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function
1072
+ (declaration declarator: (function_declarator declarator: (identifier) @name)) @definition.function
1073
+
1074
+ ; Functions returning pointers (pointer_declarator wraps function_declarator)
1075
+ (function_definition declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name))) @definition.function
1076
+ (declaration declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name))) @definition.function
1077
+
1078
+ ; Functions returning double pointers (nested pointer_declarator)
1079
+ (function_definition declarator: (pointer_declarator declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name)))) @definition.function
1080
+
1081
+ ; Structs, Unions, Enums, Typedefs
1082
+ (struct_specifier name: (type_identifier) @name) @definition.struct
1083
+ (type_definition
1084
+ type: (struct_specifier
1085
+ body: (field_declaration_list))
1086
+ declarator: (type_identifier) @name) @definition.struct
1087
+ (union_specifier name: (type_identifier) @name) @definition.union
1088
+ (enum_specifier name: (type_identifier) @name) @definition.enum
1089
+ (type_definition
1090
+ type: (enum_specifier
1091
+ body: (enumerator_list))
1092
+ declarator: (type_identifier) @name) @definition.enum
1093
+ (enumerator name: (identifier) @name) @definition.const
1094
+ (type_definition declarator: (type_identifier) @name) @definition.typedef
1095
+
1096
+ ; Macros
1097
+ (preproc_function_def name: (identifier) @name) @definition.macro
1098
+ (preproc_def name: (identifier) @name) @definition.macro
1099
+
1100
+ ; Includes
1101
+ (preproc_include path: (_) @import.source) @import
1102
+
1103
+ ; Calls
1104
+ (call_expression function: (identifier) @call.name) @call
1105
+ (call_expression function: (field_expression field: (field_identifier) @call.name)) @call
1106
+
1107
+ ; Variable declarations: int x = 5; or int x;
1108
+ (declaration
1109
+ declarator: (init_declarator
1110
+ declarator: (identifier) @name)) @definition.variable
1111
+ `;
1112
+ // Go queries - works with tree-sitter-go
1113
+ exports.GO_QUERIES = `
1114
+ ; Functions & Methods
1115
+ (function_declaration name: (identifier) @name) @definition.function
1116
+ (method_declaration name: (field_identifier) @name) @definition.method
1117
+ (method_elem name: (field_identifier) @name) @definition.method
1118
+
1119
+ ; Types
1120
+ ;
1121
+ ; Anchored on the type_spec, NOT the enclosing type_declaration (#2837) — a
1122
+ ; grouped type ( A struct{}; B struct{} ) block otherwise gave every match the
1123
+ ; same capture node, and goClassConfig.extractName resolved all of them to the
1124
+ ; FIRST spec's name, collapsing the block to one node. Must stay in lockstep
1125
+ ; with @scope.class / @declaration.struct in languages/go/query.ts, which
1126
+ ; carries the full rationale. (No backticks here: this is a template literal.)
1127
+ (type_declaration (type_spec name: (type_identifier) @name type: (struct_type)) @definition.struct)
1128
+ (type_declaration (type_spec name: (type_identifier) @name type: (interface_type)) @definition.interface)
1129
+
1130
+ ; Imports
1131
+ (import_declaration (import_spec path: (interpreted_string_literal) @import.source)) @import
1132
+ (import_declaration (import_spec_list (import_spec path: (interpreted_string_literal) @import.source))) @import
1133
+
1134
+ ; Struct fields — named field declarations inside struct types
1135
+ (field_declaration_list
1136
+ (field_declaration
1137
+ name: (field_identifier) @name) @definition.property)
1138
+
1139
+ ; Calls
1140
+ (call_expression function: (identifier) @call.name) @call
1141
+ (call_expression function: (selector_expression field: (field_identifier) @call.name)) @call
1142
+
1143
+ ; Const/var declarations
1144
+ (const_declaration (const_spec (identifier) @name)) @definition.const
1145
+ (var_declaration (var_spec (identifier) @name)) @definition.variable
1146
+ (var_declaration (var_spec_list (var_spec (identifier) @name))) @definition.variable
1147
+
1148
+ ; Short variable declaration: x := 5
1149
+ (short_var_declaration left: (expression_list (identifier) @name)) @definition.variable
1150
+
1151
+ ; Closure bindings: \`var f = func(){}\` / \`f := func(){}\` bind a CALLABLE, so
1152
+ ; they emit Function, not Variable — the same convention TS/JS already use for
1153
+ ; \`const f = () => {}\`. This aligns the LABEL only — call resolution runs off
1154
+ ; the scope-resolution query, which still models the binding as a value, so
1155
+ ; \`f()\` does not resolve here yet. Overlap with the value patterns above is
1156
+ ; collapsed by the parse-worker dedup (#2687).
1157
+ (var_declaration
1158
+ (var_spec
1159
+ name: (identifier) @name
1160
+ value: (expression_list (func_literal)))) @definition.function
1161
+ (var_declaration
1162
+ (var_spec_list
1163
+ (var_spec
1164
+ name: (identifier) @name
1165
+ value: (expression_list (func_literal))))) @definition.function
1166
+ (short_var_declaration
1167
+ left: (expression_list (identifier) @name)
1168
+ right: (expression_list (func_literal))) @definition.function
1169
+
1170
+ ; Struct literal construction: User{Name: "Alice"}
1171
+ (composite_literal type: (type_identifier) @call.name) @call
1172
+
1173
+ ; Write access: obj.field = value
1174
+ (assignment_statement
1175
+ left: (expression_list
1176
+ (selector_expression
1177
+ operand: (_) @assignment.receiver
1178
+ field: (field_identifier) @assignment.property))
1179
+ right: (_)) @assignment
1180
+
1181
+ ; Write access: obj.field++ / obj.field--
1182
+ (inc_statement
1183
+ (selector_expression
1184
+ operand: (_) @assignment.receiver
1185
+ field: (field_identifier) @assignment.property)) @assignment
1186
+ (dec_statement
1187
+ (selector_expression
1188
+ operand: (_) @assignment.receiver
1189
+ field: (field_identifier) @assignment.property)) @assignment
1190
+ `;
1191
+ // C++ queries - works with tree-sitter-cpp
1192
+ exports.CPP_QUERIES = `
1193
+ ; Classes, Structs, Namespaces
1194
+ (class_specifier name: (type_identifier) @name) @definition.class
1195
+ (class_specifier
1196
+ name: (template_type
1197
+ (type_identifier) @name
1198
+ (template_argument_list) @template-arguments)) @definition.class
1199
+ ; Out-of-line nested definition: class Outer::Inner { ... } / struct Outer::Inner { ... }.
1200
+ ; Key the node by the full qualified_identifier text so the def materializes a
1201
+ ; node that matches the HAS_METHOD owner id (also the full qualified text) and
1202
+ ; stays distinct from a same-tail type in another scope (#1975, #1978).
1203
+ (class_specifier name: (qualified_identifier) @name) @definition.class
1204
+ (struct_specifier name: (qualified_identifier) @name) @definition.struct
1205
+ (struct_specifier name: (type_identifier) @name) @definition.struct
1206
+ (struct_specifier
1207
+ name: (template_type
1208
+ (type_identifier) @name
1209
+ (template_argument_list) @template-arguments)) @definition.struct
1210
+ (namespace_definition name: (namespace_identifier) @name) @definition.namespace
1211
+ (enum_specifier name: (type_identifier) @name) @definition.enum
1212
+
1213
+ ; Typedefs and unions (common in C-style headers and mixed C/C++ code)
1214
+ (type_definition
1215
+ type: (struct_specifier
1216
+ body: (field_declaration_list))
1217
+ declarator: (type_identifier) @name) @definition.struct
1218
+ (type_definition
1219
+ type: (enum_specifier
1220
+ body: (enumerator_list))
1221
+ declarator: (type_identifier) @name) @definition.enum
1222
+ (enumerator name: (identifier) @name) @definition.const
1223
+ (type_definition declarator: (type_identifier) @name) @definition.typedef
1224
+ (union_specifier name: (type_identifier) @name) @definition.union
1225
+
1226
+ ; Macros
1227
+ (preproc_function_def name: (identifier) @name) @definition.macro
1228
+ (preproc_def name: (identifier) @name) @definition.macro
1229
+
1230
+ ; Functions & Methods (direct declarator)
1231
+ (function_definition declarator: (function_declarator declarator: (identifier) @name)) @definition.function
1232
+ (function_definition declarator: (function_declarator declarator: (operator_name) @name)) @definition.function
1233
+ (function_definition declarator: (function_declarator declarator: (qualified_identifier name: (identifier) @name))) @definition.method
1234
+ (function_definition declarator: (function_declarator declarator: (qualified_identifier name: (operator_name) @name))) @definition.method
1235
+
1236
+ ; Functions/methods returning pointers (pointer_declarator wraps function_declarator)
1237
+ (function_definition declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name))) @definition.function
1238
+ (function_definition declarator: (pointer_declarator declarator: (function_declarator declarator: (qualified_identifier name: (identifier) @name)))) @definition.method
1239
+
1240
+ ; Functions/methods returning double pointers (nested pointer_declarator)
1241
+ (function_definition declarator: (pointer_declarator declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name)))) @definition.function
1242
+ (function_definition declarator: (pointer_declarator declarator: (pointer_declarator declarator: (function_declarator declarator: (qualified_identifier name: (identifier) @name))))) @definition.method
1243
+
1244
+ ; Functions/methods returning references (reference_declarator wraps function_declarator)
1245
+ (function_definition declarator: (reference_declarator (function_declarator declarator: (identifier) @name))) @definition.function
1246
+ (function_definition declarator: (reference_declarator (function_declarator declarator: (operator_name) @name))) @definition.function
1247
+ (function_definition declarator: (reference_declarator (function_declarator declarator: (qualified_identifier name: (identifier) @name)))) @definition.method
1248
+ (function_definition declarator: (reference_declarator (function_declarator declarator: (qualified_identifier name: (operator_name) @name)))) @definition.method
1249
+
1250
+ ; Destructors (destructor_name is distinct from identifier in tree-sitter-cpp)
1251
+ (function_definition declarator: (function_declarator declarator: (qualified_identifier name: (destructor_name) @name))) @definition.method
1252
+
1253
+ ; Function declarations / prototypes (common in headers)
1254
+ (declaration declarator: (function_declarator declarator: (identifier) @name)) @definition.function
1255
+ (declaration declarator: (function_declarator declarator: (operator_name) @name)) @definition.function
1256
+ (declaration declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) @name))) @definition.function
1257
+ (declaration declarator: (reference_declarator (function_declarator declarator: (operator_name) @name))) @definition.function
1258
+
1259
+ ; Class/struct data member fields (Address address; int count;)
1260
+ ; Uses field_identifier to exclude method declarations (which use function_declarator)
1261
+ (field_declaration
1262
+ declarator: (field_identifier) @name) @definition.property
1263
+
1264
+ ; Pointer member fields (Address* address;)
1265
+ (field_declaration
1266
+ declarator: (pointer_declarator
1267
+ declarator: (field_identifier) @name)) @definition.property
1268
+
1269
+ ; Reference member fields (Address& address;)
1270
+ (field_declaration
1271
+ declarator: (reference_declarator
1272
+ (field_identifier) @name)) @definition.property
1273
+
1274
+ ; Inline class method declarations (inside class body, no body: void save();)
1275
+ ; tree-sitter-cpp uses field_identifier (not identifier) for names inside class bodies
1276
+ (field_declaration declarator: (function_declarator declarator: [(field_identifier) (identifier) (operator_name)] @name)) @definition.method
1277
+
1278
+ ; Inline class method declarations returning a pointer (User* lookup();)
1279
+ (field_declaration declarator: (pointer_declarator declarator: (function_declarator declarator: [(field_identifier) (identifier)] @name))) @definition.method
1280
+
1281
+ ; Inline class method declarations returning a reference (User& lookup();)
1282
+ (field_declaration declarator: (reference_declarator (function_declarator declarator: [(field_identifier) (identifier) (operator_name)] @name))) @definition.method
1283
+
1284
+ ; Inline class method definitions (inside class body, with body: void Foo() { ... })
1285
+ (field_declaration_list
1286
+ (function_definition
1287
+ declarator: (function_declarator
1288
+ declarator: [(field_identifier) (identifier) (operator_name) (destructor_name)] @name)) @definition.method)
1289
+
1290
+ ; Inline class methods returning a pointer type (User* lookup(int id) { ... })
1291
+ (field_declaration_list
1292
+ (function_definition
1293
+ declarator: (pointer_declarator
1294
+ declarator: (function_declarator
1295
+ declarator: [(field_identifier) (identifier) (operator_name)] @name))) @definition.method)
1296
+
1297
+ ; Inline class methods returning a reference type (User& lookup(int id) { ... })
1298
+ (field_declaration_list
1299
+ (function_definition
1300
+ declarator: (reference_declarator
1301
+ (function_declarator
1302
+ declarator: [(field_identifier) (identifier) (operator_name)] @name))) @definition.method)
1303
+
1304
+ ; Templates
1305
+ (template_declaration (class_specifier name: (type_identifier) @name)) @definition.template
1306
+ (template_declaration
1307
+ (class_specifier
1308
+ name: (template_type
1309
+ (type_identifier) @name
1310
+ (template_argument_list) @template-arguments))) @definition.template
1311
+ (template_declaration (function_definition declarator: (function_declarator declarator: (identifier) @name))) @definition.template
1312
+
1313
+ ; Includes
1314
+ (preproc_include path: (_) @import.source) @import
1315
+
1316
+ ; Calls
1317
+ (call_expression function: (identifier) @call.name) @call
1318
+ (call_expression function: (field_expression field: (field_identifier) @call.name)) @call
1319
+ (call_expression function: (qualified_identifier name: (identifier) @call.name)) @call
1320
+ (call_expression function: (template_function name: (identifier) @call.name)) @call
1321
+ (binary_expression operator: "+" @call.name) @call
1322
+ (binary_expression operator: "<<" @call.name) @call
1323
+
1324
+ ; Constructor calls: new User()
1325
+ (new_expression type: (type_identifier) @call.name) @call
1326
+
1327
+ ; Variable declarations: int x = 5; or auto x = 5;
1328
+ (declaration
1329
+ declarator: (init_declarator
1330
+ declarator: (identifier) @name)) @definition.variable
1331
+
1332
+ ; Lambda bindings: \`auto f = [](int x){ … };\` binds a CALLABLE, so it emits
1333
+ ; Function rather than Variable, matching TS/JS. This aligns the LABEL only —
1334
+ ; call resolution runs off the scope-resolution query, which still models the
1335
+ ; binding as a value, so \`f()\` does not resolve here yet. Overlap with the
1336
+ ; pattern above is collapsed by the parse-worker dedup (#2687).
1337
+ (declaration
1338
+ declarator: (init_declarator
1339
+ declarator: (identifier) @name
1340
+ value: (lambda_expression))) @definition.function
1341
+
1342
+ ; Structured bindings: auto [a, b] = makePair(); (one @name per bound identifier)
1343
+ (declaration
1344
+ declarator: (init_declarator
1345
+ declarator: (structured_binding_declarator
1346
+ (identifier) @name))) @definition.variable
1347
+
1348
+ ; Structured bindings, reference form: auto& [x, y] = tup;
1349
+ (declaration
1350
+ declarator: (init_declarator
1351
+ declarator: (reference_declarator
1352
+ (structured_binding_declarator
1353
+ (identifier) @name)))) @definition.variable
1354
+
1355
+ ; Write access: obj.field = value
1356
+ (assignment_expression
1357
+ left: (field_expression
1358
+ argument: (_) @assignment.receiver
1359
+ field: (field_identifier) @assignment.property)
1360
+ right: (_)) @assignment
1361
+
1362
+ `;
1363
+ // C# queries - works with tree-sitter-c-sharp
1364
+ exports.CSHARP_QUERIES = `
1365
+ ; Types
1366
+ (class_declaration name: (identifier) @name) @definition.class
1367
+ (interface_declaration name: (identifier) @name) @definition.interface
1368
+ (struct_declaration name: (identifier) @name) @definition.struct
1369
+ (enum_declaration name: (identifier) @name) @definition.enum
1370
+ (record_declaration name: (identifier) @name) @definition.record
1371
+ (delegate_declaration name: (identifier) @name) @definition.delegate
1372
+
1373
+ ; Namespaces (block form and C# 10+ file-scoped form)
1374
+ (namespace_declaration name: (identifier) @name) @definition.namespace
1375
+ (namespace_declaration name: (qualified_name) @name) @definition.namespace
1376
+ (file_scoped_namespace_declaration name: (identifier) @name) @definition.namespace
1377
+ (file_scoped_namespace_declaration name: (qualified_name) @name) @definition.namespace
1378
+
1379
+ ; Methods & Properties
1380
+ (method_declaration name: (identifier) @name) @definition.method
1381
+ (local_function_statement name: (identifier) @name) @definition.function
1382
+ (constructor_declaration name: (identifier) @name) @definition.constructor
1383
+ (property_declaration name: (identifier) @name) @definition.property
1384
+
1385
+ ; Primary constructors (C# 12): class User(string name, int age) { }
1386
+ (class_declaration name: (identifier) @name (parameter_list) @definition.constructor)
1387
+ (record_declaration name: (identifier) @name (parameter_list) @definition.constructor)
1388
+
1389
+ ; Using
1390
+ (using_directive (qualified_name) @import.source) @import
1391
+ (using_directive (identifier) @import.source) @import
1392
+
1393
+ ; Calls
1394
+ (invocation_expression function: (identifier) @call.name) @call
1395
+ (invocation_expression function: (member_access_expression name: (identifier) @call.name)) @call
1396
+
1397
+ ; Null-conditional method calls: user?.Save()
1398
+ ; Parses as: invocation_expression → conditional_access_expression → member_binding_expression → identifier
1399
+ (invocation_expression
1400
+ function: (conditional_access_expression
1401
+ (member_binding_expression
1402
+ (identifier) @call.name))) @call
1403
+
1404
+ ; Constructor calls: new Foo() and new Foo { Props }
1405
+ (object_creation_expression type: (identifier) @call.name) @call
1406
+
1407
+ ; Target-typed new (C# 9): User u = new("x", 5)
1408
+ (variable_declaration type: (identifier) @call.name (variable_declarator (implicit_object_creation_expression) @call))
1409
+
1410
+ ; Local variable declarations
1411
+ (local_declaration_statement
1412
+ (variable_declaration
1413
+ (variable_declarator
1414
+ (identifier) @name))) @definition.variable
1415
+
1416
+ ; Write access: obj.field = value
1417
+ (assignment_expression
1418
+ left: (member_access_expression
1419
+ expression: (_) @assignment.receiver
1420
+ name: (identifier) @assignment.property)
1421
+ right: (_)) @assignment
1422
+
1423
+ ; ── Closure bindings (#2693) ────────────────────────────────────────────────
1424
+ ; A name bound to a closure literal IS a callable, so it emits Function rather
1425
+ ; than a value label — matching TS/JS and the languages #2687 already covered.
1426
+ ; The callable node is what callable-value-flow joins the binding to (by file,
1427
+ ; line and name), which is what makes handler(1) resolve. Overlap with the value
1428
+ ; rules above is collapsed by the parse-worker dedup, which ranks callable
1429
+ ; highest (#2687).
1430
+ (variable_declarator
1431
+ (identifier) @name
1432
+ (lambda_expression)) @definition.function
1433
+ `;
1434
+ // Rust queries - works with tree-sitter-rust
1435
+ exports.RUST_QUERIES = `
1436
+ ; Functions & Items
1437
+ (function_item name: (identifier) @name) @definition.function
1438
+ (function_signature_item name: (identifier) @name) @definition.function
1439
+
1440
+ ; Closure bound to a let: let handler = || target(1);
1441
+ ; Emits the Function NODE. Without it a Rust closure binding had no graph node
1442
+ ; at all, so it could be neither a call target nor a call source (#2699), which
1443
+ ; made Rust the one exception to "a closure bound to a name is a Function node
1444
+ ; in every language" (#2687).
1445
+ ; Anchor note: this channel puts @definition.function on the OUTER
1446
+ ; let_declaration, which is the OPPOSITE of the scope-resolution channel in
1447
+ ; languages/rust/query.ts (inner closure_expression, to align with
1448
+ ; @scope.function). Both match their own channel's convention -- compare the
1449
+ ; (lexical_declaration (variable_declarator ... (arrow_function))) rule above.
1450
+ (let_declaration
1451
+ pattern: (identifier) @name
1452
+ value: (closure_expression)) @definition.function
1453
+ (struct_item name: (type_identifier) @name) @definition.struct
1454
+ ; A union is materialized as a Struct node (same rationale as the
1455
+ ; scope-resolution @declaration.struct in languages/rust/query.ts: every
1456
+ ; registry-primary resolution gate includes Struct but excludes Union, so a
1457
+ ; Union-labeled node would be an unresolvable orphan). #1934 F71.
1458
+ (union_item name: (type_identifier) @name) @definition.struct
1459
+ (enum_item name: (type_identifier) @name) @definition.enum
1460
+ (trait_item name: (type_identifier) @name) @definition.trait
1461
+ (impl_item type: (type_identifier) @name !trait) @definition.impl
1462
+ (impl_item type: (generic_type type: (type_identifier) @name) !trait) @definition.impl
1463
+ ; Scoped inherent impl: impl path::Type { ... }. Key the Impl node by the full
1464
+ ; scoped_type_identifier text so it matches the owner id (also full text) and
1465
+ ; stays distinct from a same-tail type in another module (#1975).
1466
+ (impl_item type: (scoped_type_identifier) @name !trait) @definition.impl
1467
+ (mod_item name: (identifier) @name) @definition.module
1468
+
1469
+ ; Type aliases, const, static, macros
1470
+ (type_item name: (type_identifier) @name) @definition.type
1471
+ (const_item name: (identifier) @name) @definition.const
1472
+ (static_item name: (identifier) @name) @definition.static
1473
+ (macro_definition name: (identifier) @name) @definition.macro
1474
+
1475
+ ; Use statements
1476
+ (use_declaration argument: (_) @import.source) @import
1477
+
1478
+ ; Calls
1479
+ (call_expression function: (identifier) @call.name) @call
1480
+ (call_expression function: (field_expression field: (field_identifier) @call.name)) @call
1481
+ (call_expression function: (scoped_identifier name: (identifier) @call.name)) @call
1482
+ (call_expression function: (generic_function function: (identifier) @call.name)) @call
1483
+
1484
+ ; Struct literal construction: User { name: value }
1485
+ (struct_expression name: (type_identifier) @call.name) @call
1486
+
1487
+ ; Struct fields — named field declarations inside struct bodies
1488
+ (field_declaration_list
1489
+ (field_declaration
1490
+ name: (field_identifier) @name) @definition.property)
1491
+
1492
+ ; Write access: obj.field = value
1493
+ (assignment_expression
1494
+ left: (field_expression
1495
+ value: (_) @assignment.receiver
1496
+ field: (field_identifier) @assignment.property)
1497
+ right: (_)) @assignment
1498
+
1499
+ ; Write access: obj.field += value (compound assignment)
1500
+ (compound_assignment_expr
1501
+ left: (field_expression
1502
+ value: (_) @assignment.receiver
1503
+ field: (field_identifier) @assignment.property)
1504
+ right: (_)) @assignment
1505
+ `;
1506
+ // PHP queries - works with tree-sitter-php (php_only grammar)
1507
+ exports.PHP_QUERIES = `
1508
+ ; ── Namespace ────────────────────────────────────────────────────────────────
1509
+ (namespace_definition
1510
+ name: (namespace_name) @name) @definition.namespace
1511
+
1512
+ ; ── Classes ──────────────────────────────────────────────────────────────────
1513
+ (class_declaration
1514
+ name: (name) @name) @definition.class
1515
+
1516
+ ; ── Interfaces ───────────────────────────────────────────────────────────────
1517
+ (interface_declaration
1518
+ name: (name) @name) @definition.interface
1519
+
1520
+ ; ── Traits ───────────────────────────────────────────────────────────────────
1521
+ (trait_declaration
1522
+ name: (name) @name) @definition.trait
1523
+
1524
+ ; ── Enums (PHP 8.1) ──────────────────────────────────────────────────────────
1525
+ (enum_declaration
1526
+ name: (name) @name) @definition.enum
1527
+
1528
+ ; ── Top-level functions ───────────────────────────────────────────────────────
1529
+ (function_definition
1530
+ name: (name) @name) @definition.function
1531
+
1532
+ ; ── Methods (including constructors) ─────────────────────────────────────────
1533
+ (method_declaration
1534
+ name: (name) @name) @definition.method
1535
+
1536
+ ; ── Class properties (including Eloquent $fillable, $casts, etc.) ────────────
1537
+ (property_declaration
1538
+ (property_element
1539
+ (variable_name
1540
+ (name) @name))) @definition.property
1541
+
1542
+ ; Constructor property promotion (PHP 8.0+: public Address $address in __construct)
1543
+ (method_declaration
1544
+ parameters: (formal_parameters
1545
+ (property_promotion_parameter
1546
+ name: (variable_name
1547
+ (name) @name)))) @definition.property
1548
+
1549
+ ; ── Imports: use statements ──────────────────────────────────────────────────
1550
+ ; Simple: use App\\Models\\User;
1551
+ (namespace_use_declaration
1552
+ (namespace_use_clause
1553
+ (qualified_name) @import.source)) @import
1554
+
1555
+ ; ── Function/method calls ────────────────────────────────────────────────────
1556
+ ; Regular function call: foo()
1557
+ (function_call_expression
1558
+ function: (name) @call.name) @call
1559
+
1560
+ ; Method call: $obj->method()
1561
+ (member_call_expression
1562
+ name: (name) @call.name) @call
1563
+
1564
+ ; Nullsafe method call: $obj?->method()
1565
+ (nullsafe_member_call_expression
1566
+ name: (name) @call.name) @call
1567
+
1568
+ ; Static call: Foo::bar() (php_only uses scoped_call_expression)
1569
+ (scoped_call_expression
1570
+ name: (name) @call.name) @call
1571
+
1572
+ ; Constructor call: new User()
1573
+ (object_creation_expression (name) @call.name) @call
1574
+
1575
+ ; Const declarations at class scope
1576
+ (const_declaration
1577
+ (const_element
1578
+ (name) @name)) @definition.const
1579
+
1580
+ ; PHP HTTP consumers: file_get_contents('/path'), curl_init('/path')
1581
+ (function_call_expression
1582
+ function: (name) @_php_http (#match? @_php_http "^(file_get_contents|curl_init)$")
1583
+ arguments: (arguments
1584
+ (argument (string (string_content) @http_client.url)))) @http_client
1585
+
1586
+ ; Write access: $obj->field = value
1587
+ (assignment_expression
1588
+ left: (member_access_expression
1589
+ object: (_) @assignment.receiver
1590
+ name: (name) @assignment.property)
1591
+ right: (_)) @assignment
1592
+
1593
+ ; Write access: ClassName::$field = value (static property)
1594
+ (assignment_expression
1595
+ left: (scoped_property_access_expression
1596
+ scope: (_) @assignment.receiver
1597
+ name: (variable_name (name) @assignment.property))
1598
+ right: (_)) @assignment
1599
+
1600
+ ; ── Closure bindings (#2693) ────────────────────────────────────────────────
1601
+ ; A name bound to a closure literal IS a callable, so it emits Function rather
1602
+ ; than a value label — matching TS/JS and the languages #2687 already covered.
1603
+ ; The callable node is what callable-value-flow joins the binding to (by file,
1604
+ ; line and name), which is what makes $handler(1) resolve. Overlap with the value
1605
+ ; rules above is collapsed by the parse-worker dedup, which ranks callable
1606
+ ; highest (#2687).
1607
+ ; Captures the whole variable_name, so the node keeps PHP's \`$\` sigil. That is
1608
+ ; not cosmetic: PHP holds variables and functions in SEPARATE namespaces, so
1609
+ ; \`$save\` and \`save()\` can never collide in the language — but dropping the
1610
+ ; sigil made both mint the id Function:<file>:save, and the local closure was
1611
+ ; swallowed by the function's node (no node, therefore no edge). The property
1612
+ ; rules in languages/php/query.ts already keep the sigil for the same reason.
1613
+ ; The positional join normalises leading sigils, so the binding still matches
1614
+ ; its own declaration.
1615
+ (assignment_expression
1616
+ left: (variable_name) @name
1617
+ right: (arrow_function)) @definition.function
1618
+ (assignment_expression
1619
+ left: (variable_name) @name
1620
+ right: (anonymous_function)) @definition.function
1621
+ `;
1622
+ // Ruby queries - works with tree-sitter-ruby
1623
+ // NOTE: Ruby uses `call` for require, include, extend, prepend, attr_* etc.
1624
+ // These are all captured as @call and routed in JS post-processing:
1625
+ // - require/require_relative → import extraction
1626
+ // - include/extend/prepend → heritage (mixin) extraction
1627
+ // - attr_accessor/attr_reader/attr_writer → property definition extraction
1628
+ // - everything else → regular call extraction
1629
+ exports.RUBY_QUERIES = `
1630
+ ; ── Modules ──────────────────────────────────────────────────────────────────
1631
+ (module
1632
+ name: (constant) @name) @definition.module
1633
+
1634
+ ; Namespaced module: module Baz::Qux (name field is a scope_resolution node).
1635
+ ; Separate top-level pattern (not a [...] alternation) so neither branch is
1636
+ ; silently dropped — see #1975. The full scope_resolution text keys the node so
1637
+ ; it matches the HAS_METHOD owner id derived from the same name field.
1638
+ (module
1639
+ name: (scope_resolution) @name) @definition.module
1640
+
1641
+ ; ── Classes ──────────────────────────────────────────────────────────────────
1642
+ (class
1643
+ name: (constant) @name) @definition.class
1644
+
1645
+ ; Namespaced class: class Foo::Bar (name field is a scope_resolution node).
1646
+ (class
1647
+ name: (scope_resolution) @name) @definition.class
1648
+
1649
+ ; ── Instance methods ─────────────────────────────────────────────────────────
1650
+ (method
1651
+ name: (identifier) @name) @definition.method
1652
+
1653
+ ; ── Singleton (class-level) methods ──────────────────────────────────────────
1654
+ (singleton_method
1655
+ name: (identifier) @name) @definition.method
1656
+
1657
+ ; ── All calls (require, include, attr_*, and regular calls routed in JS) ─────
1658
+ (call
1659
+ method: (identifier) @call.name) @call
1660
+
1661
+ ; ── Constant assignment: MAX_SIZE = 100, ITEMS = [...] ───────────────────────
1662
+ (assignment
1663
+ left: (constant) @name) @definition.const
1664
+
1665
+ ; ── Bare calls without parens (identifiers at statement level are method calls) ─
1666
+ ; NOTE: This may over-capture variable reads as calls (e.g. 'result' at
1667
+ ; statement level). Ruby's grammar makes bare identifiers ambiguous — they
1668
+ ; could be local variables or zero-arity method calls. Post-processing via
1669
+ ; provider.isBuiltInName and symbol resolution filtering suppresses most false
1670
+ ; positives, but a variable name that coincidentally matches a method name
1671
+ ; elsewhere may produce a false CALLS edge.
1672
+ (body_statement
1673
+ (identifier) @call.name @call)
1674
+
1675
+ ; Write access: obj.field = value (Ruby setter — syntactically a method call to field=)
1676
+ (assignment
1677
+ left: (call
1678
+ receiver: (_) @assignment.receiver
1679
+ method: (identifier) @assignment.property)
1680
+ right: (_)) @assignment
1681
+
1682
+ ; Write access: obj.field += value (compound assignment — operator_assignment node, not assignment)
1683
+ (operator_assignment
1684
+ left: (call
1685
+ receiver: (_) @assignment.receiver
1686
+ method: (identifier) @assignment.property)
1687
+ right: (_)) @assignment
1688
+
1689
+ ; ── Closure bindings (#2693) ────────────────────────────────────────────────
1690
+ ; A name bound to a closure literal IS a callable, so it emits Function rather
1691
+ ; than a value label — matching TS/JS and the languages #2687 already covered.
1692
+ ; The callable node is what callable-value-flow joins the binding to (by file,
1693
+ ; line and name), which is what makes handler.call(1) resolve. Overlap with the value
1694
+ ; rules above is collapsed by the parse-worker dedup, which ranks callable
1695
+ ; highest (#2687).
1696
+ (assignment
1697
+ left: (identifier) @name
1698
+ right: (lambda)) @definition.function
1699
+
1700
+ ; The (lambda) rule above covers the stabby forms only. lambda do...end,
1701
+ ; proc do...end and Proc.new are (call) nodes, so without these the scope
1702
+ ; channel declared a closure the graph channel never gave a node to, and the
1703
+ ; call fell through to the enclosing method. Same two-channel lockstep Rust
1704
+ ; needed. Receiver constraints mirror ruby/query.ts exactly: bare for
1705
+ ; lambda/proc, Proc-constant for new — otherwise every block-taking call
1706
+ ; (items.map { }) would mint a Function node.
1707
+ (assignment
1708
+ left: (identifier) @name
1709
+ right: (call
1710
+ !receiver
1711
+ method: (identifier) @_lam
1712
+ block: [(block) (do_block)])
1713
+ (#eq? @_lam "lambda")) @definition.function
1714
+
1715
+ (assignment
1716
+ left: (identifier) @name
1717
+ right: (call
1718
+ !receiver
1719
+ method: (identifier) @_prc
1720
+ block: [(block) (do_block)])
1721
+ (#eq? @_prc "proc")) @definition.function
1722
+
1723
+ (assignment
1724
+ left: (identifier) @name
1725
+ right: (call
1726
+ receiver: (constant) @_pc
1727
+ method: (identifier) @_nw
1728
+ block: [(block) (do_block)])
1729
+ (#eq? @_pc "Proc")
1730
+ (#eq? @_nw "new")) @definition.function
1731
+ `;
1732
+ // Kotlin queries - works with tree-sitter-kotlin (fwcd/tree-sitter-kotlin)
1733
+ // Based on official tags.scm; functions use simple_identifier, classes use type_identifier
1734
+ exports.KOTLIN_QUERIES = `
1735
+ ; ── Interfaces ─────────────────────────────────────────────────────────────
1736
+ ; tree-sitter-kotlin (fwcd) has no interface_declaration node type.
1737
+ ; Interfaces are class_declaration nodes with an anonymous "interface" keyword child.
1738
+ (class_declaration
1739
+ "interface"
1740
+ (type_identifier) @name) @definition.interface
1741
+
1742
+ ; ── Classes (regular, data, sealed, enum) ────────────────────────────────
1743
+ ; All have the anonymous "class" keyword child. enum class has both
1744
+ ; "enum" and "class" children — the "class" child still matches.
1745
+ (class_declaration
1746
+ "class"
1747
+ (type_identifier) @name) @definition.class
1748
+
1749
+ ; ── Object declarations (Kotlin singletons) ──────────────────────────────
1750
+ (object_declaration
1751
+ (type_identifier) @name) @definition.class
1752
+
1753
+ ; ── Companion objects (named only) ───────────────────────────────────────
1754
+ (companion_object
1755
+ (type_identifier) @name) @definition.class
1756
+
1757
+ ; ── Functions (top-level, member, extension) ──────────────────────────────
1758
+ (function_declaration
1759
+ (simple_identifier) @name) @definition.function
1760
+
1761
+ ; ── Secondary constructors (F49 sibling F48, issue #1919) ────────────────
1762
+ ; "constructor(...) { }" inside a class body is a secondary_constructor with
1763
+ ; no name child — its only identity token is the anonymous "constructor"
1764
+ ; keyword, captured here as @name so the node is named "constructor"
1765
+ ; (matching kotlinMethodConfig.extractName). Multiple secondary constructors
1766
+ ; share that name but get distinct ids via the worker's #<arity> suffix.
1767
+ (secondary_constructor
1768
+ "constructor" @name) @definition.constructor
1769
+
1770
+ ; ── Properties ───────────────────────────────────────────────────────────
1771
+ (property_declaration
1772
+ (variable_declaration
1773
+ (simple_identifier) @name)) @definition.property
1774
+
1775
+ ; Lambda bindings: \`val f = { x -> x }\` binds a CALLABLE, so it emits Function
1776
+ ; rather than Property, matching TS/JS. This aligns the LABEL only — call
1777
+ ; resolution runs off the scope-resolution query, which still models the binding
1778
+ ; as a value, so \`f()\` does not resolve here yet. Overlap with the property
1779
+ ; pattern above is collapsed by the parse-worker dedup (#2687).
1780
+ (property_declaration
1781
+ (variable_declaration
1782
+ (simple_identifier) @name)
1783
+ (lambda_literal)) @definition.function
1784
+
1785
+ ; ── Destructuring declarations (F51, issue #1919) ────────────────────────
1786
+ ; "val (a, b) = pair" binds several names through a multi_variable_declaration
1787
+ ; (NOT a variable_declaration), which the property rule above misses. Emit one
1788
+ ; @definition.property per bound name — the SAME label every other Kotlin val/var
1789
+ ; gets (KOTLIN_QUERIES has no @definition.variable rule, so a single "val x"
1790
+ ; is already a Property; matching that keeps destructured names consistent and
1791
+ ; out of the block-scope local-symbol pruner that drops Variable/Const/Static).
1792
+ ; The Kotlin "_" discard placeholder is filtered out here via (#not-eq? @name "_")
1793
+ ; — these locals have no enclosing class, so the field-extractor enrichment path
1794
+ ; never runs and cannot do the filtering itself. Each rule is a standalone
1795
+ ; pattern (NOT a top-level [...] alternation), so the predicate is safe under
1796
+ ; tree-sitter 0.21.1 (no sibling-branch drop). Loop destructuring
1797
+ ; "for ((k, v) in m)" nests the SAME multi_variable_declaration directly under the
1798
+ ; for_statement (no property_declaration wrapper); the scope-path loop binding only
1799
+ ; handles the single variable_declaration form, so this rule does not double-emit.
1800
+ ((property_declaration
1801
+ (multi_variable_declaration
1802
+ (variable_declaration
1803
+ (simple_identifier) @name))) @definition.property
1804
+ (#not-eq? @name "_"))
1805
+
1806
+ ((for_statement
1807
+ (multi_variable_declaration
1808
+ (variable_declaration
1809
+ (simple_identifier) @name))) @definition.property
1810
+ (#not-eq? @name "_"))
1811
+
1812
+ ; Primary constructor val/var parameters (data class, value class, regular class)
1813
+ ; binding_pattern_kind contains "val" or "var" — without it, the param is not a property
1814
+ (class_parameter
1815
+ (binding_pattern_kind)
1816
+ (simple_identifier) @name) @definition.property
1817
+
1818
+ ; ── Enum entries ─────────────────────────────────────────────────────────
1819
+ (enum_entry
1820
+ (simple_identifier) @name) @definition.enum
1821
+
1822
+ ; ── Type aliases ─────────────────────────────────────────────────────────
1823
+ (type_alias
1824
+ (type_identifier) @name) @definition.type
1825
+
1826
+ ; ── Imports ──────────────────────────────────────────────────────────────
1827
+ (import_header
1828
+ (identifier) @import.source) @import
1829
+
1830
+ ; ── Function calls (direct) ──────────────────────────────────────────────
1831
+ (call_expression
1832
+ (simple_identifier) @call.name) @call
1833
+
1834
+ ; ── Method calls (via navigation: obj.method()) ──────────────────────────
1835
+ (call_expression
1836
+ (navigation_expression
1837
+ (navigation_suffix
1838
+ (simple_identifier) @call.name))) @call
1839
+
1840
+ ; ── Constructor invocations ──────────────────────────────────────────────
1841
+ (constructor_invocation
1842
+ (user_type
1843
+ (type_identifier) @call.name)) @call
1844
+
1845
+ ; ── Infix function calls (e.g., a to b, x until y) ──────────────────────
1846
+ ; tree-sitter-kotlin models infix_expression as three UNNAMED-FIELD children:
1847
+ ; (operand) (operator) (operand) — all three are simple_identifier for
1848
+ ; "a to b". The old rule "(infix_expression (simple_identifier) @call.name)"
1849
+ ; matched EVERY simple_identifier child, so it captured the operands a/b as
1850
+ ; spurious @call.name calls (F49, issue #1919). There is no operator: field to
1851
+ ; anchor on, so anchor positionally: the operator is the middle child, flanked
1852
+ ; by an operand on each side. End-anchored on both sides so only the lone
1853
+ ; middle simple_identifier (the infix function) is captured; chained
1854
+ ; "a to b to c" still matches each nested infix_expression's own operator.
1855
+ (infix_expression
1856
+ .
1857
+ (_)
1858
+ .
1859
+ (simple_identifier) @call.name
1860
+ .
1861
+ (_)
1862
+ .) @call
1863
+
1864
+ ; Write access: obj.field = value
1865
+ (assignment
1866
+ (directly_assignable_expression
1867
+ (_) @assignment.receiver
1868
+ (navigation_suffix
1869
+ (simple_identifier) @assignment.property))
1870
+ (_)) @assignment
1871
+
1872
+ `;
1873
+ // Swift queries - works with tree-sitter-swift
1874
+ exports.SWIFT_QUERIES = `
1875
+ ; Classes
1876
+ (class_declaration "class" name: (type_identifier) @name) @definition.class
1877
+
1878
+ ; Structs
1879
+ (class_declaration "struct" name: (type_identifier) @name) @definition.struct
1880
+
1881
+ ; Enums
1882
+ (class_declaration "enum" name: (type_identifier) @name) @definition.enum
1883
+
1884
+ ; Extensions (mapped to class — no dedicated label in schema)
1885
+ (class_declaration "extension" name: (user_type (type_identifier) @name)) @definition.class
1886
+
1887
+ ; Actors
1888
+ (class_declaration "actor" name: (type_identifier) @name) @definition.class
1889
+
1890
+ ; Protocols (mapped to interface)
1891
+ (protocol_declaration name: (type_identifier) @name) @definition.interface
1892
+
1893
+ ; Type aliases
1894
+ (typealias_declaration name: (type_identifier) @name) @definition.type
1895
+
1896
+ ; Functions (top-level and methods)
1897
+ (function_declaration name: (simple_identifier) @name) @definition.function
1898
+
1899
+ ; Protocol method declarations
1900
+ (protocol_function_declaration name: (simple_identifier) @name) @definition.method
1901
+
1902
+ ; Initializers
1903
+ (init_declaration) @definition.constructor
1904
+
1905
+ ; Properties (stored and computed)
1906
+ (property_declaration (pattern (simple_identifier) @name)) @definition.property
1907
+
1908
+ ; Closure bindings: \`let f = { ... }\` binds a CALLABLE, so it emits Function
1909
+ ; rather than Property, matching TS/JS. This aligns the LABEL only — call
1910
+ ; resolution runs off the scope-resolution query, which still models the binding
1911
+ ; as a value, so \`f()\` does not resolve here yet. Overlap with the property
1912
+ ; pattern above is collapsed by the parse-worker dedup (#2687).
1913
+ (property_declaration
1914
+ name: (pattern (simple_identifier) @name)
1915
+ value: (lambda_literal)) @definition.function
1916
+
1917
+ ; Protocol property requirements (F75): "var title: String { get }" parses to a
1918
+ ; protocol_property_declaration (NOT property_declaration). Its name is a
1919
+ ; "name:" pattern field wrapping a value_binding_pattern + the bound
1920
+ ; simple_identifier; match the inner identifier so the requirement is emitted
1921
+ ; as a property symbol of the protocol.
1922
+ (protocol_property_declaration (pattern (simple_identifier) @name)) @definition.property
1923
+
1924
+ ; Enum cases
1925
+ (enum_entry (simple_identifier) @name) @definition.property
1926
+
1927
+ ; Imports
1928
+ (import_declaration (identifier (simple_identifier) @import.source)) @import
1929
+
1930
+ ; Calls - direct function calls
1931
+ (call_expression (simple_identifier) @call.name) @call
1932
+
1933
+ ; Calls - member/navigation calls (obj.method())
1934
+ (call_expression (navigation_expression (navigation_suffix (simple_identifier) @call.name))) @call
1935
+
1936
+ ; Write access: obj.field = value (tree-sitter-swift 0.7.1 uses named fields)
1937
+ (assignment
1938
+ target: (directly_assignable_expression
1939
+ (navigation_expression
1940
+ target: (_) @assignment.receiver
1941
+ suffix: (navigation_suffix
1942
+ suffix: (simple_identifier) @assignment.property)))
1943
+ result: (_)) @assignment
1944
+
1945
+ `;
1946
+ // Dart queries - works with tree-sitter-dart (UserNobody14/tree-sitter-dart, ABI 14)
1947
+ // Note: Dart grammar has function_signature/method_signature as wrappers;
1948
+ // top-level functions are (program > function_signature),
1949
+ // methods inside classes are (method_signature > function_signature).
1950
+ // We match top-level functions via (program (function_signature ...)) to avoid
1951
+ // double-counting methods that also contain function_signature.
1952
+ exports.DART_QUERIES = `
1953
+ ; ── Classes ──────────────────────────────────────────────────────────────────
1954
+ (class_definition
1955
+ name: (identifier) @name) @definition.class
1956
+
1957
+ ; ── Mixins ───────────────────────────────────────────────────────────────────
1958
+ (mixin_declaration
1959
+ (identifier) @name) @definition.trait
1960
+
1961
+ ; ── Extensions ───────────────────────────────────────────────────────────────
1962
+ (extension_declaration
1963
+ name: (identifier) @name) @definition.class
1964
+
1965
+ ; ── Enums ────────────────────────────────────────────────────────────────────
1966
+ (enum_declaration
1967
+ name: (identifier) @name) @definition.enum
1968
+
1969
+ ; ── Type aliases — new-style (typedef Pred = bool Function(int);) ────────────
1970
+ ; Anchor "=" after the name to avoid capturing the RHS type. The name is the
1971
+ ; first type_identifier (the alias), the RHS function_type follows the "=".
1972
+ (type_alias
1973
+ (type_identifier) @name
1974
+ "=") @definition.type
1975
+
1976
+ ; ── Type aliases — old-style (typedef int Cmp(int a, int b);) ────────────────
1977
+ ; The old-style function typedef has NO "=" — it parses as a type_alias whose
1978
+ ; children are: return type_identifier, NAME type_identifier, formal_parameter_list.
1979
+ ; Anchor @name as the type_identifier immediately before the parameter list so we
1980
+ ; capture the alias name (Cmp), not the leading return type (int).
1981
+ (type_alias
1982
+ (type_identifier) @name
1983
+ .
1984
+ (formal_parameter_list)) @definition.type
1985
+
1986
+ ; ── Type aliases — generic old-style (typedef int Cmp<T>(T a, T b);) ─────────
1987
+ ; #1919 review CF2: a generic <T> inserts a type_parameters node between the
1988
+ ; NAME and the parameter list, so the non-generic adjacency above misses it.
1989
+ ; Standalone pattern (NOT an alternation arm) anchoring @name immediately before
1990
+ ; type_parameters, which is immediately before the parameter list. The new-style
1991
+ ; "=" rule above is unanchored and already covers generic new-style (Mapper<T>).
1992
+ (type_alias
1993
+ (type_identifier) @name
1994
+ .
1995
+ (type_parameters)
1996
+ .
1997
+ (formal_parameter_list)) @definition.type
1998
+
1999
+ ; ── Top-level functions (parent is program, not method_signature) ────────────
2000
+ (program
2001
+ (function_signature
2002
+ name: (identifier) @name) @definition.function)
2003
+
2004
+ ; ── Abstract method declarations (function_signature inside class body declaration) ──
2005
+ (declaration
2006
+ (function_signature
2007
+ name: (identifier) @name)) @definition.method
2008
+
2009
+ ; ── Methods (inside class/mixin/extension bodies) ────────────────────────────
2010
+ (method_signature
2011
+ (function_signature
2012
+ name: (identifier) @name)) @definition.method
2013
+
2014
+ ; ── Constructors ─────────────────────────────────────────────────────────────
2015
+ (constructor_signature
2016
+ name: (identifier) @name) @definition.constructor
2017
+
2018
+ ; ── Factory constructors (anchor before param list to capture variant name, not class) ──
2019
+ (method_signature
2020
+ (factory_constructor_signature
2021
+ (identifier) @name . (formal_parameter_list))) @definition.constructor
2022
+
2023
+ ; ── Field declarations (String name = '', Address address = Address()) ──────
2024
+ (declaration
2025
+ (type_identifier)
2026
+ (initialized_identifier_list
2027
+ (initialized_identifier
2028
+ (identifier) @name))) @definition.property
2029
+
2030
+ ; ── Nullable field declarations (String? name) ──────────────────────────────
2031
+ (declaration
2032
+ (nullable_type)
2033
+ (initialized_identifier_list
2034
+ (initialized_identifier
2035
+ (identifier) @name))) @definition.property
2036
+
2037
+ ; ── static const / static final / const class fields ────────────────────────
2038
+ ; A "static const a = 1;" / "static final String b = ..., c = ...;" field parses
2039
+ ; with a static_final_declaration_list (NOT an initialized_identifier_list), so
2040
+ ; the field rules above miss them. One @name per static_final_declaration, so a
2041
+ ; multi-name declaration yields a Property per name. Anchored on declaration (not
2042
+ ; class_body) so top-level final/const variables — whose
2043
+ ; static_final_declaration_list is a direct child of program, not wrapped in a
2044
+ ; declaration — never match here.
2045
+ (declaration
2046
+ (static_final_declaration_list
2047
+ (static_final_declaration
2048
+ (identifier) @name))) @definition.property
2049
+
2050
+ ; ── Getters ──────────────────────────────────────────────────────────────────
2051
+ (method_signature
2052
+ (getter_signature
2053
+ name: (identifier) @name)) @definition.property
2054
+
2055
+ ; ── Setters ──────────────────────────────────────────────────────────────────
2056
+ (method_signature
2057
+ (setter_signature
2058
+ name: (identifier) @name)) @definition.property
2059
+
2060
+ ; ── Top-level variable declarations ──────────────────────────────────────────
2061
+ ; Top-level Dart variables are NOT wrapped in a declaration node (that wrapper
2062
+ ; only occurs for class-body members). They sit as loose siblings under program:
2063
+ ; var name = 'x'; int x = 5; → initialized_identifier_list
2064
+ ; final int count = 3; const a = 1, b = 2; → static_final_declaration_list
2065
+ ; Anchor both rules under (program) so class-body fields (which reuse the same
2066
+ ; inner node types) are never matched here. One @name per declared name so
2067
+ ; multi-name forms (const a = 1, b = 2;) yield a Variable per name.
2068
+ (program
2069
+ (initialized_identifier_list
2070
+ (initialized_identifier
2071
+ (identifier) @name)) @definition.variable)
2072
+ ; Closure bindings: \`var f = (x) => x;\` binds a CALLABLE, so it emits Function
2073
+ ; rather than Variable, matching TS/JS. Overlap with the pattern above is
2074
+ ; collapsed by the parse-worker dedup (#2687). Since #2693 this node is also
2075
+ ; what makes \`f()\` resolve: the scope-resolution query declares the binding as
2076
+ ; a value, and callable-value-flow admits it as a call target precisely because
2077
+ ; the node it resolves to is a Function.
2078
+ (program
2079
+ (initialized_identifier_list
2080
+ (initialized_identifier
2081
+ (identifier) @name
2082
+ (function_expression))) @definition.function)
2083
+
2084
+ ; ── Top-level final/const closure bindings (#2693) ──────────────────────────
2085
+ ; \`final handler = (x) => x;\` parses as a static_final_declaration_list, not an
2086
+ ; initialized_identifier_list, so the rules above never reach it — \`final\` is
2087
+ ; the idiomatic top-level binding keyword and was the one closure form getting
2088
+ ; neither the callable label nor resolution.
2089
+ (program
2090
+ (static_final_declaration_list
2091
+ (static_final_declaration
2092
+ (identifier) @name
2093
+ (function_expression))) @definition.function)
2094
+
2095
+ ; ── Function-local closure bindings (#2693) ─────────────────────────────────
2096
+ ; \`void m() { var f = (x) => x; }\` — locals parse as initialized_variable_
2097
+ ; definition, which the top-level rules above never reach, so a local closure
2098
+ ; had no graph node at all and \`f()\` could not resolve. Restricted to a
2099
+ ; function_expression value: ordinary locals stay unindexed, as before.
2100
+ (initialized_variable_definition
2101
+ name: (identifier) @name
2102
+ value: (function_expression)) @definition.function
2103
+
2104
+ ; Second and later declarators of a multi-name local (\`var f = .., g = ..;\`)
2105
+ ; are initialized_identifier children NESTED INSIDE the same
2106
+ ; initialized_variable_definition, which the \`name:\`/\`value:\` field rule above
2107
+ ; only reaches for the FIRST name — so \`g\` silently had no node. Anchored on the
2108
+ ; inner node so each name gets its own range; the top-level form lives under
2109
+ ; initialized_identifier_list instead, so these never double-match.
2110
+ (initialized_variable_definition
2111
+ (initialized_identifier
2112
+ (identifier) @name
2113
+ (function_expression)) @definition.function)
2114
+ (program
2115
+ (static_final_declaration_list
2116
+ (static_final_declaration
2117
+ (identifier) @name)) @definition.variable)
2118
+
2119
+ ; ── Imports ──────────────────────────────────────────────────────────────────
2120
+ (import_or_export
2121
+ (library_import
2122
+ (import_specification
2123
+ (configurable_uri) @import.source))) @import
2124
+
2125
+ ; ── Calls: direct function/constructor calls (identifier immediately before argument_part) ──
2126
+ (expression_statement
2127
+ (identifier) @call.name
2128
+ .
2129
+ (selector (argument_part))) @call
2130
+
2131
+ ; ── Calls: method calls (obj.method()) ───────────────────────────────────────
2132
+ (expression_statement
2133
+ (selector
2134
+ (unconditional_assignable_selector
2135
+ (identifier) @call.name))) @call
2136
+
2137
+ ; ── Calls: in return statements (return User()) ─────────────────────────────
2138
+ (return_statement
2139
+ (identifier) @call.name
2140
+ (selector (argument_part))) @call
2141
+
2142
+ ; ── Calls: in variable assignments (var x = getUser()) ──────────────────────
2143
+ (initialized_variable_definition
2144
+ value: (identifier) @call.name
2145
+ (selector (argument_part))) @call
2146
+
2147
+ ; ── Calls: member calls in variable assignments (var x = obj.method()) ──────
2148
+ (initialized_variable_definition
2149
+ (selector
2150
+ (unconditional_assignable_selector
2151
+ (identifier) @call.name))
2152
+ (selector (argument_part))) @call
2153
+
2154
+ ; ── Calls: await direct (await doSomething()) ────────────────────────────────
2155
+ (await_expression
2156
+ (identifier) @call.name
2157
+ .
2158
+ (selector (argument_part))) @call
2159
+
2160
+ ; ── Calls: await method chain (await obj.method()) ───────────────────────────
2161
+ ; Requires argument_part to distinguish method calls from field access (await obj.field)
2162
+ (await_expression
2163
+ (selector
2164
+ (unconditional_assignable_selector
2165
+ (identifier) @call.name))
2166
+ (selector (argument_part))) @call
2167
+
2168
+ ; ── Calls: named argument (foo(child: buildX())) ─────────────────────────────
2169
+ (named_argument
2170
+ (identifier) @call.name
2171
+ .
2172
+ (selector (argument_part))) @call
2173
+
2174
+ ; ── Calls: inside list literals ([buildA(), buildB()]) ───────────────────────
2175
+ (list_literal
2176
+ (identifier) @call.name
2177
+ .
2178
+ (selector (argument_part))) @call
2179
+
2180
+ ; ── Calls: cascade (obj..add(x)..sort()) ─────────────────────────────────────
2181
+ ; Note: cascade_selector contains identifier directly (no unconditional_assignable_selector
2182
+ ; wrapper in Dart grammar), so inferCallForm() classifies these as free calls rather than
2183
+ ; member calls. Cross-file resolution still benefits from the call being recorded.
2184
+ (cascade_section
2185
+ (cascade_selector (identifier) @call.name)
2186
+ (argument_part)) @call
2187
+
2188
+ ; ── Calls: static final field initializers (static final _svc = MyService()) ──
2189
+ (static_final_declaration
2190
+ (identifier) @call.name
2191
+ .
2192
+ (selector (argument_part))) @call
2193
+
2194
+ ; ── Calls: arrow function body (=> buildWidget()) ────────────────────────────
2195
+ (function_body "=>"
2196
+ (identifier) @call.name
2197
+ .
2198
+ (selector (argument_part))) @call
2199
+
2200
+ ; ── Calls: lambda body (() => doSomething()) ─────────────────────────────────
2201
+ (function_expression_body
2202
+ (identifier) @call.name
2203
+ .
2204
+ (selector (argument_part))) @call
2205
+
2206
+ ; ── Re-exports (export 'foo.dart') ───────────────────────────────────────────
2207
+ (import_or_export
2208
+ (library_export
2209
+ (configurable_uri) @import.source)) @import
2210
+
2211
+ ; ── Write access: obj.field = value ──────────────────────────────────────────
2212
+ (assignment_expression
2213
+ left: (assignable_expression
2214
+ (identifier) @assignment.receiver
2215
+ (unconditional_assignable_selector
2216
+ (identifier) @assignment.property))
2217
+ right: (_)) @assignment
2218
+
2219
+ ; ── Write access: this.field = value ─────────────────────────────────────────
2220
+ (assignment_expression
2221
+ left: (assignable_expression
2222
+ (this) @assignment.receiver
2223
+ (unconditional_assignable_selector
2224
+ (identifier) @assignment.property))
2225
+ right: (_)) @assignment
2226
+ `;
2227
+ const index_js_1 = require("../../../shared/index.js");
2228
+ exports.LANGUAGE_QUERIES = {
2229
+ [index_js_1.SupportedLanguages.TypeScript]: exports.TYPESCRIPT_QUERIES,
2230
+ [index_js_1.SupportedLanguages.JavaScript]: exports.JAVASCRIPT_QUERIES,
2231
+ [index_js_1.SupportedLanguages.Python]: exports.PYTHON_QUERIES,
2232
+ [index_js_1.SupportedLanguages.Java]: exports.JAVA_QUERIES,
2233
+ [index_js_1.SupportedLanguages.C]: exports.C_QUERIES,
2234
+ [index_js_1.SupportedLanguages.Go]: exports.GO_QUERIES,
2235
+ [index_js_1.SupportedLanguages.CPlusPlus]: exports.CPP_QUERIES,
2236
+ [index_js_1.SupportedLanguages.CSharp]: exports.CSHARP_QUERIES,
2237
+ [index_js_1.SupportedLanguages.Rust]: exports.RUST_QUERIES,
2238
+ [index_js_1.SupportedLanguages.PHP]: exports.PHP_QUERIES,
2239
+ [index_js_1.SupportedLanguages.Kotlin]: exports.KOTLIN_QUERIES,
2240
+ [index_js_1.SupportedLanguages.Ruby]: exports.RUBY_QUERIES,
2241
+ [index_js_1.SupportedLanguages.Swift]: exports.SWIFT_QUERIES,
2242
+ [index_js_1.SupportedLanguages.Dart]: exports.DART_QUERIES,
2243
+ [index_js_1.SupportedLanguages.Vue]: exports.TYPESCRIPT_QUERIES, // Vue <script> blocks are parsed as TypeScript
2244
+ };