@aroman22/codegraph-vba 1.5.2 → 1.6.1

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 (76) hide show
  1. package/README.md +11 -11
  2. package/dist/bin/codegraph.d.ts +1 -1
  3. package/dist/bin/command-supervision.d.ts +38 -1
  4. package/dist/db/index.d.ts +84 -5
  5. package/dist/db/migrations.d.ts +1 -1
  6. package/dist/db/queries.d.ts +116 -4
  7. package/dist/db/wal-valve.d.ts +106 -0
  8. package/dist/directory.d.ts +9 -5
  9. package/dist/extraction/cfml-extractor.d.ts +107 -0
  10. package/dist/extraction/grammars.d.ts +25 -1
  11. package/dist/extraction/index.d.ts +47 -2
  12. package/dist/extraction/languages/arkts.d.ts +3 -0
  13. package/dist/extraction/languages/c-cpp.d.ts +98 -0
  14. package/dist/extraction/languages/cfquery.d.ts +12 -0
  15. package/dist/extraction/languages/cfscript.d.ts +3 -0
  16. package/dist/extraction/languages/cobol.d.ts +33 -0
  17. package/dist/extraction/languages/erlang.d.ts +3 -0
  18. package/dist/extraction/languages/nix.d.ts +3 -0
  19. package/dist/extraction/languages/solidity.d.ts +3 -0
  20. package/dist/extraction/languages/terraform.d.ts +3 -0
  21. package/dist/extraction/languages/vbnet.d.ts +11 -0
  22. package/dist/extraction/mybatis-extractor.d.ts +30 -10
  23. package/dist/extraction/parse-pool.d.ts +28 -1
  24. package/dist/extraction/tree-sitter-types.d.ts +20 -1
  25. package/dist/extraction/tree-sitter.d.ts +60 -1
  26. package/dist/extraction/vba/call-sweep.d.ts +3 -0
  27. package/dist/extraction/vba/calls.d.ts +55 -0
  28. package/dist/extraction/vba/constants.d.ts +42 -0
  29. package/dist/extraction/vba/context.d.ts +175 -0
  30. package/dist/extraction/vba/controls.d.ts +24 -0
  31. package/dist/extraction/vba/declarations.d.ts +3 -0
  32. package/dist/extraction/vba/dims.d.ts +3 -0
  33. package/dist/extraction/vba/docmd.d.ts +16 -0
  34. package/dist/extraction/vba/enums-consts.d.ts +15 -0
  35. package/dist/extraction/vba/implements.d.ts +3 -0
  36. package/dist/extraction/vba/procedures.d.ts +3 -0
  37. package/dist/extraction/vba/sql-wrapper.d.ts +17 -0
  38. package/dist/extraction/vba/tempvars.d.ts +10 -0
  39. package/dist/extraction/vba/text-utils.d.ts +73 -0
  40. package/dist/extraction/vba-extractor.d.ts +3 -951
  41. package/dist/extraction/vba-preprocess.d.ts +1 -1
  42. package/dist/index.d.ts +81 -1
  43. package/dist/installer/index.d.ts +42 -0
  44. package/dist/mcp/daemon.d.ts +35 -3
  45. package/dist/mcp/early-ppid.d.ts +26 -0
  46. package/dist/mcp/liveness-watchdog.d.ts +18 -1
  47. package/dist/mcp/query-pool.d.ts +14 -0
  48. package/dist/mcp/session.d.ts +14 -0
  49. package/dist/mcp/startup-handshake.d.ts +44 -0
  50. package/dist/mcp/tools.d.ts +22 -0
  51. package/dist/project-config.d.ts +44 -0
  52. package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
  53. package/dist/resolution/callback-synthesizer.d.ts +1 -1
  54. package/dist/resolution/cooperative-yield.d.ts +32 -0
  55. package/dist/resolution/frameworks/cics.d.ts +20 -0
  56. package/dist/resolution/frameworks/terraform.d.ts +38 -0
  57. package/dist/resolution/goframe-synthesizer.d.ts +2 -1
  58. package/dist/resolution/import-resolver.d.ts +7 -0
  59. package/dist/resolution/index.d.ts +64 -2
  60. package/dist/resolution/name-matcher.d.ts +22 -3
  61. package/dist/resolution/strip-comments.d.ts +1 -1
  62. package/dist/resolution/types.d.ts +29 -0
  63. package/dist/resolution/workspace-packages.d.ts +10 -0
  64. package/dist/search/identifier-segments.d.ts +60 -0
  65. package/dist/sync/watcher.d.ts +10 -5
  66. package/dist/sync/worktree.d.ts +9 -0
  67. package/dist/types.d.ts +25 -2
  68. package/dist/upgrade/index.d.ts +34 -2
  69. package/dist/upgrade/remove-binary.d.ts +87 -0
  70. package/dist/upgrade/update-check.d.ts +92 -0
  71. package/npm-shim.js +33 -4
  72. package/package.json +7 -7
  73. package/dist/reasoning/config.d.ts +0 -45
  74. package/dist/reasoning/credentials.d.ts +0 -5
  75. package/dist/reasoning/login.d.ts +0 -21
  76. package/dist/reasoning/reasoner.d.ts +0 -43
