@aroman22/codegraph-vba 1.12.0 → 1.14.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.
- package/dist/db/queries.d.ts +4 -2
- package/dist/extraction/extraction-version.d.ts +1 -1
- package/dist/extraction/vba/constants.d.ts +6 -0
- package/dist/extraction/vba/context.d.ts +15 -0
- package/dist/extraction/vba/procedures.d.ts +0 -7
- package/dist/index.d.ts +10 -0
- package/dist/resolution/vba-runtime-objects.d.ts +82 -0
- package/dist/types.d.ts +6 -3
- package/package.json +7 -7
package/dist/db/queries.d.ts
CHANGED
|
@@ -534,8 +534,9 @@ export declare class QueryBuilder {
|
|
|
534
534
|
referenceKind: string;
|
|
535
535
|
}>): void;
|
|
536
536
|
/**
|
|
537
|
-
*
|
|
538
|
-
*
|
|
537
|
+
* Park refs a completed resolution pass could not resolve as `failed`, or
|
|
538
|
+
* as `declined-runtime` when the resolver recognizes built-in runtime noise.
|
|
539
|
+
* Parked rows are invisible to the pending
|
|
539
540
|
* count/batch readers (so drain loops and the #1187 orphan sweep still
|
|
540
541
|
* terminate) but stay queryable by name_tail so a later sync can retry them
|
|
541
542
|
* when a changed file introduces a symbol that could satisfy them. name_tail
|
|
@@ -546,6 +547,7 @@ export declare class QueryBuilder {
|
|
|
546
547
|
fromNodeId: string;
|
|
547
548
|
referenceName: string;
|
|
548
549
|
referenceKind: string;
|
|
550
|
+
status?: 'failed' | 'declined-runtime';
|
|
549
551
|
}>): void;
|
|
550
552
|
/**
|
|
551
553
|
* Failed refs whose name tail matches one of the given symbol names — the
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
* turns the re-index hint into noise — keep it honest (see CLAUDE.md, "Honesty
|
|
22
22
|
* in the product is load-bearing").
|
|
23
23
|
*/
|
|
24
|
-
export declare const EXTRACTION_VERSION =
|
|
24
|
+
export declare const EXTRACTION_VERSION = 25;
|
|
25
25
|
//# sourceMappingURL=extraction-version.d.ts.map
|
|
@@ -25,6 +25,12 @@ export declare const PROCEDURE_END_RE: RegExp;
|
|
|
25
25
|
export declare const PRIMITIVE_TYPES: Set<string>;
|
|
26
26
|
/** Keywords we never want to match as call receivers. */
|
|
27
27
|
export declare const CALL_KEYWORD_BLACKLIST: Set<string>;
|
|
28
|
+
/**
|
|
29
|
+
* VBA reserved words that cannot name an unqualified user-code target.
|
|
30
|
+
* Stored lowercase so source casing cannot change classification.
|
|
31
|
+
*/
|
|
32
|
+
export declare const VBA_KEYWORDS: Set<string>;
|
|
33
|
+
export declare function isVbaKeyword(name: string): boolean;
|
|
28
34
|
/**
|
|
29
35
|
* Access runtime objects and singletons. Calls on these receivers are
|
|
30
36
|
* real VBA calls but the targets are NOT user-defined modules or
|
|
@@ -18,6 +18,20 @@ export interface ProcInfo {
|
|
|
18
18
|
kind: 'sub' | 'function' | 'property';
|
|
19
19
|
visibility: 'public' | 'private' | 'protected' | 'internal';
|
|
20
20
|
startLine: number;
|
|
21
|
+
/**
|
|
22
|
+
* Issue #190: lowercase parameter names declared as arrays on this
|
|
23
|
+
* procedure's signature (e.g. `ByRef logs() As String` or
|
|
24
|
+
* `ByVal p_Logs() As Long`). Used by the call-site scan to suppress
|
|
25
|
+
* `name(index)` accesses INSIDE this procedure body — the receiver
|
|
26
|
+
* is a known array bound at the parameter boundary, not an
|
|
27
|
+
* unresolved function call.
|
|
28
|
+
*
|
|
29
|
+
* Scoped to this procedure on purpose: a `logs` parameter on one Sub
|
|
30
|
+
* does NOT make `logs` an array inside another Sub, and a module-level
|
|
31
|
+
* `Dim logs As String` (not an array) must not be polluted by a
|
|
32
|
+
* different procedure's `ByRef logs()` declaration.
|
|
33
|
+
*/
|
|
34
|
+
arrayParameters?: string[];
|
|
21
35
|
}
|
|
22
36
|
/**
|
|
23
37
|
* Issue #83: the per-concern classifier shape. The single walker in
|
|
@@ -120,6 +134,7 @@ export declare class VbaExtractorContext {
|
|
|
120
134
|
withEvents?: boolean;
|
|
121
135
|
variableName?: string;
|
|
122
136
|
assignedWithSet?: boolean;
|
|
137
|
+
isArray?: boolean;
|
|
123
138
|
}>;
|
|
124
139
|
/**
|
|
125
140
|
* Issue #52: Const resolution buckets, scoped per procedure. Key is
|
|
@@ -16,13 +16,6 @@ import { VbaExtractionRule } from './rules';
|
|
|
16
16
|
* `match` is one emit.
|
|
17
17
|
*/
|
|
18
18
|
export declare const RULES: readonly VbaExtractionRule<unknown>[];
|
|
19
|
-
/**
|
|
20
|
-
* Issue #83: factory for the procedures classifier. Closure state: none
|
|
21
|
-
* beyond `count` (the per-concern accumulators live on `ctx`).
|
|
22
|
-
*
|
|
23
|
-
* The body walks the declarative `RULES` table (Issue #153). The
|
|
24
|
-
* inline cascade that used to live here is now one entry in `RULES`.
|
|
25
|
-
*/
|
|
26
19
|
export declare function createProceduresClassifier(): VbaClassifier;
|
|
27
20
|
/**
|
|
28
21
|
* Backward-compat wrapper: pre-#83 callers (e.g. legacy test fixtures)
|
package/dist/index.d.ts
CHANGED
|
@@ -255,6 +255,16 @@ export declare class CodeGraph {
|
|
|
255
255
|
* hint and `codegraph upgrade`'s reminder.
|
|
256
256
|
*/
|
|
257
257
|
isIndexStale(): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Structured list of reasons the on-disk index should be rebuilt. Each entry
|
|
260
|
+
* is a stable token CI scripts can switch on without parsing the prose
|
|
261
|
+
* warning. Currently emits `'extraction-version'` when the on-disk
|
|
262
|
+
* `indexed_with_extraction_version` stamp is older than the running engine's
|
|
263
|
+
* `EXTRACTION_VERSION`. Empty when there is no index yet or the stamp is
|
|
264
|
+
* current. Future reasons (e.g. resolver-version drift) append to the same
|
|
265
|
+
* list — never replace it.
|
|
266
|
+
*/
|
|
267
|
+
getReindexReasons(): string[];
|
|
258
268
|
/**
|
|
259
269
|
* Extract nodes and edges from source code (without storing)
|
|
260
270
|
*/
|
|
@@ -37,4 +37,86 @@ export declare const RUNTIME_OBJECTS: ReadonlySet<string>;
|
|
|
37
37
|
* defensively so a bracketed receiver (`[DAO]`) still matches.
|
|
38
38
|
*/
|
|
39
39
|
export declare function isRuntimeObject(receiver: string | null | undefined): boolean;
|
|
40
|
+
/** Canonical VBA and Access built-in functions that never resolve to project code. */
|
|
41
|
+
export declare const VBA_STDLIB_FUNCTIONS: ReadonlySet<string>;
|
|
42
|
+
export declare function isVbaStdlibFunction(name: string | null | undefined): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Issue #188 — VBA intrinsic constants and DAO enum values reach
|
|
45
|
+
* `unresolved_refs` as `reference_kind='unqualified-ident'` and used to leak
|
|
46
|
+
* as `failed`. They are bare identifiers (NOT calls), so unlike the stdlib
|
|
47
|
+
* set they need NO `metadata.synthesizedBy` gate — name membership alone is
|
|
48
|
+
* the discriminator. The same case-insensitive / lowercased-compare
|
|
49
|
+
* convention as the stdlib set applies. A user-defined
|
|
50
|
+
* `Public Const dbFailOnError = 0` or `Public Function vbCrLf() As String`
|
|
51
|
+
* shadow resolves normally first and never reaches the classifier, so the
|
|
52
|
+
* name-only gate does not weaken user-symbol resolution.
|
|
53
|
+
*
|
|
54
|
+
* The bench corpus flagged ~104 confirmed rows (DAO enum literals in
|
|
55
|
+
* `Execute` / `OpenArgs` / recordset options; `vbCrLf` / `vbLf` / `vbTab`
|
|
56
|
+
* in `Debug.Print`; the full `vbMsgBoxStyle` + `vbMsgBoxHelpButton` +
|
|
57
|
+
* `vbApplicationModal` / `vbSystemModal` matrix in `MsgBox` calls).
|
|
58
|
+
*/
|
|
59
|
+
export declare const DAO_ENUM_VALUES: ReadonlySet<string>;
|
|
60
|
+
export declare function isDaoEnumValue(name: string | null | undefined): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Issue #188 — VBA intrinsic constants. Lowercased so matching is
|
|
63
|
+
* case-insensitive. Covers the constants listed in the issue's explicit SQL
|
|
64
|
+
* set plus the rest of the `vbMsgBoxStyle` family and the
|
|
65
|
+
* `vbApplicationModal` / `vbSystemModal` modal flags.
|
|
66
|
+
*/
|
|
67
|
+
export declare const VBA_INTRINSIC_CONSTANTS: ReadonlySet<string>;
|
|
68
|
+
export declare function isVbaIntrinsicConstant(name: string | null | undefined): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Issue #192 — central decision: should this unresolved reference be parked
|
|
71
|
+
* as `declined-runtime` instead of `failed`?
|
|
72
|
+
*
|
|
73
|
+
* VBA stdlib calls reach `unresolved_refs` under three shapes:
|
|
74
|
+
*
|
|
75
|
+
* 1. **paren-form call** — `MsgBox("hi")` is emitted by the call-site sweep
|
|
76
|
+
* as `reference_kind='calls'` with `metadata.synthesizedBy` either
|
|
77
|
+
* absent or set to `vba-paren-call-unresolved` (the post-sweep
|
|
78
|
+
* unifier). The classic PR #185 / issue #181 path.
|
|
79
|
+
*
|
|
80
|
+
* 2. **statement-form call** — `MsgBox "hi"`, `DoEvents`, `Shell "calc"`
|
|
81
|
+
* are emitted by the statement-call sweep as
|
|
82
|
+
* `reference_kind='unqualified-ident'` with
|
|
83
|
+
* `metadata.synthesizedBy='vba-statement-call-unresolved'`. Without
|
|
84
|
+
* this classifier, those 49+ rows from the bench corpus (MsgBox=44,
|
|
85
|
+
* DoEvents=4, Shell=1) leak as `failed`, polluting actionable
|
|
86
|
+
* failed-reference reports.
|
|
87
|
+
*
|
|
88
|
+
* 3. **NOT a call at all** — a bare `Public Const SomePublicConst = 1`
|
|
89
|
+
* read inside a procedure (e.g. `SomePublicConst` on its own line,
|
|
90
|
+
* same shape the const-first disambiguation rule checks) ALSO reaches
|
|
91
|
+
* `unresolved_refs` as `reference_kind='unqualified-ident'`. The
|
|
92
|
+
* resolver first attempts normal `matchFunctionRef` / matchConstRef
|
|
93
|
+
* resolution; for genuine misses this row will be deleted from
|
|
94
|
+
* unresolved_refs. When a Const cannot be resolved but still produces
|
|
95
|
+
* a row, classifying its status purely by name is wrong — a
|
|
96
|
+
* user-defined `Public Sub ProjectHelper s` and a public Const that
|
|
97
|
+
* elude resolution must NOT be marked `declined-runtime`.
|
|
98
|
+
*
|
|
99
|
+
* Issue #188 extends the contract with two new name-only branches for
|
|
100
|
+
* bare DAO enum values and VBA intrinsic constants — these are emitted as
|
|
101
|
+
* `reference_kind='unqualified-ident'` WITHOUT a `synthesizedBy` flag
|
|
102
|
+
* because they are identifiers, not calls. Name membership alone is the
|
|
103
|
+
* discriminator; the metadata gate does NOT apply. Normal user-symbol
|
|
104
|
+
* resolution runs first, so a user-defined `Public Const dbFailOnError`
|
|
105
|
+
* or `Public Function vbCrLf` shadow never reaches this classifier.
|
|
106
|
+
*
|
|
107
|
+
* The stdlib branch keeps its original tight gate: name match AND one of
|
|
108
|
+
* the two real call shapes (paren-form `calls`, or statement-form
|
|
109
|
+
* `unqualified-ident` stamped with `vba-statement-call-unresolved`).
|
|
110
|
+
* Name-only matching for the stdlib set is still intentionally rejected —
|
|
111
|
+
* a row like `MsgBox` on its own line without the statement-call stamp is
|
|
112
|
+
* a user-defined reference, not a runtime call.
|
|
113
|
+
*/
|
|
114
|
+
export declare function classifyVbaReferenceAsRuntime(ref: {
|
|
115
|
+
language?: string | null;
|
|
116
|
+
referenceKind?: string | null;
|
|
117
|
+
referenceName?: string | null;
|
|
118
|
+
metadata?: {
|
|
119
|
+
synthesizedBy?: unknown;
|
|
120
|
+
} | null;
|
|
121
|
+
}): boolean;
|
|
40
122
|
//# sourceMappingURL=vba-runtime-objects.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -175,7 +175,7 @@ export interface ExtractionError {
|
|
|
175
175
|
* layer. The legacy `EdgeKind` literal `'references'` is preserved as
|
|
176
176
|
* `references` here via `EdgeKind` — back-compat for any push site this
|
|
177
177
|
* round does not reclassify (e.g. the Implements emitter). New literals:
|
|
178
|
-
* - `
|
|
178
|
+
* - `calls` paren-form `Name(...)` or statement-form Sub call
|
|
179
179
|
* - `qualified-call` `Receiver.Member(...)` (qualified-paren) or
|
|
180
180
|
* `Receiver.Member args` (qualified-statement)
|
|
181
181
|
* - `property-get` `Me.Name` (dot access, read)
|
|
@@ -189,13 +189,16 @@ export interface ExtractionError {
|
|
|
189
189
|
* - `member-with` `.Member` inside a `With <receiver>` block
|
|
190
190
|
* - `dao-query` `DoCmd.OpenQuery "X"` argument
|
|
191
191
|
* `dao-field-get` / `dao-field-set` are deliberately deferred to round-4.
|
|
192
|
+
*
|
|
193
|
+
* See `docs/vba-reference-kinds.md` for the full taxonomy, noise ratios, and consumer-side SQL queries.
|
|
192
194
|
*/
|
|
193
|
-
|
|
195
|
+
/** `calls` is the canonical kind for unresolved procedure and function calls. */
|
|
196
|
+
export type ReferenceKind = EdgeKind | 'function_ref' | 'qualified-call' | 'property-get' | 'property-set' | 'bang-get' | 'bang-set' | 'unqualified-ident' | 'member-with' | 'dao-query';
|
|
194
197
|
/**
|
|
195
198
|
* Runtime guard for whether a `ReferenceKind` literal is also an `EdgeKind`
|
|
196
199
|
* literal (i.e. the value flows from an unresolved-ref row straight onto the
|
|
197
200
|
* kind column of a resolved edge without remapping). Round-3 (issue #108)
|
|
198
|
-
* introduced shape-based classifier literals (`
|
|
201
|
+
* introduced shape-based classifier literals (`qualified-call`,
|
|
199
202
|
* `property-get`, …) that are valid as a `ReferenceKind` but are NOT valid
|
|
200
203
|
* edge kinds — edges still use the `calls`/`references` family of literals.
|
|
201
204
|
* The resolver uses this guard to fall back to `'references'` for the edge
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aroman22/codegraph-vba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codegraph-vba": "npm-shim.js"
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
17
|
"optionalDependencies": {
|
|
18
|
-
"@aroman22/codegraph-vba-darwin-arm64": "1.
|
|
19
|
-
"@aroman22/codegraph-vba-darwin-x64": "1.
|
|
20
|
-
"@aroman22/codegraph-vba-linux-arm64": "1.
|
|
21
|
-
"@aroman22/codegraph-vba-linux-x64": "1.
|
|
22
|
-
"@aroman22/codegraph-vba-win32-arm64": "1.
|
|
23
|
-
"@aroman22/codegraph-vba-win32-x64": "1.
|
|
18
|
+
"@aroman22/codegraph-vba-darwin-arm64": "1.14.0",
|
|
19
|
+
"@aroman22/codegraph-vba-darwin-x64": "1.14.0",
|
|
20
|
+
"@aroman22/codegraph-vba-linux-arm64": "1.14.0",
|
|
21
|
+
"@aroman22/codegraph-vba-linux-x64": "1.14.0",
|
|
22
|
+
"@aroman22/codegraph-vba-win32-arm64": "1.14.0",
|
|
23
|
+
"@aroman22/codegraph-vba-win32-x64": "1.14.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"npm-shim.js",
|