@optave/codegraph 3.11.2 → 3.13.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/README.md +73 -37
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +2 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/batch.d.ts.map +1 -1
- package/dist/cli/commands/batch.js +1 -0
- package/dist/cli/commands/batch.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +6 -1
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +272 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/triage.js +1 -1
- package/dist/cli/commands/triage.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/shared/options.d.ts +2 -1
- package/dist/cli/shared/options.d.ts.map +1 -1
- package/dist/cli/shared/options.js +11 -1
- package/dist/cli/shared/options.js.map +1 -1
- package/dist/cli/types.d.ts +2 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +8 -1
- package/dist/db/migrations.js.map +1 -1
- package/dist/domain/analysis/module-map.d.ts +2 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -1
- package/dist/domain/analysis/module-map.js +24 -2
- package/dist/domain/analysis/module-map.js.map +1 -1
- package/dist/domain/graph/builder/call-resolver.d.ts +16 -10
- package/dist/domain/graph/builder/call-resolver.d.ts.map +1 -1
- package/dist/domain/graph/builder/call-resolver.js +251 -34
- package/dist/domain/graph/builder/call-resolver.js.map +1 -1
- package/dist/domain/graph/builder/cha.d.ts +69 -0
- package/dist/domain/graph/builder/cha.d.ts.map +1 -0
- package/dist/domain/graph/builder/cha.js +158 -0
- package/dist/domain/graph/builder/cha.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +3 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -1
- package/dist/domain/graph/builder/context.js +2 -0
- package/dist/domain/graph/builder/context.js.map +1 -1
- package/dist/domain/graph/builder/helpers.d.ts +25 -1
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -1
- package/dist/domain/graph/builder/helpers.js +178 -5
- package/dist/domain/graph/builder/helpers.js.map +1 -1
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -1
- package/dist/domain/graph/builder/incremental.js +74 -2
- package/dist/domain/graph/builder/incremental.js.map +1 -1
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -1
- package/dist/domain/graph/builder/pipeline.js +37 -2
- package/dist/domain/graph/builder/pipeline.js.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.js +704 -34
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.js +3 -2
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.js +4 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -1
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/native-orchestrator.js +783 -37
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -1
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/resolve-imports.js +10 -1
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -1
- package/dist/domain/graph/journal.js +1 -1
- package/dist/domain/graph/journal.js.map +1 -1
- package/dist/domain/graph/resolver/points-to.d.ts +53 -0
- package/dist/domain/graph/resolver/points-to.d.ts.map +1 -0
- package/dist/domain/graph/resolver/points-to.js +213 -0
- package/dist/domain/graph/resolver/points-to.js.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts +9 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.js +476 -0
- package/dist/domain/graph/resolver/ts-resolver.js.map +1 -0
- package/dist/domain/parser.d.ts +12 -4
- package/dist/domain/parser.d.ts.map +1 -1
- package/dist/domain/parser.js +83 -20
- package/dist/domain/parser.js.map +1 -1
- package/dist/domain/wasm-worker-entry.js +35 -2
- package/dist/domain/wasm-worker-entry.js.map +1 -1
- package/dist/domain/wasm-worker-pool.d.ts.map +1 -1
- package/dist/domain/wasm-worker-pool.js +34 -0
- package/dist/domain/wasm-worker-pool.js.map +1 -1
- package/dist/domain/wasm-worker-protocol.d.ts +15 -1
- package/dist/domain/wasm-worker-protocol.d.ts.map +1 -1
- package/dist/extractors/c.js +3 -3
- package/dist/extractors/c.js.map +1 -1
- package/dist/extractors/clojure.js +1 -1
- package/dist/extractors/clojure.js.map +1 -1
- package/dist/extractors/cpp.d.ts.map +1 -1
- package/dist/extractors/cpp.js +45 -4
- package/dist/extractors/cpp.js.map +1 -1
- package/dist/extractors/csharp.d.ts.map +1 -1
- package/dist/extractors/csharp.js +37 -8
- package/dist/extractors/csharp.js.map +1 -1
- package/dist/extractors/cuda.d.ts.map +1 -1
- package/dist/extractors/cuda.js +45 -4
- package/dist/extractors/cuda.js.map +1 -1
- package/dist/extractors/elixir.js +6 -6
- package/dist/extractors/elixir.js.map +1 -1
- package/dist/extractors/fsharp.js +1 -1
- package/dist/extractors/fsharp.js.map +1 -1
- package/dist/extractors/go.js +5 -5
- package/dist/extractors/go.js.map +1 -1
- package/dist/extractors/haskell.js +1 -1
- package/dist/extractors/haskell.js.map +1 -1
- package/dist/extractors/helpers.d.ts +11 -0
- package/dist/extractors/helpers.d.ts.map +1 -1
- package/dist/extractors/helpers.js +40 -0
- package/dist/extractors/helpers.js.map +1 -1
- package/dist/extractors/java.d.ts.map +1 -1
- package/dist/extractors/java.js +10 -9
- package/dist/extractors/java.js.map +1 -1
- package/dist/extractors/javascript.d.ts +2 -0
- package/dist/extractors/javascript.d.ts.map +1 -1
- package/dist/extractors/javascript.js +1812 -71
- package/dist/extractors/javascript.js.map +1 -1
- package/dist/extractors/kotlin.js +5 -5
- package/dist/extractors/kotlin.js.map +1 -1
- package/dist/extractors/lua.js +1 -1
- package/dist/extractors/lua.js.map +1 -1
- package/dist/extractors/objc.js +3 -3
- package/dist/extractors/objc.js.map +1 -1
- package/dist/extractors/ocaml.js +1 -1
- package/dist/extractors/ocaml.js.map +1 -1
- package/dist/extractors/php.js +2 -2
- package/dist/extractors/php.js.map +1 -1
- package/dist/extractors/python.js +7 -7
- package/dist/extractors/python.js.map +1 -1
- package/dist/extractors/ruby.js +2 -2
- package/dist/extractors/ruby.js.map +1 -1
- package/dist/extractors/scala.js +1 -1
- package/dist/extractors/scala.js.map +1 -1
- package/dist/extractors/solidity.js +1 -1
- package/dist/extractors/solidity.js.map +1 -1
- package/dist/extractors/swift.js +4 -4
- package/dist/extractors/swift.js.map +1 -1
- package/dist/extractors/zig.js +4 -4
- package/dist/extractors/zig.js.map +1 -1
- package/dist/features/structure-query.d.ts +1 -1
- package/dist/features/structure-query.d.ts.map +1 -1
- package/dist/features/structure-query.js +6 -6
- package/dist/features/structure-query.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/config.d.ts +85 -2
- package/dist/infrastructure/config.d.ts.map +1 -1
- package/dist/infrastructure/config.js +408 -19
- package/dist/infrastructure/config.js.map +1 -1
- package/dist/infrastructure/native.d.ts +11 -0
- package/dist/infrastructure/native.d.ts.map +1 -1
- package/dist/infrastructure/native.js +78 -5
- package/dist/infrastructure/native.js.map +1 -1
- package/dist/infrastructure/registry.d.ts +27 -0
- package/dist/infrastructure/registry.d.ts.map +1 -1
- package/dist/infrastructure/registry.js +59 -1
- package/dist/infrastructure/registry.js.map +1 -1
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -1
- package/dist/presentation/queries-cli/overview.js +5 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -1
- package/dist/presentation/structure.d.ts +1 -1
- package/dist/presentation/structure.d.ts.map +1 -1
- package/dist/presentation/structure.js +2 -2
- package/dist/presentation/structure.js.map +1 -1
- package/dist/types.d.ts +221 -0
- package/dist/types.d.ts.map +1 -1
- package/grammars/tree-sitter-gleam.wasm +0 -0
- package/package.json +7 -8
- package/src/cli/commands/audit.ts +2 -1
- package/src/cli/commands/batch.ts +1 -0
- package/src/cli/commands/build.ts +6 -1
- package/src/cli/commands/config.ts +353 -0
- package/src/cli/commands/triage.ts +1 -1
- package/src/cli/index.ts +10 -0
- package/src/cli/shared/options.ts +11 -1
- package/src/cli/types.ts +2 -0
- package/src/db/migrations.ts +8 -1
- package/src/domain/analysis/module-map.ts +29 -1
- package/src/domain/graph/builder/call-resolver.ts +263 -35
- package/src/domain/graph/builder/cha.ts +192 -0
- package/src/domain/graph/builder/context.ts +3 -0
- package/src/domain/graph/builder/helpers.ts +195 -5
- package/src/domain/graph/builder/incremental.ts +80 -1
- package/src/domain/graph/builder/pipeline.ts +49 -2
- package/src/domain/graph/builder/stages/build-edges.ts +867 -32
- package/src/domain/graph/builder/stages/detect-changes.ts +4 -2
- package/src/domain/graph/builder/stages/finalize.ts +4 -0
- package/src/domain/graph/builder/stages/native-orchestrator.ts +910 -43
- package/src/domain/graph/builder/stages/resolve-imports.ts +15 -1
- package/src/domain/graph/journal.ts +1 -1
- package/src/domain/graph/resolver/points-to.ts +254 -0
- package/src/domain/graph/resolver/ts-resolver.ts +536 -0
- package/src/domain/parser.ts +86 -17
- package/src/domain/wasm-worker-entry.ts +35 -2
- package/src/domain/wasm-worker-pool.ts +22 -0
- package/src/domain/wasm-worker-protocol.ts +15 -0
- package/src/extractors/c.ts +3 -3
- package/src/extractors/clojure.ts +1 -1
- package/src/extractors/cpp.ts +47 -4
- package/src/extractors/csharp.ts +33 -9
- package/src/extractors/cuda.ts +47 -4
- package/src/extractors/elixir.ts +6 -6
- package/src/extractors/fsharp.ts +1 -1
- package/src/extractors/go.ts +5 -5
- package/src/extractors/haskell.ts +1 -1
- package/src/extractors/helpers.ts +43 -0
- package/src/extractors/java.ts +10 -9
- package/src/extractors/javascript.ts +1929 -72
- package/src/extractors/kotlin.ts +5 -5
- package/src/extractors/lua.ts +1 -1
- package/src/extractors/objc.ts +3 -3
- package/src/extractors/ocaml.ts +1 -1
- package/src/extractors/php.ts +2 -2
- package/src/extractors/python.ts +7 -7
- package/src/extractors/ruby.ts +2 -2
- package/src/extractors/scala.ts +1 -1
- package/src/extractors/solidity.ts +1 -1
- package/src/extractors/swift.ts +4 -4
- package/src/extractors/zig.ts +4 -4
- package/src/features/structure-query.ts +7 -7
- package/src/index.ts +5 -1
- package/src/infrastructure/config.ts +494 -20
- package/src/infrastructure/native.ts +87 -5
- package/src/infrastructure/registry.ts +82 -1
- package/src/presentation/queries-cli/overview.ts +15 -1
- package/src/presentation/structure.ts +3 -3
- package/src/types.ts +235 -0
- package/grammars/tree-sitter-erlang.wasm +0 -0
package/src/extractors/elixir.ts
CHANGED
|
@@ -122,9 +122,9 @@ function collectModuleMembers(
|
|
|
122
122
|
): void {
|
|
123
123
|
for (let i = 0; i < doBlock.childCount; i++) {
|
|
124
124
|
const child = doBlock.child(i);
|
|
125
|
-
if (
|
|
125
|
+
if (child?.type !== 'call') continue;
|
|
126
126
|
const target = child.childForFieldName('target');
|
|
127
|
-
if (
|
|
127
|
+
if (target?.type !== 'identifier') continue;
|
|
128
128
|
|
|
129
129
|
if (target.text === 'def' || target.text === 'defp') {
|
|
130
130
|
const fnName = extractFunctionName(child);
|
|
@@ -184,7 +184,7 @@ function extractElixirParams(defCallNode: TreeSitterNode): SubDeclaration[] {
|
|
|
184
184
|
|
|
185
185
|
for (let i = 0; i < args.childCount; i++) {
|
|
186
186
|
const child = args.child(i);
|
|
187
|
-
if (
|
|
187
|
+
if (child?.type !== 'call') continue;
|
|
188
188
|
const innerArgs = findChild(child, 'arguments');
|
|
189
189
|
if (!innerArgs) continue;
|
|
190
190
|
for (let j = 0; j < innerArgs.childCount; j++) {
|
|
@@ -277,13 +277,13 @@ function pushElixirMapValues(node: TreeSitterNode, stack: TreeSitterNode[]): voi
|
|
|
277
277
|
const parts: TreeSitterNode[] = [];
|
|
278
278
|
for (let i = 0; i < node.childCount; i++) {
|
|
279
279
|
const content = node.child(i);
|
|
280
|
-
if (
|
|
280
|
+
if (content?.type !== 'map_content') continue;
|
|
281
281
|
for (let j = 0; j < content.childCount; j++) {
|
|
282
282
|
const kws = content.child(j);
|
|
283
|
-
if (
|
|
283
|
+
if (kws?.type !== 'keywords') continue;
|
|
284
284
|
for (let k = 0; k < kws.childCount; k++) {
|
|
285
285
|
const pair = kws.child(k);
|
|
286
|
-
if (
|
|
286
|
+
if (pair?.type !== 'pair') continue;
|
|
287
287
|
for (let p = 0; p < pair.childCount; p++) {
|
|
288
288
|
const part = pair.child(p);
|
|
289
289
|
if (!part || part.type === 'keyword') continue;
|
package/src/extractors/fsharp.ts
CHANGED
|
@@ -303,7 +303,7 @@ function handleValueDefinition(
|
|
|
303
303
|
currentModule: string | null,
|
|
304
304
|
): void {
|
|
305
305
|
const first = node.child(0);
|
|
306
|
-
if (
|
|
306
|
+
if (first?.type !== 'val') return;
|
|
307
307
|
|
|
308
308
|
const declLeft = findChild(node, 'value_declaration_left');
|
|
309
309
|
if (!declLeft) return;
|
package/src/extractors/go.ts
CHANGED
|
@@ -111,7 +111,7 @@ function extractGoReceiverType(receiver: TreeSitterNode): string | null {
|
|
|
111
111
|
function handleGoTypeDecl(node: TreeSitterNode, ctx: ExtractorOutput): void {
|
|
112
112
|
for (let i = 0; i < node.childCount; i++) {
|
|
113
113
|
const spec = node.child(i);
|
|
114
|
-
if (
|
|
114
|
+
if (spec?.type !== 'type_spec') continue;
|
|
115
115
|
const nameNode = spec.childForFieldName('name');
|
|
116
116
|
const typeNode = spec.childForFieldName('type');
|
|
117
117
|
if (!nameNode || !typeNode) continue;
|
|
@@ -213,7 +213,7 @@ function extractGoImportSpec(spec: TreeSitterNode, ctx: ExtractorOutput): void {
|
|
|
213
213
|
function handleGoConstDecl(node: TreeSitterNode, ctx: ExtractorOutput): void {
|
|
214
214
|
for (let i = 0; i < node.childCount; i++) {
|
|
215
215
|
const spec = node.child(i);
|
|
216
|
-
if (
|
|
216
|
+
if (spec?.type !== 'const_spec') continue;
|
|
217
217
|
const constName = spec.childForFieldName('name');
|
|
218
218
|
if (constName) {
|
|
219
219
|
ctx.definitions.push({
|
|
@@ -288,7 +288,7 @@ function inferAddressOfComposite(
|
|
|
288
288
|
): boolean {
|
|
289
289
|
if (rhs.type !== 'unary_expression') return false;
|
|
290
290
|
const operand = rhs.childForFieldName('operand');
|
|
291
|
-
if (
|
|
291
|
+
if (operand?.type !== 'composite_literal') return false;
|
|
292
292
|
const typeNode = operand.childForFieldName('type');
|
|
293
293
|
if (!typeNode) return false;
|
|
294
294
|
const typeName = extractGoTypeName(typeNode);
|
|
@@ -409,7 +409,7 @@ function extractGoParameters(paramListNode: TreeSitterNode | null): SubDeclarati
|
|
|
409
409
|
if (!paramListNode) return params;
|
|
410
410
|
for (let i = 0; i < paramListNode.childCount; i++) {
|
|
411
411
|
const param = paramListNode.child(i);
|
|
412
|
-
if (
|
|
412
|
+
if (param?.type !== 'parameter_declaration') continue;
|
|
413
413
|
// A parameter_declaration may have multiple identifiers (e.g., `a, b int`)
|
|
414
414
|
for (let j = 0; j < param.childCount; j++) {
|
|
415
415
|
const child = param.child(j);
|
|
@@ -494,7 +494,7 @@ function extractStructFields(structTypeNode: TreeSitterNode): SubDeclaration[] {
|
|
|
494
494
|
if (!fieldList) return fields;
|
|
495
495
|
for (let i = 0; i < fieldList.childCount; i++) {
|
|
496
496
|
const field = fieldList.child(i);
|
|
497
|
-
if (
|
|
497
|
+
if (field?.type !== 'field_declaration') continue;
|
|
498
498
|
const nameNode = field.childForFieldName('name');
|
|
499
499
|
if (nameNode) {
|
|
500
500
|
fields.push({ name: nameNode.text, kind: 'property', line: field.startPosition.row + 1 });
|
|
@@ -123,7 +123,7 @@ function collectHaskellPatternBindings(node: TreeSitterNode, out: SubDeclaration
|
|
|
123
123
|
case 'record':
|
|
124
124
|
for (let i = 0; i < node.childCount; i++) {
|
|
125
125
|
const fp = node.child(i);
|
|
126
|
-
if (
|
|
126
|
+
if (fp?.type !== 'field_pattern') continue;
|
|
127
127
|
for (let j = 0; j < fp.childCount; j++) {
|
|
128
128
|
const g = fp.child(j);
|
|
129
129
|
if (g && g.type !== 'field_name') collectHaskellPatternBindings(g, out);
|
|
@@ -305,6 +305,49 @@ export function pushImport(
|
|
|
305
305
|
ctx.imports.push(entry);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
+
// ── C-family primitive types ───────────────────────────────────────────────
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Primitive C/C++/CUDA types that are never class/struct receivers. Seeding
|
|
312
|
+
* these into typeMap would produce spurious receiver edges (e.g. `int x` → `int`).
|
|
313
|
+
* Shared between the C++ and CUDA extractors to prevent divergence.
|
|
314
|
+
*/
|
|
315
|
+
export const C_PRIMITIVE_TYPES: ReadonlySet<string> = new Set([
|
|
316
|
+
'int',
|
|
317
|
+
'long',
|
|
318
|
+
'short',
|
|
319
|
+
'unsigned',
|
|
320
|
+
'signed',
|
|
321
|
+
'float',
|
|
322
|
+
'double',
|
|
323
|
+
'char',
|
|
324
|
+
'bool',
|
|
325
|
+
'void',
|
|
326
|
+
'wchar_t',
|
|
327
|
+
'auto',
|
|
328
|
+
'size_t',
|
|
329
|
+
'uint8_t',
|
|
330
|
+
'uint16_t',
|
|
331
|
+
'uint32_t',
|
|
332
|
+
'uint64_t',
|
|
333
|
+
'int8_t',
|
|
334
|
+
'int16_t',
|
|
335
|
+
'int32_t',
|
|
336
|
+
'int64_t',
|
|
337
|
+
'ptrdiff_t',
|
|
338
|
+
'intptr_t',
|
|
339
|
+
'uintptr_t',
|
|
340
|
+
]);
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Return true when `typeName` is a primitive C/C++/CUDA type.
|
|
344
|
+
* Strips leading qualifiers (`const int` → `int`) before checking.
|
|
345
|
+
*/
|
|
346
|
+
export function isCPrimitiveType(typeName: string): boolean {
|
|
347
|
+
const base = typeName.split(/\s+/).pop() ?? typeName;
|
|
348
|
+
return C_PRIMITIVE_TYPES.has(base) || C_PRIMITIVE_TYPES.has(typeName);
|
|
349
|
+
}
|
|
350
|
+
|
|
308
351
|
// ── Parameter extraction ───────────────────────────────────────────────────
|
|
309
352
|
|
|
310
353
|
/**
|
package/src/extractors/java.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
nodeStartLine,
|
|
17
17
|
pushCall,
|
|
18
18
|
pushImport,
|
|
19
|
+
setTypeMapEntry,
|
|
19
20
|
} from './helpers.js';
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -273,13 +274,13 @@ function handleJavaLocalVarDecl(node: TreeSitterNode, ctx: ExtractorOutput): voi
|
|
|
273
274
|
const child = node.child(i);
|
|
274
275
|
if (child?.type === 'variable_declarator') {
|
|
275
276
|
const nameNode = child.childForFieldName('name');
|
|
276
|
-
// Use
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
|
|
282
|
-
|
|
277
|
+
// Use setTypeMapEntry (first-wins on tie) to match Rust extractor semantics.
|
|
278
|
+
// The typeMap is flat per-file without method scoping, so a local variable
|
|
279
|
+
// in one method (e.g. `InMemoryUserRepository repo` in `createDefault()`) must
|
|
280
|
+
// not override a parameter binding set by an earlier method
|
|
281
|
+
// (e.g. `UserRepository repo` constructor param). First-wins preserves the
|
|
282
|
+
// interface/abstract type annotation that drives correct CHA dispatch.
|
|
283
|
+
if (nameNode && ctx.typeMap) setTypeMapEntry(ctx.typeMap, nameNode.text, typeName, 0.9);
|
|
283
284
|
}
|
|
284
285
|
}
|
|
285
286
|
}
|
|
@@ -330,7 +331,7 @@ function extractClassFields(classNode: TreeSitterNode): SubDeclaration[] {
|
|
|
330
331
|
if (!body) return fields;
|
|
331
332
|
for (let i = 0; i < body.childCount; i++) {
|
|
332
333
|
const member = body.child(i);
|
|
333
|
-
if (
|
|
334
|
+
if (member?.type !== 'field_declaration') continue;
|
|
334
335
|
extractFieldDeclarators(member, fields);
|
|
335
336
|
}
|
|
336
337
|
return fields;
|
|
@@ -341,7 +342,7 @@ function extractFieldDeclarators(member: TreeSitterNode, fields: SubDeclaration[
|
|
|
341
342
|
const vis = extractModifierVisibility(member);
|
|
342
343
|
for (let j = 0; j < member.childCount; j++) {
|
|
343
344
|
const child = member.child(j);
|
|
344
|
-
if (
|
|
345
|
+
if (child?.type !== 'variable_declarator') continue;
|
|
345
346
|
const nameNode = child.childForFieldName('name');
|
|
346
347
|
if (nameNode) {
|
|
347
348
|
fields.push({
|