@aroman22/codegraph-vba-darwin-arm64 1.14.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/lib/dist/bin/codegraph.js +13 -7
  2. package/lib/dist/bin/codegraph.js.map +1 -1
  3. package/lib/dist/bin/daemon-release.d.ts +7 -0
  4. package/lib/dist/bin/daemon-release.d.ts.map +1 -0
  5. package/lib/dist/bin/daemon-release.js +18 -0
  6. package/lib/dist/bin/daemon-release.js.map +1 -0
  7. package/lib/dist/db/queries.d.ts +30 -0
  8. package/lib/dist/db/queries.d.ts.map +1 -1
  9. package/lib/dist/db/queries.js +51 -1
  10. package/lib/dist/db/queries.js.map +1 -1
  11. package/lib/dist/extraction/access-erd-extractor.d.ts +57 -0
  12. package/lib/dist/extraction/access-erd-extractor.d.ts.map +1 -0
  13. package/lib/dist/extraction/access-erd-extractor.js +389 -0
  14. package/lib/dist/extraction/access-erd-extractor.js.map +1 -0
  15. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  16. package/lib/dist/extraction/extraction-version.js +1 -1
  17. package/lib/dist/extraction/grammars.d.ts +20 -0
  18. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  19. package/lib/dist/extraction/grammars.js +34 -0
  20. package/lib/dist/extraction/grammars.js.map +1 -1
  21. package/lib/dist/extraction/index.d.ts +1 -0
  22. package/lib/dist/extraction/index.d.ts.map +1 -1
  23. package/lib/dist/extraction/index.js +371 -351
  24. package/lib/dist/extraction/index.js.map +1 -1
  25. package/lib/dist/extraction/parse-pool.d.ts +8 -3
  26. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  27. package/lib/dist/extraction/parse-pool.js +1 -2
  28. package/lib/dist/extraction/parse-pool.js.map +1 -1
  29. package/lib/dist/extraction/parse-worker.js +7 -6
  30. package/lib/dist/extraction/parse-worker.js.map +1 -1
  31. package/lib/dist/extraction/sql-query-extractor.d.ts +16 -14
  32. package/lib/dist/extraction/sql-query-extractor.d.ts.map +1 -1
  33. package/lib/dist/extraction/sql-query-extractor.js +43 -31
  34. package/lib/dist/extraction/sql-query-extractor.js.map +1 -1
  35. package/lib/dist/extraction/sql-table-scan.d.ts +184 -0
  36. package/lib/dist/extraction/sql-table-scan.d.ts.map +1 -0
  37. package/lib/dist/extraction/sql-table-scan.js +288 -0
  38. package/lib/dist/extraction/sql-table-scan.js.map +1 -0
  39. package/lib/dist/extraction/tree-sitter.d.ts +10 -1
  40. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  41. package/lib/dist/extraction/tree-sitter.js +34 -3
  42. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  43. package/lib/dist/extraction/vba/call-sweep.d.ts +2 -7
  44. package/lib/dist/extraction/vba/call-sweep.d.ts.map +1 -1
  45. package/lib/dist/extraction/vba/call-sweep.js +144 -90
  46. package/lib/dist/extraction/vba/call-sweep.js.map +1 -1
  47. package/lib/dist/extraction/vba/calls.d.ts +24 -4
  48. package/lib/dist/extraction/vba/calls.d.ts.map +1 -1
  49. package/lib/dist/extraction/vba/calls.js +42 -12
  50. package/lib/dist/extraction/vba/calls.js.map +1 -1
  51. package/lib/dist/extraction/vba/constants.d.ts +7 -14
  52. package/lib/dist/extraction/vba/constants.d.ts.map +1 -1
  53. package/lib/dist/extraction/vba/constants.js +8 -36
  54. package/lib/dist/extraction/vba/constants.js.map +1 -1
  55. package/lib/dist/extraction/vba/context.d.ts +443 -7
  56. package/lib/dist/extraction/vba/context.d.ts.map +1 -1
  57. package/lib/dist/extraction/vba/context.js +325 -29
  58. package/lib/dist/extraction/vba/context.js.map +1 -1
  59. package/lib/dist/extraction/vba/controls.d.ts +18 -1
  60. package/lib/dist/extraction/vba/controls.d.ts.map +1 -1
  61. package/lib/dist/extraction/vba/controls.js +99 -27
  62. package/lib/dist/extraction/vba/controls.js.map +1 -1
  63. package/lib/dist/extraction/vba/declarations.d.ts +1 -6
  64. package/lib/dist/extraction/vba/declarations.d.ts.map +1 -1
  65. package/lib/dist/extraction/vba/declarations.js +5 -39
  66. package/lib/dist/extraction/vba/declarations.js.map +1 -1
  67. package/lib/dist/extraction/vba/dims.d.ts +11 -7
  68. package/lib/dist/extraction/vba/dims.d.ts.map +1 -1
  69. package/lib/dist/extraction/vba/dims.js +265 -29
  70. package/lib/dist/extraction/vba/dims.js.map +1 -1
  71. package/lib/dist/extraction/vba/docmd.d.ts +29 -2
  72. package/lib/dist/extraction/vba/docmd.d.ts.map +1 -1
  73. package/lib/dist/extraction/vba/docmd.js +297 -18
  74. package/lib/dist/extraction/vba/docmd.js.map +1 -1
  75. package/lib/dist/extraction/vba/enums-consts.d.ts +7 -14
  76. package/lib/dist/extraction/vba/enums-consts.d.ts.map +1 -1
  77. package/lib/dist/extraction/vba/enums-consts.js +11 -45
  78. package/lib/dist/extraction/vba/enums-consts.js.map +1 -1
  79. package/lib/dist/extraction/vba/error-channel.d.ts +57 -0
  80. package/lib/dist/extraction/vba/error-channel.d.ts.map +1 -0
  81. package/lib/dist/extraction/vba/error-channel.js +128 -0
  82. package/lib/dist/extraction/vba/error-channel.js.map +1 -0
  83. package/lib/dist/extraction/vba/errors.d.ts +64 -0
  84. package/lib/dist/extraction/vba/errors.d.ts.map +1 -0
  85. package/lib/dist/extraction/vba/errors.js +775 -0
  86. package/lib/dist/extraction/vba/errors.js.map +1 -0
  87. package/lib/dist/extraction/vba/filesystem-statements.d.ts +23 -0
  88. package/lib/dist/extraction/vba/filesystem-statements.d.ts.map +1 -0
  89. package/lib/dist/extraction/vba/filesystem-statements.js +70 -0
  90. package/lib/dist/extraction/vba/filesystem-statements.js.map +1 -0
  91. package/lib/dist/extraction/vba/implements.d.ts +1 -6
  92. package/lib/dist/extraction/vba/implements.d.ts.map +1 -1
  93. package/lib/dist/extraction/vba/implements.js +1 -22
  94. package/lib/dist/extraction/vba/implements.js.map +1 -1
  95. package/lib/dist/extraction/vba/labels.d.ts +26 -0
  96. package/lib/dist/extraction/vba/labels.d.ts.map +1 -0
  97. package/lib/dist/extraction/vba/labels.js +180 -0
  98. package/lib/dist/extraction/vba/labels.js.map +1 -0
  99. package/lib/dist/extraction/vba/module-vars.d.ts +36 -0
  100. package/lib/dist/extraction/vba/module-vars.d.ts.map +1 -0
  101. package/lib/dist/extraction/vba/module-vars.js +145 -0
  102. package/lib/dist/extraction/vba/module-vars.js.map +1 -0
  103. package/lib/dist/extraction/vba/options.d.ts +88 -0
  104. package/lib/dist/extraction/vba/options.d.ts.map +1 -0
  105. package/lib/dist/extraction/vba/options.js +39 -0
  106. package/lib/dist/extraction/vba/options.js.map +1 -0
  107. package/lib/dist/extraction/vba/parameters.d.ts +35 -0
  108. package/lib/dist/extraction/vba/parameters.d.ts.map +1 -0
  109. package/lib/dist/extraction/vba/parameters.js +110 -0
  110. package/lib/dist/extraction/vba/parameters.js.map +1 -0
  111. package/lib/dist/extraction/vba/procedures.d.ts +1 -9
  112. package/lib/dist/extraction/vba/procedures.d.ts.map +1 -1
  113. package/lib/dist/extraction/vba/procedures.js +174 -112
  114. package/lib/dist/extraction/vba/procedures.js.map +1 -1
  115. package/lib/dist/extraction/vba/rules.d.ts +10 -5
  116. package/lib/dist/extraction/vba/rules.d.ts.map +1 -1
  117. package/lib/dist/extraction/vba/rules.js +19 -0
  118. package/lib/dist/extraction/vba/rules.js.map +1 -1
  119. package/lib/dist/extraction/vba/runtime-objects.d.ts +59 -0
  120. package/lib/dist/extraction/vba/runtime-objects.d.ts.map +1 -0
  121. package/lib/dist/extraction/vba/runtime-objects.js +106 -0
  122. package/lib/dist/extraction/vba/runtime-objects.js.map +1 -0
  123. package/lib/dist/extraction/vba/signature.d.ts +57 -0
  124. package/lib/dist/extraction/vba/signature.d.ts.map +1 -0
  125. package/lib/dist/extraction/vba/signature.js +164 -0
  126. package/lib/dist/extraction/vba/signature.js.map +1 -0
  127. package/lib/dist/extraction/vba/sql-wrapper.d.ts +76 -3
  128. package/lib/dist/extraction/vba/sql-wrapper.d.ts.map +1 -1
  129. package/lib/dist/extraction/vba/sql-wrapper.js +725 -151
  130. package/lib/dist/extraction/vba/sql-wrapper.js.map +1 -1
  131. package/lib/dist/extraction/vba/tempvars.d.ts.map +1 -1
  132. package/lib/dist/extraction/vba/tempvars.js +4 -0
  133. package/lib/dist/extraction/vba/tempvars.js.map +1 -1
  134. package/lib/dist/extraction/vba/text-utils.d.ts +62 -2
  135. package/lib/dist/extraction/vba/text-utils.d.ts.map +1 -1
  136. package/lib/dist/extraction/vba/text-utils.js +84 -6
  137. package/lib/dist/extraction/vba/text-utils.js.map +1 -1
  138. package/lib/dist/extraction/vba-extractor.d.ts +18 -1
  139. package/lib/dist/extraction/vba-extractor.d.ts.map +1 -1
  140. package/lib/dist/extraction/vba-extractor.js +111 -16
  141. package/lib/dist/extraction/vba-extractor.js.map +1 -1
  142. package/lib/dist/extraction/vba-form-extractor.d.ts +28 -14
  143. package/lib/dist/extraction/vba-form-extractor.d.ts.map +1 -1
  144. package/lib/dist/extraction/vba-form-extractor.js +56 -21
  145. package/lib/dist/extraction/vba-form-extractor.js.map +1 -1
  146. package/lib/dist/extraction/vba-preprocess.d.ts +89 -3
  147. package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -1
  148. package/lib/dist/extraction/vba-preprocess.js +221 -57
  149. package/lib/dist/extraction/vba-preprocess.js.map +1 -1
  150. package/lib/dist/extraction/vba-source.d.ts +0 -10
  151. package/lib/dist/extraction/vba-source.d.ts.map +1 -1
  152. package/lib/dist/extraction/vba-source.js +0 -13
  153. package/lib/dist/extraction/vba-source.js.map +1 -1
  154. package/lib/dist/extraction/vba-test-manifest-extractor.d.ts +0 -6
  155. package/lib/dist/extraction/vba-test-manifest-extractor.d.ts.map +1 -1
  156. package/lib/dist/extraction/vba-test-manifest-extractor.js +0 -1
  157. package/lib/dist/extraction/vba-test-manifest-extractor.js.map +1 -1
  158. package/lib/dist/index.d.ts.map +1 -1
  159. package/lib/dist/index.js +9 -0
  160. package/lib/dist/index.js.map +1 -1
  161. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  162. package/lib/dist/mcp/daemon-manager.js +7 -3
  163. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  164. package/lib/dist/mcp/daemon-paths.d.ts +6 -0
  165. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  166. package/lib/dist/mcp/daemon-paths.js +15 -0
  167. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  168. package/lib/dist/mcp/daemon-registry.d.ts +82 -7
  169. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  170. package/lib/dist/mcp/daemon-registry.js +557 -45
  171. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  172. package/lib/dist/mcp/daemon-watchdog.d.ts +12 -0
  173. package/lib/dist/mcp/daemon-watchdog.d.ts.map +1 -1
  174. package/lib/dist/mcp/daemon-watchdog.js +37 -7
  175. package/lib/dist/mcp/daemon-watchdog.js.map +1 -1
  176. package/lib/dist/mcp/daemon.d.ts +20 -1
  177. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  178. package/lib/dist/mcp/daemon.js +123 -30
  179. package/lib/dist/mcp/daemon.js.map +1 -1
  180. package/lib/dist/mcp/index.d.ts.map +1 -1
  181. package/lib/dist/mcp/index.js +13 -2
  182. package/lib/dist/mcp/index.js.map +1 -1
  183. package/lib/dist/mcp/proxy.d.ts +32 -0
  184. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  185. package/lib/dist/mcp/proxy.js +163 -31
  186. package/lib/dist/mcp/proxy.js.map +1 -1
  187. package/lib/dist/mcp/tools.d.ts.map +1 -1
  188. package/lib/dist/mcp/tools.js +29 -1
  189. package/lib/dist/mcp/tools.js.map +1 -1
  190. package/lib/dist/project-config.d.ts +43 -2
  191. package/lib/dist/project-config.d.ts.map +1 -1
  192. package/lib/dist/project-config.js +86 -2
  193. package/lib/dist/project-config.js.map +1 -1
  194. package/lib/dist/resolution/index.d.ts +47 -2
  195. package/lib/dist/resolution/index.d.ts.map +1 -1
  196. package/lib/dist/resolution/index.js +160 -5
  197. package/lib/dist/resolution/index.js.map +1 -1
  198. package/lib/dist/resolution/name-matcher.d.ts +25 -0
  199. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  200. package/lib/dist/resolution/name-matcher.js +59 -0
  201. package/lib/dist/resolution/name-matcher.js.map +1 -1
  202. package/lib/dist/resolution/vba-runtime-objects.d.ts +11 -11
  203. package/lib/dist/resolution/vba-runtime-objects.d.ts.map +1 -1
  204. package/lib/dist/resolution/vba-runtime-objects.js +18 -38
  205. package/lib/dist/resolution/vba-runtime-objects.js.map +1 -1
  206. package/lib/dist/types.d.ts +13 -5
  207. package/lib/dist/types.d.ts.map +1 -1
  208. package/lib/dist/types.js +17 -0
  209. package/lib/dist/types.js.map +1 -1
  210. package/lib/node_modules/.modules.yaml +1 -1
  211. package/lib/node_modules/.pnpm-workspace-state-v1.json +1 -1
  212. package/lib/package.json +4 -1
  213. package/package.json +1 -1
