@aroman22/codegraph-vba 1.13.0 → 1.15.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.
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
*/
|
|
@@ -40,4 +40,83 @@ export declare function isRuntimeObject(receiver: string | null | undefined): bo
|
|
|
40
40
|
/** Canonical VBA and Access built-in functions that never resolve to project code. */
|
|
41
41
|
export declare const VBA_STDLIB_FUNCTIONS: ReadonlySet<string>;
|
|
42
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;
|
|
43
122
|
//# sourceMappingURL=vba-runtime-objects.d.ts.map
|
package/dist/types.d.ts
CHANGED
|
@@ -189,6 +189,8 @@ 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. */
|
|
194
196
|
export type ReferenceKind = EdgeKind | 'function_ref' | 'qualified-call' | 'property-get' | 'property-set' | 'bang-get' | 'bang-set' | 'unqualified-ident' | 'member-with' | 'dao-query';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aroman22/codegraph-vba",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.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.15.0",
|
|
19
|
+
"@aroman22/codegraph-vba-darwin-x64": "1.15.0",
|
|
20
|
+
"@aroman22/codegraph-vba-linux-arm64": "1.15.0",
|
|
21
|
+
"@aroman22/codegraph-vba-linux-x64": "1.15.0",
|
|
22
|
+
"@aroman22/codegraph-vba-win32-arm64": "1.15.0",
|
|
23
|
+
"@aroman22/codegraph-vba-win32-x64": "1.15.0"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"npm-shim.js",
|