@@ -25,6 +25,8 @@ export declare class TreeSitterExtractor {
25
25
  private errors;
26
26
  private extractor;
27
27
  private nodeStack;
28
+ private namespacePrefix;
29
+ private cppLocalFnPtrs;
28
30
  private methodIndex;
29
31
  private fnRefSpec;
30
32
  private fnRefCandidates;
@@ -427,6 +429,25 @@ export declare class TreeSitterExtractor {
427
429
  /**
428
430
  * Extract a function call
429
431
  */
432
+ /**
433
+ * The module an Erlang gen_server target expression statically names, or
434
+ * null when it's dynamic (pid/var/tuple form). Static shapes:
435
+ * - a bare atom — either this module or another one; OTP's dominant
436
+ * registration convention (`{local, ?MODULE}`) names a server process
437
+ * after its module, so `gen_server:call(other_mod, …)` reaches
438
+ * `other_mod`'s handlers. A registered name that matches no module
439
+ * resolves to nothing downstream (the qualified ref just drops).
440
+ * - `?MODULE`, or a macro the file defines as `?MODULE`
441
+ * (`-define(SERVER, ?MODULE)` — the standard self idiom)
442
+ * - a macro the file defines as a bare atom
443
+ * (`-define(STORE, kv_store)` — the cross-module variant)
444
+ * The macro tables are memoized per file (single entry — extraction is
445
+ * file-sequential).
446
+ */
447
+ private erlangServerMacroFile;
448
+ private erlangSelfMacros;
449
+ private erlangAtomMacros;
450
+ private resolveErlangGenServerTarget;
430
451
  private extractCall;
431
452
  /**
432
453
  * `new Foo(...)` / `Foo::new(...)` / object_creation_expression —
@@ -437,7 +458,37 @@ export declare class TreeSitterExtractor {
437
458
  * Children are still walked so nested calls inside the constructor
438
459
  * arguments (`new Foo(bar())`) get their own `calls` references.
439
460
  */
461
+ /**
462
+ * VB.NET `New Invoice(1)` is syntactically ambiguous between constructing
463
+ * Invoice with an argument and allocating an Invoice array of bound 1; the
464
+ * grammar parses the parenthesized form as array_creation_expression. A
465
+ * user-defined type with no `{...}` array initializer is overwhelmingly a
466
+ * constructor call, so treat it as an instantiation. Predefined element
467
+ * types (`New Byte(1023)`) and brace-initialized forms stay arrays.
468
+ */
469
+ private isVbnetConstructorShapedArrayCreation;
440
470
  private extractInstantiation;
471
+ /**
472
+ * Is this C++ `declaration` a stack/direct-initialization object construction
473
+ * that invokes a constructor — `Calculator calc(0)` (direct-init) or
474
+ * `Widget w{1, 2}` (brace-init) — as opposed to a plain variable or a
475
+ * function declaration? Used to emit an `instantiates` edge for the
476
+ * call-less construction syntax (#1035); heap `new T(...)` is handled
477
+ * separately by INSTANTIATION_KINDS.
478
+ *
479
+ * Two signals, both required:
480
+ * - the `type` field is a class-like NAMED type (`type_identifier`,
481
+ * `template_type`, or `qualified_identifier`). Primitives (`int x(0)`),
482
+ * `auto` (`placeholder_type_specifier` — that form always carries a real
483
+ * `call_expression`, already handled), and sized specifiers are excluded —
484
+ * they construct no class; and
485
+ * - a declarator carries constructor arguments: an `init_declarator` whose
486
+ * `value` is an `argument_list` (`(args)`) or `initializer_list` (`{args}`).
487
+ * This skips default construction `Calculator c;` (no value) and the
488
+ * most-vexing-parse `Calculator c();` (a bodyless `function_declarator`,
489
+ * a function decl — not a construction).
490
+ */
491
+ private isCppStackConstruction;
441
492
  /**
442
493
  * Static-member / value-read pass. A type/enum/class used only via a member
443
494
  * VALUE — `Enum.value`, `Type.CONST`, `Colors.red`, `Foo::BAR` — recorded no
@@ -507,6 +558,14 @@ export declare class TreeSitterExtractor {
507
558
  * heuristic — no false edges (resolution still validates each path).
508
559
  */
509
560
  private extractRustRouteMacro;
561
+ /**
562
+ * Record a C++ local function-pointer binding (`local = &fn` / `&fn<…>` /
563
+ * `&ns::fn<…>`) for the CURRENT enclosing symbol, so calls through the local
564
+ * resolve to the real target (see cppLocalFnPtrs). Only the address-of shape
565
+ * is accepted — a bare-identifier RHS (`auto x = y;`) is any value copy, and
566
+ * linking through it would guess.
567
+ */
568
+ private recordCppFnPtrBinding;
510
569
  private visitFunctionBody;
511
570
  /**
512
571
  * Extract inheritance relationships
@@ -643,5 +702,5 @@ export declare class TreeSitterExtractor {
643
702
  * those names and the file's language are run after the tree-sitter pass.
644
703
  * Their nodes/references/errors are merged into the returned result.
645
704
  */
646
- export declare function extractFromSource(filePath: string, source: string, language?: Language, frameworkNames?: string[]): ExtractionResult;
705
+ export declare function extractFromSource(filePath: string, source: string, language?: Language, frameworkNames?: string[], vbaTargets?: Record<string, boolean>): ExtractionResult;
647
706
  //# sourceMappingURL=tree-sitter.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { VbaExtractorContext } from './context';
2
+ export declare function sweepCallsAndSql(ctx: VbaExtractorContext, src: string): void;
3
+ //# sourceMappingURL=call-sweep.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { VbaExtractorContext, ProcInfo } from './context';
2
+ export declare function scanRaiseEvents(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
3
+ export declare function scanCallSites(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
4
+ /**
5
+ * Issue #45: split a single-line VBA `If <cond> Then <body>` into one or
6
+ * more statement-clause fragments the statement-call detectors can process
7
+ * (`If x Then Foo Else Bar`, colon-separated `If x Then DoA: DoB`). When the
8
+ * line is not a single-line `If … Then` shape, returns `[<line>]` so
9
+ * block-form `If` still works through the per-line scan. `GoTo`/`Exit`/
10
+ * `Resume` clauses are filtered out. `line` is the string-literal-masked
11
+ * scan line, which makes global `:`/`Else` splitting safe.
12
+ */
13
+ export declare function splitSingleLineIfClauses(line: string): string[];
14
+ /**
15
+ * H1: detect a statement-form Sub call (`MySub`, `MySub arg1, x`,
16
+ * `Call MySub arg1`). Returns the called proc name, or null for
17
+ * declarations, assignments, comments, keyword lines, and the paren form
18
+ * (handled by CALL_RE).
19
+ */
20
+ export declare function detectStatementCall(line: string): string | null;
21
+ /**
22
+ * H1: emit a same-file `calls` edge for a statement-form Sub call to the
23
+ * already-emitted function node named `procName`.
24
+ */
25
+ export declare function emitStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, procName: string, lineNum: number): void;
26
+ /**
27
+ * Fix 7: detect a qualified statement-form call — `Receiver.Member <args>`
28
+ * where `Receiver.Member` is NOT followed by `(`. Distinct from the paren
29
+ * form (handled by CALL_RE). Property assignments and blacklisted
30
+ * receivers/members are excluded. Returns `{receiver, member}` or null.
31
+ */
32
+ export declare function detectQualifiedStatementCall(line: string): {
33
+ receiver: string;
34
+ member: string;
35
+ } | null;
36
+ /**
37
+ * Fix 7: emit a heuristic `calls` edge for a qualified statement-form call.
38
+ * Same shape as the qualified-paren path in `scanCallSites` — reuses the
39
+ * same `callDedupe` / `synthFunctionNodeIds` sets so a paren and non-paren
40
+ * form on the same line don't create duplicate edges.
41
+ */
42
+ export declare function emitQualifiedStatementCallEdge(ctx: VbaExtractorContext, caller: ProcInfo, receiver: string, member: string, lineNum: number): void;
43
+ /**
44
+ * Issue #43: normalize the receiver of a `With <expr>` block to a bare
45
+ * identifier, or null when it is a keyword / runtime object / unparseable.
46
+ */
47
+ export declare function normalizeWithReceiver(expr: string): string | null;
48
+ /**
49
+ * Issue #43: detect a `.Member` call inside a `With` block (leading-dot
50
+ * member reference that is a call, not a property assignment).
51
+ */
52
+ export declare function detectWithMemberCall(line: string): {
53
+ member: string;
54
+ } | null;
55
+ //# sourceMappingURL=calls.d.ts.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Shared regexes and lookup sets used by more than one VBA extraction pass.
3
+ * Kept in a leaf module so the per-concern pass modules can import them
4
+ * without depending on each other or on the orchestrator.
5
+ */
6
+ /** Sub/Function/Property regex — captures visibility prefix, kind, and name. */
7
+ export declare const PROC_RE: RegExp;
8
+ /**
9
+ * Issue #52: shared `End Sub` / `End Function` / `End Property` marker.
10
+ * Promoted from a local regex in `sweepCallsAndSql` so `sweepEnumsAndConsts`
11
+ * can walk the same proc boundaries and decide Const scope per line.
12
+ * The `(?:^|:\s*)` prefix tolerates colon-separated single-line procs
13
+ * (`Public Sub X(): ... : End Sub`) so the proc stack pops on the same
14
+ * physical line.
15
+ */
16
+ export declare const PROCEDURE_END_RE: RegExp;
17
+ /**
18
+ * VBA primitive type names — skipped when emitted as Dim targets so
19
+ * we don't pollute the graph with `As Long` / `As String` references.
20
+ * Fix 4: all entries are LOWERCASE and the lookup lowercases the
21
+ * captured type name so `As long`, `As LONG`, `As Long` all match.
22
+ * Fix 1 (Issue #1): added `'new'` as a backstop so that if the `As New`
23
+ * pattern is ever captured as a type name it is silently skipped.
24
+ */
25
+ export declare const PRIMITIVE_TYPES: Set<string>;
26
+ /** Keywords we never want to match as call receivers. */
27
+ export declare const CALL_KEYWORD_BLACKLIST: Set<string>;
28
+ /**
29
+ * Access runtime objects and singletons. Calls on these receivers are
30
+ * real VBA calls but the targets are NOT user-defined modules or
31
+ * classes — they're Access/DAO/ADO runtime types. Synthesizing a
32
+ * `function` node for each would pollute the graph with ~20+ junk
33
+ * nodes per real-world file (audit W4, June 2026). Skip synthesis
34
+ * for any receiver or member in this set.
35
+ *
36
+ * Note: `DoCmd.RunSQL`, `DoCmd.OpenForm`, etc. still get SQL/edge
37
+ * tracking via the dedicated `SQL_WRAPPERS` regex path (REQ-CODE-8),
38
+ * which fires BEFORE this scan and uses its own dispatch — so
39
+ * blacklisting DoCmd here doesn't lose the SQL-flow edges.
40
+ */
41
+ export declare const RUNTIME_RECEIVER_BLACKLIST: Set<string>;
42
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,175 @@
1
+ /**
2
+ * VbaExtractorContext — the shared state + shared helpers threaded through
3
+ * every VBA extraction pass.
4
+ *
5
+ * It owns the node/edge/reference accumulators, the per-file lookup maps
6
+ * (`localProcs`, `functionNodeByName`, `localVarTypeMap`, `localConstants`,
7
+ * `localEvents`), the lazily-created module/class node, and the de-dup caches.
8
+ * The per-concern sweeps under `src/extraction/vba/*` are free functions that
9
+ * take a `VbaExtractorContext` and read/write this shared state; the handful
10
+ * of helpers that more than one sweep needs (`emitReference`,
11
+ * `pushContainsFromModule`, `findOrCreateFunctionNodeId`, the qualified-call
12
+ * gates, and the per-scope Const lookup) live here as methods.
13
+ */
14
+ import { Node, Edge, ExtractionError, UnresolvedReference } from '../../types';
15
+ export interface ProcInfo {
16
+ name: string;
17
+ qualifiedName: string;
18
+ kind: 'sub' | 'function' | 'property';
19
+ visibility: 'public' | 'private' | 'protected' | 'internal';
20
+ startLine: number;
21
+ }
22
+ export declare class VbaExtractorContext {
23
+ filePath: string;
24
+ nodes: Node[];
25
+ edges: Edge[];
26
+ errors: ExtractionError[];
27
+ unresolvedReferences: UnresolvedReference[];
28
+ moduleOrClassNode: Node | null;
29
+ /**
30
+ * Class-name prefix for `qualifiedName` composition.
31
+ *
32
+ * B3 (hueco 5): for `.cls` files every function node's `qualifiedName`
33
+ * is composed as `${className}.${procName}` (e.g. `Form_TestForm.Form_Load`)
34
+ * so cross-class callers can disambiguate which form each `Form_Load`
35
+ * belongs to. For `.bas` files this is `null` — module-scoped procs keep
36
+ * their bare-name `qualifiedName`. Resolved once per `extract()` from
37
+ * `isCls` + `vbName`; `sweepProcedures` reads it.
38
+ */
39
+ classNamePrefix: string | null;
40
+ /**
41
+ * Map of procedure name (within this file) → list of ProcInfo. The list
42
+ * (rather than a single value) is needed because VBA allows multiple
43
+ * Property accessors with the same name: `Property Get Foo`, `Property
44
+ * Let Foo`, and `Property Set Foo` all share the name `Foo`.
45
+ */
46
+ localProcs: Map<string, ProcInfo[]>;
47
+ /**
48
+ * Cache: procedure name → first matching function node emitted for that
49
+ * name (audit S2 — O(1) same-file call resolution).
50
+ */
51
+ functionNodeByName: Map<string, Node>;
52
+ /**
53
+ * Cache: startLine → function node emitted for that line. When Property
54
+ * Get/Let/Set share a name, we find the SPECIFIC accessor's node by its
55
+ * declaration line (Fix 1).
56
+ */
57
+ functionNodeByStartLine: Map<number, Node>;
58
+ /** Edges whose source needs to be set to the module/class id once it exists. */
59
+ pendingModuleOrClassSource: Edge[];
60
+ /** Cache so we don't re-emit the same proc function node per call site. */
61
+ procNodeIdCache: Map<string, string>;
62
+ callDedupe: Set<string>;
63
+ synthFunctionNodeIds: Set<string>;
64
+ /**
65
+ * B4 (hueco 6) extended by Issue #48: cache of stub node ids we've already
66
+ * emitted for a given (method, target name) pair in this file. Keyed by
67
+ * `${cacheKey}:${lowerName}` so the OpenForm and OpenReport de-dup buckets
68
+ * stay disjoint.
69
+ */
70
+ opensStubIdsByKey: Map<string, string>;
71
+ synthClassNodeIds: Set<string>;
72
+ /**
73
+ * Issue #50: TempVars placeholder-node de-dup cache. Keys are the
74
+ * deterministic node ids produced by `emitTempVarReference` — those ids
75
+ * intentionally use a synthetic `synthetic:tempvar/<key>` path so the SAME
76
+ * key referenced from Form_A.cls AND Form_B.cls collapses to ONE node.
77
+ */
78
+ synthTempVarNodeIds: Set<string>;
79
+ /**
80
+ * Maps `variableName.toLowerCase()` → declared type info.
81
+ * Built by `sweepDimsAndWithEvents`; consulted by the unified qualified-call
82
+ * gate (`shouldProcessQualifiedCall`) so declared project-class locals emit
83
+ * edges, declared primitive/external locals stay silent, and undeclared
84
+ * receivers remain module-name candidates for the resolver (Fix 2 / Issue #2).
85
+ */
86
+ localVarTypeMap: Map<string, {
87
+ outer: string;
88
+ qualified: boolean;
89
+ withEvents?: boolean;
90
+ variableName?: string;
91
+ assignedWithSet?: boolean;
92
+ }>;
93
+ /**
94
+ * Issue #52: Const resolution buckets, scoped per procedure. Key is
95
+ * `'module'` for module-level Consts, or the procedure's `startLine`
96
+ * (stringified) for proc-local Consts. Each bucket maps the lowercase
97
+ * constant name to its simple-literal value (used by `DoCmd.OpenForm` /
98
+ * `OpenReport` / `OpenQuery` argument resolution via `resolveLocalConst`).
99
+ */
100
+ localConstants: Map<'module' | string, Map<string, string>>;
101
+ /**
102
+ * Issue #52: the current Const-lookup scope. `'module'` when no procedure
103
+ * is open, otherwise the top-of-stack proc's `startLine` as a string. Both
104
+ * `sweepEnumsAndConsts` and `sweepCallsAndSql` keep this in sync with their
105
+ * per-line stack walk.
106
+ */
107
+ currentProcKey: 'module' | string;
108
+ /**
109
+ * Issue #52: per-extraction proc-stack shared between `sweepEnumsAndConsts`
110
+ * and `sweepCallsAndSql`. Each sweep clears it at the start so the file's
111
+ * mid-proc structural state never leaks across sweeps. Holds the `startLine`
112
+ * of every procedure whose `End` marker the sweep has not yet seen.
113
+ */
114
+ procStack: number[];
115
+ /** Local event name (lowercase) → event node for `RaiseEvent` edge emission. */
116
+ localEvents: Map<string, Node>;
117
+ constructor(filePath: string);
118
+ /**
119
+ * Emit a `contains` edge from the (lazily-created) module/class node to
120
+ * `targetId`. Mirrors the pending-source pattern the procedure and
121
+ * implements sweeps use: the module node doesn't exist yet, so the edge's
122
+ * source is rewritten once `extract()` creates it.
123
+ */
124
+ pushContainsFromModule(targetId: string): void;
125
+ /**
126
+ * Fix 2 (Issue #2): return true iff `receiverName` is a file-local variable
127
+ * (appears in `localVarTypeMap`) whose declared type is a SIMPLE (non-
128
+ * qualified, non-primitive) identifier — a candidate project-defined class.
129
+ * Qualified types (e.g. `DAO.Recordset`) and primitives (`String`, `Long`)
130
+ * return false so runtime/DAO calls are suppressed. Brackets are stripped
131
+ * from the lookup key defensively (Issue #54).
132
+ */
133
+ isLocalProjectClassVar(receiverName: string): boolean;
134
+ /**
135
+ * Qualified-call eligibility is intentionally shared by paren-form
136
+ * (`Receiver.Member(...)`) and statement-form (`Receiver.Member args`) scans:
137
+ * project-class locals are processed after type resolution, declared
138
+ * primitive/external locals are silent, and undeclared receivers remain
139
+ * candidate module names.
140
+ */
141
+ shouldProcessQualifiedCall(receiverName: string): boolean;
142
+ /**
143
+ * #12a: resolve the "receiver type" used to build a qualified call-stub's
144
+ * name/qualifiedName. When `receiverName` is a file-local variable typed
145
+ * as a candidate project class (`isLocalProjectClassVar`), returns the
146
+ * RESOLVED CLASS NAME from `localVarTypeMap` (e.g. `m_NCOp As NCOperaciones`
147
+ * → `'NCOperaciones'`) so the stub matches the real `.cls` method's
148
+ * `${className}.${proc}` shape. Otherwise returns `receiverName` unchanged
149
+ * (the `.bas`-qualified module call case).
150
+ */
151
+ resolveReceiverType(receiverName: string): string;
152
+ findOrCreateFunctionNodeId(proc: ProcInfo): string;
153
+ findFunctionNodeByName(name: string): Node | undefined;
154
+ /**
155
+ * Emit a `references` edge from the file's module/class node to a synthetic
156
+ * node named `targetName`. Used by Dim, WithEvents, Set-New, and SQL sweeps.
157
+ * Fix 5: the synthetic node id is keyed on (filePath, kind, name) WITHOUT
158
+ * lineNum so the same type/table referenced on N lines produces ONE node.
159
+ */
160
+ emitReference(targetName: string, lineNum: number, column: number, synthesizedBy: string): void;
161
+ /**
162
+ * Issue #52: shared lookup helper for `scanDoCmdOpenCalls` and
163
+ * `scanDoCmdOpenQuery`. The current scope is the procedure whose
164
+ * `startLine` is on top of `procStack` (or `'module'` when empty).
165
+ * Per-proc bucket first; module bucket is the fallback.
166
+ */
167
+ resolveLocalConst(name: string): string | undefined;
168
+ /**
169
+ * Issue #52: shared writer. `scopeKey` is `'module'` or the procedure's
170
+ * startLine-as-string. Creates the bucket lazily. Returns the bucket the
171
+ * value was written to (mostly useful for tests).
172
+ */
173
+ setLocalConstInScope(scopeKey: 'module' | string, name: string, value: string): Map<string, string>;
174
+ }
175
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Control-reference sweeps: `Me.<Control>` / `Me!<Control>` (hueco 1, issue
3
+ * #44) and cross-form `Forms!<Form>` / `Forms("<Form>")!<Ctl>` bang refs
4
+ * (issue #44). Both emit `UnresolvedReference`s (no synthetic `function`
5
+ * node) the resolver later binds to the form's controls.
6
+ */
7
+ import { VbaExtractorContext, ProcInfo } from './context';
8
+ /**
9
+ * Hueco 1: scan a line for `Me.<ControlName>` / `Me!<ControlName>`
10
+ * patterns and emit one UnresolvedReference per occurrence, tagged
11
+ * `metadata.synthesizedBy: 'vba-me-control'`. Operates on the masked
12
+ * `callScanLine`. The +3 column offset skips the 3-char `Me.` / `Me!`
13
+ * prefix (both are 3 chars).
14
+ */
15
+ export declare function scanMeControlReferences(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
16
+ /**
17
+ * Issue #44: scan a line for cross-form bang references
18
+ * (`Forms!<FormName>[!<Ctl>]` and `Forms("<FormName>")!<Ctl>`) and
19
+ * emit ONE UnresolvedReference per match with `metadata.synthesizedBy
20
+ * = 'vba-forms-bang'`. Operates on the ORIGINAL (unmasked) line. The form
21
+ * identifier is unwrapped of surrounding `"` quotes and `[…]` brackets.
22
+ */
23
+ export declare function scanFormsBang(ctx: VbaExtractorContext, line: string, from: ProcInfo, lineNum: number): void;
24
+ //# sourceMappingURL=controls.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { VbaExtractorContext } from './context';
2
+ export declare function sweepEventsTypesAndDeclares(ctx: VbaExtractorContext, src: string): number;
3
+ //# sourceMappingURL=declarations.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { VbaExtractorContext } from './context';
2
+ export declare function sweepDimsAndWithEvents(ctx: VbaExtractorContext, src: string): number;
3
+ //# sourceMappingURL=dims.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { VbaExtractorContext, ProcInfo } from './context';
2
+ /**
3
+ * B4 (hueco 6) extended by Issue #48: scan one line of VBA source for
4
+ * `DoCmd.OpenX "Target"` calls where X ∈ {Form, Report}. For each match emit
5
+ * a cached stub node (form-layout / report-layout) and an
6
+ * `opens-form` / `opens-report` heuristic edge from the calling Sub.
7
+ */
8
+ export declare function scanDoCmdOpenCalls(ctx: VbaExtractorContext, line: string, caller: ProcInfo, lineNum: number): void;
9
+ /**
10
+ * Issue #48: scan one line of VBA source for `DoCmd.OpenQuery "X"` calls.
11
+ * Each match emits ONE `UnresolvedReference` (NOT a stub + edge) so the
12
+ * resolver binds to the REAL `query` node that `SqlQueryExtractor`
13
+ * produces for `queries/<Name>.sql`, tagged `synthesizedBy: 'vba-opens-query'`.
14
+ */
15
+ export declare function scanDoCmdOpenQuery(ctx: VbaExtractorContext, line: string, caller: ProcInfo, lineNum: number): void;
16
+ //# sourceMappingURL=docmd.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { VbaExtractorContext } from './context';
2
+ /**
3
+ * Walk the (uncommented, line-joined) source and emit:
4
+ * - one `enum` node per `Enum <Name>` block, with one `enum_member` node
5
+ * per member and a `contains` edge enum→member;
6
+ * - one `constant` node per name declared on a `Const` line (multi-name
7
+ * lines emit one node per name);
8
+ * - a `contains` edge from the module/class node to each enum and constant
9
+ * (held in `pendingModuleOrClassSource` until the module node exists).
10
+ *
11
+ * Returns the number of top-level symbols (enums + constants) emitted so
12
+ * the caller can flip `hasAnySymbols`.
13
+ */
14
+ export declare function sweepEnumsAndConsts(ctx: VbaExtractorContext, src: string): number;
15
+ //# sourceMappingURL=enums-consts.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { VbaExtractorContext } from './context';
2
+ export declare function sweepImplements(ctx: VbaExtractorContext, src: string): number;
3
+ //# sourceMappingURL=implements.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { VbaExtractorContext, ProcInfo } from './context';
2
+ export declare function sweepProcedures(ctx: VbaExtractorContext, src: string): ProcInfo[];
3
+ //# sourceMappingURL=procedures.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { VbaExtractorContext } from './context';
2
+ export declare function scanSqlInLine(ctx: VbaExtractorContext, line: string, lineNum: number, dedupe: Set<string>, sqlVariables: Map<string, string>): void;
3
+ /**
4
+ * #13 fix: `sql = sql & "..."` (self-referential concatenation) must
5
+ * ACCUMULATE the new fragment onto whatever was already tracked for
6
+ * `varName`, not overwrite it. Overwriting silently dropped earlier
7
+ * fragments' tables — typically the initial `FROM <table>` in
8
+ * `sql = "SELECT * FROM tblA"` followed by `sql = sql & " WHERE x=1"`.
9
+ *
10
+ * Detection: the RHS (`m[2]`, trimmed) starts with `<varName> &`,
11
+ * case-insensitively — matching VBA's case-insensitive identifiers (`Sql`
12
+ * and `sql` are the same variable). A genuine fresh assignment (RHS does
13
+ * NOT start with the self-reference) still RESETS tracking — that
14
+ * behavior is unchanged.
15
+ */
16
+ export declare function trackSqlVariableAssignment(lines: string[], lineIndex: number, sqlVariables: Map<string, string>): void;
17
+ //# sourceMappingURL=sql-wrapper.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { VbaExtractorContext, ProcInfo } from './context';
2
+ /**
3
+ * Issue #50: scan one line of VBA source for TempVars access sites and
4
+ * emit one `references` edge per site. Bang form scans the MASKED line,
5
+ * paren + Add forms scan the ORIGINAL line. Access is classified by the
6
+ * line suffix after the match: a bare `=` next non-whitespace char is a
7
+ * write (VBA has no `==`).
8
+ */
9
+ export declare function sweepTempVars(ctx: VbaExtractorContext, maskedLine: string, originalLine: string, lineNum: number, caller: ProcInfo | undefined): void;
10
+ //# sourceMappingURL=tempvars.d.ts.map
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Pure text helpers shared across the VBA extraction passes. None of these
3
+ * touch extractor state — they are deterministic string transforms lifted
4
+ * out of `VbaExtractor` verbatim so each pass module can import what it needs
5
+ * without pulling in the orchestrator.
6
+ */
7
+ /**
8
+ * Fold a VBA visibility keyword to the canonical lowercase enum, matching
9
+ * the procedure convention: `Private` → 'private'; `Public`, `Global`,
10
+ * `Friend`, or none → 'public' (VBA's default module-level `Const`/`Enum`
11
+ * is Private, but we follow the same broader-than-private fold the proc
12
+ * sweep uses so visibility is consistent across symbol kinds).
13
+ */
14
+ export declare function foldVisibility(raw: string): 'public' | 'private';
15
+ /**
16
+ * Fix 2 (Issue #2): replace string-literal content with spaces so that
17
+ * call-site patterns inside `"..."` spans are invisible to CALL_RE and
18
+ * the statement-form detectors. Column positions are preserved (each
19
+ * character is replaced 1-for-1) so any col-based metadata stays correct.
20
+ */
21
+ export declare function maskStringContent(line: string): string;
22
+ /**
23
+ * #13 helper: escape a variable name for safe interpolation into the
24
+ * self-reference RegExp built by `trackSqlVariableAssignment`. VBA
25
+ * identifiers are alphanumeric+underscore only, so in practice nothing here
26
+ * ever needs escaping — this guards against regex metacharacters anyway
27
+ * rather than assume the input is always well-formed.
28
+ */
29
+ export declare function escapeRegExpLiteral(value: string): string;
30
+ export declare function parseConstDeclarations(body: string): Array<{
31
+ name: string;
32
+ value: string | null;
33
+ }>;
34
+ export declare function splitOutsideVbaStrings(value: string, separator: string): string[];
35
+ /**
36
+ * Issue #50 helper: return true iff `line.charAt(fromIndex..)` (after the
37
+ * matched TempVars site, including any trailing whitespace) holds an `=`
38
+ * (write-assignment) and not a `==` (VBA has no `==` operator, so a bare
39
+ * check for `=` is safe). Used by `sweepTempVars` to classify a `TempVars`
40
+ * access as read vs write from the local line context.
41
+ *
42
+ * We skip over trailing whitespace only — `.`, `(`, `<`, `>`, `*`, `+`
43
+ * etc. all mean "this isn't an assignment target", and bare `=`
44
+ * is the only access-suffix shape VBA syntax allows here. A line like
45
+ * `TempVars!x = 1` (write) or `Debug.Print TempVars!x` (read) land in
46
+ * the right bucket without further analysis.
47
+ *
48
+ * Strings should already be masked out of `line` (`maskStringContent`)
49
+ * when this is called for the bang form (no string in scope anyway);
50
+ * the paren form passes the ORIGINAL line — but for THAT form the
51
+ * captured match ends at the closing `"` of the literal, so any `=`
52
+ * that follows is unambiguously outside the string.
53
+ */
54
+ export declare function detectAssignmentSuffix(line: string, fromIndex: number): boolean;
55
+ export declare function unwrapVbaStringLiteral(raw: string): string;
56
+ /**
57
+ * Hueco 3 helper: parse an Access event-handler Sub name into its
58
+ * `<ControlName>_<EventName>` components. Returns null when the name does
59
+ * not match the convention, when the split yields an empty segment, or
60
+ * when the control name is `Form` (form-level events are NOT control
61
+ * handlers — `Form_Load` is the form's own lifecycle event, not a
62
+ * command-button click).
63
+ *
64
+ * Splitting on the LAST underscore (rather than the first) lets
65
+ * multi-word event names parse correctly: `ComandoAltaPM_BeforeDelConfirm`
66
+ * yields control=`ComandoAltaPM`, event=`BeforeDelConfirm`, not
67
+ * control=`ComandoAlta`, event=`PM_BeforeDelConfirm`.
68
+ */
69
+ export declare function parseEventHandlerName(name: string): {
70
+ controlName: string;
71
+ eventName: string;
72
+ } | null;
73
+ //# sourceMappingURL=text-utils.d.ts.map