@@ -0,0 +1,88 @@
1
+ /**
2
+ * `VbaExtractionOptions` — the single object that carries every VBA
3
+ * extraction knob from `codegraph.json` down to `VbaExtractor` (issue #243).
4
+ *
5
+ * ## Why this module exists
6
+ *
7
+ * The knobs used to travel as positional parameters through five files:
8
+ *
9
+ * ```
10
+ * project-config.ts loadVbaConfig()
11
+ * -> extraction/index.ts reads vbaConfig
12
+ * -> extraction/parse-pool.ts ParseTask fields
13
+ * -> extraction/parse-worker.ts message shape
14
+ * -> extraction/tree-sitter.ts extractFromSource(..., vbaTargets, maxRaiseFanout, ...)
15
+ * -> new VbaExtractor(filePath, source, vbaTargets, maxRaiseFanout)
16
+ * ```
17
+ *
18
+ * Every new knob meant editing all five signatures and every call site. One
19
+ * object collapses that to "add a field here, read it in the extractor".
20
+ *
21
+ * ## Worker-boundary constraint — READ BEFORE ADDING A FIELD
22
+ *
23
+ * This object crosses the `parse-pool` -> `parse-worker` boundary through
24
+ * `worker.postMessage`, which is `structuredClone`-based. Every field MUST be
25
+ * plain, structured-cloneable data: primitives, plain objects, and arrays of
26
+ * those. NO functions, NO `RegExp`, NO `Map`/`Set`, NO class instances — a
27
+ * function throws `DataCloneError` at the boundary and a `RegExp` silently
28
+ * loses its `lastIndex`/identity semantics.
29
+ *
30
+ * A derived value that is not cloneable (a compiled wrapper `RegExp`, a
31
+ * lookup `Map`) belongs on the extractor context, built inside the extractor
32
+ * from the plain data in this object.
33
+ *
34
+ * This module is a LEAF: it imports nothing, so the config layer, the pool,
35
+ * the worker, and the extractor can all depend on it without a cycle.
36
+ */
37
+ /**
38
+ * Every VBA-specific extraction knob, in one structured-cloneable object.
39
+ *
40
+ * All fields are optional; `{}` is the zero-config default and must behave
41
+ * exactly like the pre-#243 "caller passed nothing" path.
42
+ */
43
+ export interface VbaExtractionOptions {
44
+ /**
45
+ * Conditional-compilation targets — the `#Const` name -> truth map used to
46
+ * decide which `#If` branches stay active. Sourced from `codegraph.json` ->
47
+ * `vba.targets`. Undefined means "no project overrides"; the preprocessor
48
+ * falls back to its built-in defaults.
49
+ */
50
+ targets?: Record<string, boolean>;
51
+ /**
52
+ * Issue #152: per-file fanout cap for `RaiseEvent <EventName>` edges. An
53
+ * event raised from more than this many sites in one file is flagged
54
+ * `metadata.highFanout: true` and ALL its `raises-event` edges are dropped.
55
+ * Undefined means the caller did not choose, so `VbaExtractor` applies
56
+ * `DEFAULT_MAX_RAISE_FANOUT` (50). Sourced from `codegraph.json` ->
57
+ * `vba.maxRaiseFanout`.
58
+ */
59
+ maxRaiseFanout?: number;
60
+ /**
61
+ * Names of project-specific procedures that wrap a SQL execution call
62
+ * (e.g. a shared `EjecutarSQL(sql)` helper), so a call to one of them is
63
+ * treated as a SQL execution site instead of an ordinary call.
64
+ *
65
+ * Declared here now and threaded end-to-end by #243; the SQL-wrapper task
66
+ * is the consumer. Kept as a `readonly string[]` of plain strings — the
67
+ * compiled matcher built from these names is NOT cloneable and therefore
68
+ * belongs on the extractor context, never in this object.
69
+ */
70
+ sqlWrappers?: readonly string[];
71
+ /**
72
+ * Issue #261 — the module-level variable names this project uses to carry
73
+ * an error message from where it happened to where the user sees it
74
+ * (`m_Error`, `p_Error`, a project's own `lastFailure`). A read or write of
75
+ * one of them is flagged `metadata.errorChannel: true`, and a handler that
76
+ * writes one is classified `behavior: 'channel'`.
77
+ *
78
+ * Bare VBA identifiers, matched as WHOLE names — never substrings, never
79
+ * user-supplied regex (this runs per identifier per line, the same reasoning
80
+ * `sqlWrappers` was built on). Sourced from `codegraph.json` →
81
+ * `vba.errorChannel`, and EXTENDS the built-in list rather than replacing
82
+ * it. Kept as plain strings for the same reason `sqlWrappers` is: the
83
+ * compiled `Set`/`RegExp` form cannot cross the `structuredClone` worker
84
+ * boundary, so it is built on the extractor context instead.
85
+ */
86
+ errorChannel?: readonly string[];
87
+ }
88
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /**
3
+ * `VbaExtractionOptions` — the single object that carries every VBA
4
+ * extraction knob from `codegraph.json` down to `VbaExtractor` (issue #243).
5
+ *
6
+ * ## Why this module exists
7
+ *
8
+ * The knobs used to travel as positional parameters through five files:
9
+ *
10
+ * ```
11
+ * project-config.ts loadVbaConfig()
12
+ * -> extraction/index.ts reads vbaConfig
13
+ * -> extraction/parse-pool.ts ParseTask fields
14
+ * -> extraction/parse-worker.ts message shape
15
+ * -> extraction/tree-sitter.ts extractFromSource(..., vbaTargets, maxRaiseFanout, ...)
16
+ * -> new VbaExtractor(filePath, source, vbaTargets, maxRaiseFanout)
17
+ * ```
18
+ *
19
+ * Every new knob meant editing all five signatures and every call site. One
20
+ * object collapses that to "add a field here, read it in the extractor".
21
+ *
22
+ * ## Worker-boundary constraint — READ BEFORE ADDING A FIELD
23
+ *
24
+ * This object crosses the `parse-pool` -> `parse-worker` boundary through
25
+ * `worker.postMessage`, which is `structuredClone`-based. Every field MUST be
26
+ * plain, structured-cloneable data: primitives, plain objects, and arrays of
27
+ * those. NO functions, NO `RegExp`, NO `Map`/`Set`, NO class instances — a
28
+ * function throws `DataCloneError` at the boundary and a `RegExp` silently
29
+ * loses its `lastIndex`/identity semantics.
30
+ *
31
+ * A derived value that is not cloneable (a compiled wrapper `RegExp`, a
32
+ * lookup `Map`) belongs on the extractor context, built inside the extractor
33
+ * from the plain data in this object.
34
+ *
35
+ * This module is a LEAF: it imports nothing, so the config layer, the pool,
36
+ * the worker, and the extractor can all depend on it without a cycle.
37
+ */
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/extraction/vba/options.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Issue #257 (task T16, half A): turn a procedure's already-parsed signature
3
+ * into `parameter` nodes.
4
+ *
5
+ * This module is EMISSION ONLY. The signature was parsed once by
6
+ * `signature.ts` — after the preprocessor joined `_` line continuations — and
7
+ * stamped onto the `function` node's `metadata.params` by `procedures.ts`.
8
+ * The same `VbaParameterInfo[]` is handed here, so a continued signature and
9
+ * its one-line equivalent produce byte-identical nodes by construction. Never
10
+ * re-parse the declaration line here; that is how the two views drift.
11
+ */
12
+ import { Node } from '../../types';
13
+ import { VbaExtractorContext } from './context';
14
+ import type { VbaParameterInfo } from './signature';
15
+ /**
16
+ * Emit one `parameter` node per declared parameter of `procedureNode`, the
17
+ * `contains` edge that binds it to its procedure, and — for a non-primitive
18
+ * declared type — a `type_of` edge onto the type's node.
19
+ *
20
+ * Parameters have no line of their own: VBA writes them inside the procedure
21
+ * header, and after continuation joining even the physical line is a fiction.
22
+ * So `startLine` / `endLine` are the procedure's declaration line, and the id
23
+ * is disambiguated by `<Procedure>.<param>` rather than by position — two
24
+ * accessors of the same property (`Property Get X` / `Property Let X`) sit on
25
+ * different lines and therefore still get distinct ids.
26
+ *
27
+ * `qualifiedName` is `<ModuleOrClass>.<Procedure>.<param>`, using
28
+ * `ctx.moduleName` (the resolved `Attribute VB_Name`, or the basename) rather
29
+ * than `ctx.classNamePrefix` — the latter is `null` for a `.bas`, and a
30
+ * parameter of a module-level Sub wants the module prefix just as much as a
31
+ * class method's does. Same choice the module-level `variable` nodes made in
32
+ * issue #251.
33
+ */
34
+ export declare function emitParameterNodes(ctx: VbaExtractorContext, procedureNode: Node, params: readonly VbaParameterInfo[], lineNum: number, line: string): void;
35
+ //# sourceMappingURL=parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/parameters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA4BpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,mBAAmB,EACxB,aAAa,EAAE,IAAI,EACnB,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,IAAI,CAgEN"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emitParameterNodes = emitParameterNodes;
4
+ const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
5
+ const constants_1 = require("./constants");
6
+ /**
7
+ * The type name a `type_of` edge should point at, or `null` when the
8
+ * declaration deserves no edge at all.
9
+ *
10
+ * This mirrors what `dims.ts` does for `Dim x As Foo`, deliberately:
11
+ *
12
+ * - an untyped parameter (implicit `Variant`) yields nothing;
13
+ * - a primitive (`Long`, `String`, `Variant`, …) yields nothing —
14
+ * `PRIMITIVE_TYPES` is the same gate the Dim sweep uses;
15
+ * - a qualified type (`As DAO.Recordset`) yields its OUTER segment, because
16
+ * that is the name the Dim sweep resolves and the only one a project
17
+ * declaration could ever match.
18
+ *
19
+ * The gate is intentionally coarse: `type_of` is emitted for anything that is
20
+ * not a primitive, and `resolveVbaReferenceStubs` decides afterwards whether a
21
+ * real project class of that name exists. A library type nobody declares keeps
22
+ * its stub, exactly as a `Dim r As DAO.Recordset` does today.
23
+ */
24
+ function typeEdgeTarget(declaredType) {
25
+ if (!declaredType)
26
+ return null;
27
+ const outer = declaredType.split('.')[0] ?? '';
28
+ if (!outer)
29
+ return null;
30
+ if (constants_1.PRIMITIVE_TYPES.has(outer.toLowerCase()))
31
+ return null;
32
+ return outer;
33
+ }
34
+ /**
35
+ * Emit one `parameter` node per declared parameter of `procedureNode`, the
36
+ * `contains` edge that binds it to its procedure, and — for a non-primitive
37
+ * declared type — a `type_of` edge onto the type's node.
38
+ *
39
+ * Parameters have no line of their own: VBA writes them inside the procedure
40
+ * header, and after continuation joining even the physical line is a fiction.
41
+ * So `startLine` / `endLine` are the procedure's declaration line, and the id
42
+ * is disambiguated by `<Procedure>.<param>` rather than by position — two
43
+ * accessors of the same property (`Property Get X` / `Property Let X`) sit on
44
+ * different lines and therefore still get distinct ids.
45
+ *
46
+ * `qualifiedName` is `<ModuleOrClass>.<Procedure>.<param>`, using
47
+ * `ctx.moduleName` (the resolved `Attribute VB_Name`, or the basename) rather
48
+ * than `ctx.classNamePrefix` — the latter is `null` for a `.bas`, and a
49
+ * parameter of a module-level Sub wants the module prefix just as much as a
50
+ * class method's does. Same choice the module-level `variable` nodes made in
51
+ * issue #251.
52
+ */
53
+ function emitParameterNodes(ctx, procedureNode, params, lineNum, line) {
54
+ if (params.length === 0)
55
+ return;
56
+ const procedureName = procedureNode.name;
57
+ const emitted = new Set();
58
+ for (let position = 0; position < params.length; position++) {
59
+ const param = params[position];
60
+ const name = param.name.trim();
61
+ // `parseSignature` never drops a fragment it cannot understand — a wrong
62
+ // arity is worse than a coarse one — so a nameless entry can reach here.
63
+ // It is not a symbol, so it gets no node.
64
+ if (!name)
65
+ continue;
66
+ const nodeId = (0, tree_sitter_helpers_1.generateNodeId)(ctx.filePath, 'parameter', `${procedureName}.${name}`, lineNum);
67
+ // VBA forbids two parameters of the same name on one signature; this only
68
+ // fires if a malformed declaration parsed into a repeat. Keep the first.
69
+ if (emitted.has(nodeId))
70
+ continue;
71
+ emitted.add(nodeId);
72
+ const qualifiedPrefix = ctx.moduleName
73
+ ? `${ctx.moduleName}.${procedureName}`
74
+ : procedureName;
75
+ ctx.nodes.push({
76
+ id: nodeId,
77
+ kind: 'parameter',
78
+ name,
79
+ qualifiedName: `${qualifiedPrefix}.${name}`,
80
+ filePath: ctx.filePath,
81
+ language: 'vba',
82
+ startLine: lineNum,
83
+ endLine: lineNum,
84
+ startColumn: 0,
85
+ endColumn: line.length,
86
+ metadata: {
87
+ position,
88
+ byRef: param.byRef,
89
+ optional: param.optional,
90
+ isArray: param.isArray,
91
+ hasDefault: param.hasDefault,
92
+ // An `As`-less parameter is `Variant` per VBA semantics. Recorded as
93
+ // the language's own default rather than left null, matching how
94
+ // issue #251 stamps `declaredType` on module-level variables.
95
+ declaredType: param.type ?? 'Variant',
96
+ },
97
+ updatedAt: Date.now(),
98
+ });
99
+ ctx.edges.push({
100
+ source: procedureNode.id,
101
+ target: nodeId,
102
+ kind: 'contains',
103
+ });
104
+ const typeName = typeEdgeTarget(param.type);
105
+ if (typeName) {
106
+ ctx.emitTypeOf(nodeId, typeName, lineNum, 0, 'vba-parameter-type');
107
+ }
108
+ }
109
+ }
110
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/extraction/vba/parameters.ts"],"names":[],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { VbaExtractorContext, ProcInfo, VbaClassifier } from './context';
1
+ import { VbaClassifier } from './context';
2
2
  import { VbaExtractionRule } from './rules';
3
3
  /**
4
4
  * Issue #153: the declarative rule table for the procedures concern.
@@ -17,12 +17,4 @@ import { VbaExtractionRule } from './rules';
17
17
  */
18
18
  export declare const RULES: readonly VbaExtractionRule<unknown>[];
19
19
  export declare function createProceduresClassifier(): VbaClassifier;
20
- /**
21
- * Backward-compat wrapper: pre-#83 callers (e.g. legacy test fixtures)
22
- * used `sweepProcedures(ctx, src)` and got back the ProcInfo[].
23
- * Now it returns `ctx.procedures` (the same flat list the factory
24
- * appends to). The implementation still calls the classifier once per
25
- * pre-split line, so the count is identical to the new walker path.
26
- */
27
- export declare function sweepProcedures(ctx: VbaExtractorContext, src: string): ProcInfo[];
28
20
  //# sourceMappingURL=procedures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAyB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA0DnE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAwNtD,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,aAAa,CAyC1D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,EAAE,CAOjF"}
1
+ {"version":3,"file":"procedures.d.ts","sourceRoot":"","sources":["../../../src/extraction/vba/procedures.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAY,aAAa,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAwB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgDlE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,iBAAiB,CAAC,OAAO,CAAC,EAwVtD,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,aAAa,CAS1D"}