@optave/codegraph 3.13.0 → 3.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.
- package/README.md +35 -34
- package/dist/ast-analysis/engine.d.ts.map +1 -1
- package/dist/ast-analysis/engine.js +38 -40
- package/dist/ast-analysis/engine.js.map +1 -1
- package/dist/ast-analysis/rules/b2.d.ts +7 -0
- package/dist/ast-analysis/rules/b2.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b2.js +240 -0
- package/dist/ast-analysis/rules/b2.js.map +1 -0
- package/dist/ast-analysis/rules/b3.d.ts +6 -0
- package/dist/ast-analysis/rules/b3.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b3.js +105 -0
- package/dist/ast-analysis/rules/b3.js.map +1 -0
- package/dist/ast-analysis/rules/b4.d.ts +9 -0
- package/dist/ast-analysis/rules/b4.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b4.js +361 -0
- package/dist/ast-analysis/rules/b4.js.map +1 -0
- package/dist/ast-analysis/rules/b5.d.ts +4 -0
- package/dist/ast-analysis/rules/b5.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b5.js +52 -0
- package/dist/ast-analysis/rules/b5.js.map +1 -0
- package/dist/ast-analysis/rules/c.d.ts +4 -0
- package/dist/ast-analysis/rules/c.d.ts.map +1 -0
- package/dist/ast-analysis/rules/c.js +143 -0
- package/dist/ast-analysis/rules/c.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -1
- package/dist/ast-analysis/rules/index.js +34 -0
- package/dist/ast-analysis/rules/index.js.map +1 -1
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -1
- package/dist/ast-analysis/rules/javascript.js +3 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -1
- package/dist/ast-analysis/shared.d.ts.map +1 -1
- package/dist/ast-analysis/shared.js +2 -0
- package/dist/ast-analysis/shared.js.map +1 -1
- package/dist/ast-analysis/visitor-utils.d.ts +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -1
- package/dist/ast-analysis/visitor-utils.js +5 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -1
- package/dist/ast-analysis/visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitor.js +60 -47
- package/dist/ast-analysis/visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/cfg-visitor.js +126 -76
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/complexity-visitor.js +27 -15
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.js +54 -21
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +137 -134
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/roles.d.ts.map +1 -1
- package/dist/cli/commands/roles.js +6 -1
- package/dist/cli/commands/roles.js.map +1 -1
- package/dist/db/better-sqlite3.d.ts +2 -1
- package/dist/db/better-sqlite3.d.ts.map +1 -1
- package/dist/db/better-sqlite3.js.map +1 -1
- package/dist/db/connection.d.ts +7 -1
- package/dist/db/connection.d.ts.map +1 -1
- package/dist/db/connection.js +20 -5
- package/dist/db/connection.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +68 -0
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/repository/build-stmts.d.ts.map +1 -1
- package/dist/db/repository/build-stmts.js +18 -0
- package/dist/db/repository/build-stmts.js.map +1 -1
- package/dist/db/repository/dataflow.d.ts +5 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -1
- package/dist/db/repository/dataflow.js +14 -0
- package/dist/db/repository/dataflow.js.map +1 -1
- package/dist/db/repository/index.d.ts +1 -1
- package/dist/db/repository/index.d.ts.map +1 -1
- package/dist/db/repository/index.js +1 -1
- package/dist/db/repository/index.js.map +1 -1
- package/dist/db/repository/native-repository.d.ts.map +1 -1
- package/dist/db/repository/native-repository.js +47 -34
- package/dist/db/repository/native-repository.js.map +1 -1
- package/dist/domain/analysis/context.d.ts +2 -2
- package/dist/domain/analysis/dependencies.d.ts +2 -2
- package/dist/domain/analysis/diff-impact.d.ts +2 -2
- package/dist/domain/analysis/fn-impact.d.ts +3 -1
- package/dist/domain/analysis/fn-impact.d.ts.map +1 -1
- package/dist/domain/analysis/fn-impact.js +4 -0
- package/dist/domain/analysis/fn-impact.js.map +1 -1
- package/dist/domain/analysis/implementations.d.ts +2 -2
- package/dist/domain/analysis/module-map.d.ts.map +1 -1
- package/dist/domain/analysis/module-map.js +32 -5
- package/dist/domain/analysis/module-map.js.map +1 -1
- package/dist/domain/analysis/roles.d.ts +7 -1
- package/dist/domain/analysis/roles.d.ts.map +1 -1
- package/dist/domain/analysis/roles.js +16 -0
- package/dist/domain/analysis/roles.js.map +1 -1
- package/dist/domain/analysis/symbol-lookup.d.ts +4 -4
- package/dist/domain/graph/builder/call-resolver.d.ts +17 -5
- package/dist/domain/graph/builder/call-resolver.d.ts.map +1 -1
- package/dist/domain/graph/builder/call-resolver.js +85 -220
- package/dist/domain/graph/builder/call-resolver.js.map +1 -1
- package/dist/domain/graph/builder/context.d.ts +1 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -1
- package/dist/domain/graph/builder/context.js.map +1 -1
- package/dist/domain/graph/builder/helpers.d.ts +16 -1
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -1
- package/dist/domain/graph/builder/helpers.js +162 -72
- 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 +166 -97
- 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 +10 -4
- 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 +496 -250
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/collect-files.js +10 -7
- package/dist/domain/graph/builder/stages/collect-files.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 +2 -1
- package/dist/domain/graph/builder/stages/detect-changes.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 +895 -545
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -1
- package/dist/domain/graph/resolver/points-to.d.ts.map +1 -1
- package/dist/domain/graph/resolver/points-to.js +105 -57
- package/dist/domain/graph/resolver/points-to.js.map +1 -1
- package/dist/domain/graph/resolver/strategy.d.ts +61 -0
- package/dist/domain/graph/resolver/strategy.d.ts.map +1 -0
- package/dist/domain/graph/resolver/strategy.js +222 -0
- package/dist/domain/graph/resolver/strategy.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -1
- package/dist/domain/graph/watcher.js +16 -9
- package/dist/domain/graph/watcher.js.map +1 -1
- package/dist/domain/parser.d.ts +12 -0
- package/dist/domain/parser.d.ts.map +1 -1
- package/dist/domain/parser.js +12 -2
- package/dist/domain/parser.js.map +1 -1
- package/dist/domain/queries.d.ts +1 -1
- package/dist/domain/queries.d.ts.map +1 -1
- package/dist/domain/queries.js +1 -1
- package/dist/domain/queries.js.map +1 -1
- package/dist/domain/wasm-worker-entry.js +3 -0
- 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 +24 -5
- package/dist/domain/wasm-worker-pool.js.map +1 -1
- package/dist/domain/wasm-worker-protocol.d.ts +7 -0
- package/dist/domain/wasm-worker-protocol.d.ts.map +1 -1
- package/dist/extractors/dart.js +48 -3
- package/dist/extractors/dart.js.map +1 -1
- package/dist/extractors/groovy.js +62 -3
- package/dist/extractors/groovy.js.map +1 -1
- package/dist/extractors/helpers.d.ts +4 -2
- package/dist/extractors/helpers.d.ts.map +1 -1
- package/dist/extractors/helpers.js +5 -1
- package/dist/extractors/helpers.js.map +1 -1
- package/dist/extractors/java.js +77 -1
- package/dist/extractors/java.js.map +1 -1
- package/dist/extractors/javascript.d.ts.map +1 -1
- package/dist/extractors/javascript.js +549 -163
- package/dist/extractors/javascript.js.map +1 -1
- package/dist/extractors/kotlin.js +58 -3
- package/dist/extractors/kotlin.js.map +1 -1
- package/dist/extractors/objc.js +25 -2
- package/dist/extractors/objc.js.map +1 -1
- package/dist/extractors/scala.js +62 -2
- package/dist/extractors/scala.js.map +1 -1
- package/dist/extractors/swift.js +52 -3
- package/dist/extractors/swift.js.map +1 -1
- package/dist/features/audit.js +26 -23
- package/dist/features/audit.js.map +1 -1
- package/dist/features/boundaries.d.ts.map +1 -1
- package/dist/features/boundaries.js +12 -9
- package/dist/features/boundaries.js.map +1 -1
- package/dist/features/cfg.d.ts.map +1 -1
- package/dist/features/cfg.js +25 -18
- package/dist/features/cfg.js.map +1 -1
- package/dist/features/check.d.ts.map +1 -1
- package/dist/features/check.js +18 -5
- package/dist/features/check.js.map +1 -1
- package/dist/features/communities.d.ts +4 -2
- package/dist/features/communities.d.ts.map +1 -1
- package/dist/features/communities.js +6 -4
- package/dist/features/communities.js.map +1 -1
- package/dist/features/dataflow.d.ts +60 -0
- package/dist/features/dataflow.d.ts.map +1 -1
- package/dist/features/dataflow.js +530 -6
- package/dist/features/dataflow.js.map +1 -1
- package/dist/features/manifesto.d.ts.map +1 -1
- package/dist/features/manifesto.js +59 -72
- package/dist/features/manifesto.js.map +1 -1
- package/dist/features/sequence.d.ts.map +1 -1
- package/dist/features/sequence.js +27 -22
- package/dist/features/sequence.js.map +1 -1
- package/dist/features/snapshot.d.ts.map +1 -1
- package/dist/features/snapshot.js +36 -28
- package/dist/features/snapshot.js.map +1 -1
- package/dist/features/structure.d.ts.map +1 -1
- package/dist/features/structure.js +150 -62
- package/dist/features/structure.js.map +1 -1
- package/dist/features/triage.d.ts.map +1 -1
- package/dist/features/triage.js +18 -11
- package/dist/features/triage.js.map +1 -1
- package/dist/graph/algorithms/bfs.d.ts +1 -1
- package/dist/graph/algorithms/bfs.d.ts.map +1 -1
- package/dist/graph/algorithms/bfs.js +14 -13
- package/dist/graph/algorithms/bfs.js.map +1 -1
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -1
- package/dist/graph/algorithms/tarjan.js +5 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -1
- package/dist/graph/builders/dependency.js +28 -22
- package/dist/graph/builders/dependency.js.map +1 -1
- package/dist/graph/classifiers/roles.d.ts +10 -1
- package/dist/graph/classifiers/roles.d.ts.map +1 -1
- package/dist/graph/classifiers/roles.js +60 -6
- package/dist/graph/classifiers/roles.js.map +1 -1
- package/dist/infrastructure/config.d.ts +10 -0
- package/dist/infrastructure/config.d.ts.map +1 -1
- package/dist/infrastructure/config.js +31 -3
- package/dist/infrastructure/config.js.map +1 -1
- package/dist/infrastructure/registry.d.ts +0 -7
- package/dist/infrastructure/registry.d.ts.map +1 -1
- package/dist/infrastructure/registry.js +29 -13
- package/dist/infrastructure/registry.js.map +1 -1
- package/dist/infrastructure/update-check.d.ts.map +1 -1
- package/dist/infrastructure/update-check.js +49 -31
- package/dist/infrastructure/update-check.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -10
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/ast-query.d.ts +1 -1
- package/dist/mcp/tools/ast-query.d.ts.map +1 -1
- package/dist/mcp/tools/audit.d.ts +1 -1
- package/dist/mcp/tools/audit.d.ts.map +1 -1
- package/dist/mcp/tools/batch-query.d.ts +1 -1
- package/dist/mcp/tools/batch-query.d.ts.map +1 -1
- package/dist/mcp/tools/branch-compare.d.ts +1 -1
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -1
- package/dist/mcp/tools/brief.d.ts +1 -1
- package/dist/mcp/tools/brief.d.ts.map +1 -1
- package/dist/mcp/tools/cfg.d.ts +1 -1
- package/dist/mcp/tools/cfg.d.ts.map +1 -1
- package/dist/mcp/tools/check.d.ts +1 -1
- package/dist/mcp/tools/check.d.ts.map +1 -1
- package/dist/mcp/tools/co-changes.d.ts +1 -1
- package/dist/mcp/tools/co-changes.d.ts.map +1 -1
- package/dist/mcp/tools/code-owners.d.ts +1 -1
- package/dist/mcp/tools/code-owners.d.ts.map +1 -1
- package/dist/mcp/tools/communities.d.ts +1 -1
- package/dist/mcp/tools/communities.d.ts.map +1 -1
- package/dist/mcp/tools/complexity.d.ts +1 -1
- package/dist/mcp/tools/complexity.d.ts.map +1 -1
- package/dist/mcp/tools/context.d.ts +1 -1
- package/dist/mcp/tools/context.d.ts.map +1 -1
- package/dist/mcp/tools/dataflow.d.ts +1 -1
- package/dist/mcp/tools/dataflow.d.ts.map +1 -1
- package/dist/mcp/tools/diff-impact.d.ts +1 -1
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -1
- package/dist/mcp/tools/execution-flow.d.ts +1 -1
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -1
- package/dist/mcp/tools/export-graph.d.ts +1 -1
- package/dist/mcp/tools/export-graph.d.ts.map +1 -1
- package/dist/mcp/tools/file-deps.d.ts +1 -1
- package/dist/mcp/tools/file-deps.d.ts.map +1 -1
- package/dist/mcp/tools/file-exports.d.ts +1 -1
- package/dist/mcp/tools/file-exports.d.ts.map +1 -1
- package/dist/mcp/tools/find-cycles.d.ts +1 -1
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -1
- package/dist/mcp/tools/fn-impact.d.ts +1 -1
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -1
- package/dist/mcp/tools/impact-analysis.d.ts +1 -1
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -1
- package/dist/mcp/tools/implementations.d.ts +1 -1
- package/dist/mcp/tools/implementations.d.ts.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -5
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/interfaces.d.ts +1 -1
- package/dist/mcp/tools/interfaces.d.ts.map +1 -1
- package/dist/mcp/tools/list-functions.d.ts +1 -1
- package/dist/mcp/tools/list-functions.d.ts.map +1 -1
- package/dist/mcp/tools/list-repos.d.ts +1 -1
- package/dist/mcp/tools/list-repos.d.ts.map +1 -1
- package/dist/mcp/tools/module-map.d.ts +1 -1
- package/dist/mcp/tools/module-map.d.ts.map +1 -1
- package/dist/mcp/tools/node-roles.d.ts +1 -1
- package/dist/mcp/tools/node-roles.d.ts.map +1 -1
- package/dist/mcp/tools/path.d.ts +1 -1
- package/dist/mcp/tools/path.d.ts.map +1 -1
- package/dist/mcp/tools/query.d.ts +1 -1
- package/dist/mcp/tools/query.d.ts.map +1 -1
- package/dist/mcp/tools/semantic-search.d.ts +1 -1
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -1
- package/dist/mcp/tools/sequence.d.ts +1 -1
- package/dist/mcp/tools/sequence.d.ts.map +1 -1
- package/dist/mcp/tools/structure.d.ts +1 -1
- package/dist/mcp/tools/structure.d.ts.map +1 -1
- package/dist/mcp/tools/symbol-children.d.ts +1 -1
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -1
- package/dist/mcp/tools/triage.d.ts +1 -1
- package/dist/mcp/tools/triage.d.ts.map +1 -1
- package/dist/mcp/tools/where.d.ts +1 -1
- package/dist/mcp/tools/where.d.ts.map +1 -1
- package/dist/mcp/types.d.ts +19 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +1 -1
- package/dist/presentation/queries-cli/index.d.ts.map +1 -1
- package/dist/presentation/queries-cli/index.js +1 -1
- package/dist/presentation/queries-cli/index.js.map +1 -1
- package/dist/presentation/queries-cli/overview.d.ts +1 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -1
- package/dist/presentation/queries-cli/overview.js +20 -1
- package/dist/presentation/queries-cli/overview.js.map +1 -1
- package/dist/presentation/queries-cli.d.ts +1 -1
- package/dist/presentation/queries-cli.d.ts.map +1 -1
- package/dist/presentation/queries-cli.js +1 -1
- package/dist/presentation/queries-cli.js.map +1 -1
- package/dist/presentation/viewer.d.ts.map +1 -1
- package/dist/presentation/viewer.js +45 -32
- package/dist/presentation/viewer.js.map +1 -1
- package/dist/shared/constants.d.ts +21 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +25 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/normalize.d.ts.map +1 -1
- package/dist/shared/normalize.js +12 -22
- package/dist/shared/normalize.js.map +1 -1
- package/dist/shared/paginate.d.ts +4 -17
- package/dist/shared/paginate.d.ts.map +1 -1
- package/dist/shared/paginate.js.map +1 -1
- package/dist/types.d.ts +76 -1
- package/dist/types.d.ts.map +1 -1
- package/grammars/tree-sitter-erlang.wasm +0 -0
- package/package.json +7 -7
- package/src/ast-analysis/engine.ts +43 -63
- package/src/ast-analysis/rules/b2.ts +263 -0
- package/src/ast-analysis/rules/b3.ts +127 -0
- package/src/ast-analysis/rules/b4.ts +378 -0
- package/src/ast-analysis/rules/b5.ts +65 -0
- package/src/ast-analysis/rules/c.ts +157 -0
- package/src/ast-analysis/rules/index.ts +34 -0
- package/src/ast-analysis/rules/javascript.ts +3 -0
- package/src/ast-analysis/shared.ts +2 -0
- package/src/ast-analysis/visitor-utils.ts +5 -0
- package/src/ast-analysis/visitor.ts +82 -52
- package/src/ast-analysis/visitors/cfg-visitor.ts +198 -84
- package/src/ast-analysis/visitors/complexity-visitor.ts +44 -16
- package/src/ast-analysis/visitors/dataflow-visitor.ts +68 -29
- package/src/cli/commands/config.ts +184 -184
- package/src/cli/commands/roles.ts +6 -1
- package/src/db/better-sqlite3.ts +5 -4
- package/src/db/connection.ts +23 -5
- package/src/db/index.ts +1 -0
- package/src/db/migrations.ts +68 -0
- package/src/db/repository/build-stmts.ts +30 -0
- package/src/db/repository/dataflow.ts +16 -0
- package/src/db/repository/index.ts +1 -1
- package/src/db/repository/native-repository.ts +56 -40
- package/src/domain/analysis/fn-impact.ts +4 -0
- package/src/domain/analysis/module-map.ts +38 -6
- package/src/domain/analysis/roles.ts +23 -0
- package/src/domain/graph/builder/call-resolver.ts +112 -232
- package/src/domain/graph/builder/context.ts +1 -0
- package/src/domain/graph/builder/helpers.ts +190 -72
- package/src/domain/graph/builder/incremental.ts +249 -120
- package/src/domain/graph/builder/pipeline.ts +11 -5
- package/src/domain/graph/builder/stages/build-edges.ts +696 -296
- package/src/domain/graph/builder/stages/collect-files.ts +12 -6
- package/src/domain/graph/builder/stages/detect-changes.ts +3 -1
- package/src/domain/graph/builder/stages/native-orchestrator.ts +1102 -590
- package/src/domain/graph/resolver/points-to.ts +182 -59
- package/src/domain/graph/resolver/strategy.ts +265 -0
- package/src/domain/graph/watcher.ts +19 -9
- package/src/domain/parser.ts +12 -2
- package/src/domain/queries.ts +1 -1
- package/src/domain/wasm-worker-entry.ts +3 -0
- package/src/domain/wasm-worker-pool.ts +28 -4
- package/src/domain/wasm-worker-protocol.ts +4 -0
- package/src/extractors/dart.ts +48 -3
- package/src/extractors/groovy.ts +62 -2
- package/src/extractors/helpers.ts +5 -2
- package/src/extractors/java.ts +80 -1
- package/src/extractors/javascript.ts +566 -161
- package/src/extractors/kotlin.ts +57 -3
- package/src/extractors/objc.ts +25 -1
- package/src/extractors/scala.ts +63 -1
- package/src/extractors/swift.ts +46 -3
- package/src/features/audit.ts +43 -34
- package/src/features/boundaries.ts +17 -9
- package/src/features/cfg.ts +31 -22
- package/src/features/check.ts +21 -5
- package/src/features/communities.ts +28 -19
- package/src/features/dataflow.ts +755 -6
- package/src/features/manifesto.ts +76 -75
- package/src/features/sequence.ts +29 -23
- package/src/features/snapshot.ts +36 -25
- package/src/features/structure.ts +185 -55
- package/src/features/triage.ts +28 -15
- package/src/graph/algorithms/bfs.ts +13 -12
- package/src/graph/algorithms/tarjan.ts +5 -0
- package/src/graph/builders/dependency.ts +35 -23
- package/src/graph/classifiers/roles.ts +74 -7
- package/src/infrastructure/config.ts +32 -3
- package/src/infrastructure/registry.ts +44 -20
- package/src/infrastructure/update-check.ts +55 -33
- package/src/mcp/server.ts +2 -8
- package/src/mcp/tools/ast-query.ts +1 -1
- package/src/mcp/tools/audit.ts +1 -1
- package/src/mcp/tools/batch-query.ts +1 -1
- package/src/mcp/tools/branch-compare.ts +1 -1
- package/src/mcp/tools/brief.ts +1 -1
- package/src/mcp/tools/cfg.ts +1 -1
- package/src/mcp/tools/check.ts +1 -1
- package/src/mcp/tools/co-changes.ts +1 -1
- package/src/mcp/tools/code-owners.ts +1 -1
- package/src/mcp/tools/communities.ts +1 -1
- package/src/mcp/tools/complexity.ts +1 -1
- package/src/mcp/tools/context.ts +1 -1
- package/src/mcp/tools/dataflow.ts +1 -1
- package/src/mcp/tools/diff-impact.ts +1 -1
- package/src/mcp/tools/execution-flow.ts +1 -1
- package/src/mcp/tools/export-graph.ts +1 -1
- package/src/mcp/tools/file-deps.ts +1 -1
- package/src/mcp/tools/file-exports.ts +1 -1
- package/src/mcp/tools/find-cycles.ts +1 -1
- package/src/mcp/tools/fn-impact.ts +1 -1
- package/src/mcp/tools/impact-analysis.ts +1 -1
- package/src/mcp/tools/implementations.ts +1 -1
- package/src/mcp/tools/index.ts +2 -5
- package/src/mcp/tools/interfaces.ts +1 -1
- package/src/mcp/tools/list-functions.ts +1 -1
- package/src/mcp/tools/list-repos.ts +1 -1
- package/src/mcp/tools/module-map.ts +1 -1
- package/src/mcp/tools/node-roles.ts +1 -1
- package/src/mcp/tools/path.ts +1 -1
- package/src/mcp/tools/query.ts +1 -1
- package/src/mcp/tools/semantic-search.ts +1 -1
- package/src/mcp/tools/sequence.ts +1 -1
- package/src/mcp/tools/structure.ts +1 -1
- package/src/mcp/tools/symbol-children.ts +1 -1
- package/src/mcp/tools/triage.ts +1 -1
- package/src/mcp/tools/where.ts +1 -1
- package/src/mcp/types.ts +21 -0
- package/src/presentation/queries-cli/index.ts +1 -1
- package/src/presentation/queries-cli/overview.ts +35 -1
- package/src/presentation/queries-cli.ts +1 -0
- package/src/presentation/viewer.ts +98 -87
- package/src/shared/constants.ts +26 -0
- package/src/shared/normalize.ts +13 -22
- package/src/shared/paginate.ts +4 -18
- package/src/types.ts +86 -1
|
@@ -5,8 +5,16 @@
|
|
|
5
5
|
* Both callers supply a `CallNodeLookup` adapter that abstracts their
|
|
6
6
|
* node-lookup mechanism (pre-loaded Maps vs. per-query SQLite statements).
|
|
7
7
|
* The resolution logic lives here exactly once.
|
|
8
|
+
*
|
|
9
|
+
* `resolveByMethodOrGlobal` delegates its two branches to strategy helpers
|
|
10
|
+
* in `../resolver/strategy.ts` to keep per-strategy complexity manageable.
|
|
8
11
|
*/
|
|
9
12
|
import { computeConfidence } from '../resolve.js';
|
|
13
|
+
import {
|
|
14
|
+
isModuleScopedLanguage,
|
|
15
|
+
resolveByGlobal,
|
|
16
|
+
resolveByReceiver,
|
|
17
|
+
} from '../resolver/strategy.js';
|
|
10
18
|
|
|
11
19
|
// ── Public interface ─────────────────────────────────────────────────────
|
|
12
20
|
|
|
@@ -23,27 +31,9 @@ export interface CallNodeLookup {
|
|
|
23
31
|
|
|
24
32
|
export const RECEIVER_KINDS = new Set(['class', 'struct', 'interface', 'type', 'module']);
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* For these languages, the same-class fallback must not run for bare (no-receiver)
|
|
30
|
-
* calls that found no exact same-file match.
|
|
31
|
-
*/
|
|
32
|
-
const MODULE_SCOPED_BARE_CALL_EXTENSIONS = new Set([
|
|
33
|
-
'.js',
|
|
34
|
-
'.mjs',
|
|
35
|
-
'.cjs',
|
|
36
|
-
'.jsx',
|
|
37
|
-
'.ts',
|
|
38
|
-
'.tsx',
|
|
39
|
-
'.mts',
|
|
40
|
-
'.cts',
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
export function isModuleScopedLanguage(relPath: string): boolean {
|
|
44
|
-
const ext = relPath.slice(relPath.lastIndexOf('.'));
|
|
45
|
-
return MODULE_SCOPED_BARE_CALL_EXTENSIONS.has(ext);
|
|
46
|
-
}
|
|
34
|
+
// Re-export so consumers that import isModuleScopedLanguage from this module
|
|
35
|
+
// continue to work without changes (build-edges.ts, etc.).
|
|
36
|
+
export { isModuleScopedLanguage };
|
|
47
37
|
|
|
48
38
|
// ── Shared resolution functions ──────────────────────────────────────────
|
|
49
39
|
|
|
@@ -63,77 +53,106 @@ const CALLABLE_KINDS = new Set(['function', 'method']);
|
|
|
63
53
|
*/
|
|
64
54
|
const TOP_LEVEL_BINDING_KINDS = new Set(['variable', 'constant']);
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
type Def = { name: string; kind: string; line: number; endLine?: number | null };
|
|
57
|
+
type CallerMatch = { id: number; name: string } | null;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Find the narrowest enclosing function/method definition for `callLine`.
|
|
61
|
+
* Returns the DB node and name, or null if none encloses the call.
|
|
62
|
+
*/
|
|
63
|
+
function findEnclosingCallable(
|
|
67
64
|
lookup: CallNodeLookup,
|
|
68
|
-
|
|
69
|
-
definitions: ReadonlyArray<
|
|
70
|
-
name: string;
|
|
71
|
-
kind: string;
|
|
72
|
-
line: number;
|
|
73
|
-
endLine?: number | null;
|
|
74
|
-
}>,
|
|
65
|
+
callLine: number,
|
|
66
|
+
definitions: ReadonlyArray<Def>,
|
|
75
67
|
relPath: string,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
): CallerMatch {
|
|
69
|
+
let best: CallerMatch = null;
|
|
70
|
+
let bestSpan = Infinity;
|
|
71
|
+
for (const def of definitions) {
|
|
72
|
+
if (!CALLABLE_KINDS.has(def.kind)) continue;
|
|
73
|
+
if (def.line > callLine) continue;
|
|
74
|
+
const end = def.endLine ?? Infinity;
|
|
75
|
+
if (callLine > end) continue;
|
|
76
|
+
const span = end === Infinity ? Infinity : end - def.line;
|
|
77
|
+
if (span < bestSpan) {
|
|
78
|
+
const row = lookup.nodeId(def.name, def.kind, relPath, def.line);
|
|
79
|
+
if (row) {
|
|
80
|
+
best = { ...row, name: def.name };
|
|
81
|
+
bestSpan = span;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return best;
|
|
86
|
+
}
|
|
93
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Find the widest (outermost) enclosing variable/constant binding for `callLine`.
|
|
90
|
+
* Used as fallback for top-level bindings (e.g. Haskell `main = do …`).
|
|
91
|
+
* We pick the WIDEST span so that nested `let` bindings inside `main`'s
|
|
92
|
+
* do-block do not shadow `main` itself as the attributing caller.
|
|
93
|
+
*/
|
|
94
|
+
function findEnclosingBinding(
|
|
95
|
+
lookup: CallNodeLookup,
|
|
96
|
+
callLine: number,
|
|
97
|
+
definitions: ReadonlyArray<Def>,
|
|
98
|
+
relPath: string,
|
|
99
|
+
): CallerMatch {
|
|
100
|
+
let best: CallerMatch = null;
|
|
101
|
+
let bestSpan = -1; // looking for WIDEST span, so start at -1
|
|
94
102
|
for (const def of definitions) {
|
|
95
|
-
if (def.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
fnCallerSpan = span;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
} else if (TOP_LEVEL_BINDING_KINDS.has(def.kind)) {
|
|
109
|
-
if (span > varCallerSpan) {
|
|
110
|
-
const row = lookup.nodeId(def.name, def.kind, relPath, def.line);
|
|
111
|
-
if (row) {
|
|
112
|
-
varCaller = row;
|
|
113
|
-
varCallerName = def.name;
|
|
114
|
-
varCallerSpan = span;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
103
|
+
if (!TOP_LEVEL_BINDING_KINDS.has(def.kind)) continue;
|
|
104
|
+
if (def.line > callLine) continue;
|
|
105
|
+
const end = def.endLine ?? Infinity;
|
|
106
|
+
if (callLine > end) continue;
|
|
107
|
+
const span = end === Infinity ? Infinity : end - def.line;
|
|
108
|
+
if (span > bestSpan) {
|
|
109
|
+
const row = lookup.nodeId(def.name, def.kind, relPath, def.line);
|
|
110
|
+
if (row) {
|
|
111
|
+
best = { ...row, name: def.name };
|
|
112
|
+
bestSpan = span;
|
|
118
113
|
}
|
|
119
114
|
}
|
|
120
115
|
}
|
|
116
|
+
return best;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function findCaller(
|
|
120
|
+
lookup: CallNodeLookup,
|
|
121
|
+
call: { line: number },
|
|
122
|
+
definitions: ReadonlyArray<Def>,
|
|
123
|
+
relPath: string,
|
|
124
|
+
fileNodeRow: { id: number },
|
|
125
|
+
): { id: number; callerName: string | null } {
|
|
126
|
+
// Pass 1: find the narrowest enclosing function/method.
|
|
127
|
+
const fnCaller = findEnclosingCallable(lookup, call.line, definitions, relPath);
|
|
121
128
|
|
|
122
129
|
// Prefer function/method enclosing scope over variable binding.
|
|
123
|
-
// If a function/method encloses the call, use it — local variable
|
|
124
|
-
// declarations inside the function body must not shadow it.
|
|
125
130
|
// Only fall back to a variable/constant binding when the call is at
|
|
126
131
|
// top-level scope (no enclosing function/method found), which handles
|
|
127
132
|
// languages like Haskell where `main` is a top-level `bind` node.
|
|
128
133
|
if (fnCaller) {
|
|
129
|
-
return {
|
|
134
|
+
return { id: fnCaller.id, callerName: fnCaller.name };
|
|
130
135
|
}
|
|
136
|
+
|
|
137
|
+
// Pass 2: find the widest (outermost) enclosing variable/constant binding.
|
|
138
|
+
const varCaller = findEnclosingBinding(lookup, call.line, definitions, relPath);
|
|
131
139
|
if (varCaller) {
|
|
132
|
-
return {
|
|
140
|
+
return { id: varCaller.id, callerName: varCaller.name };
|
|
133
141
|
}
|
|
142
|
+
|
|
134
143
|
return { ...fileNodeRow, callerName: null };
|
|
135
144
|
}
|
|
136
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Dispatcher for call-site resolution.
|
|
148
|
+
*
|
|
149
|
+
* Delegates to two strategy helpers (in `../resolver/strategy.ts`) to keep
|
|
150
|
+
* each branch independently readable and under the complexity threshold:
|
|
151
|
+
* - resolveByReceiver — receiver is a concrete object/class reference
|
|
152
|
+
* - resolveByGlobal — bare call, or this/self/super receiver
|
|
153
|
+
*
|
|
154
|
+
* The original logic is unchanged; only the physical location moved.
|
|
155
|
+
*/
|
|
137
156
|
export function resolveByMethodOrGlobal(
|
|
138
157
|
lookup: CallNodeLookup,
|
|
139
158
|
call: { name: string; receiver?: string | null },
|
|
@@ -141,103 +160,19 @@ export function resolveByMethodOrGlobal(
|
|
|
141
160
|
typeMap: Map<string, unknown>,
|
|
142
161
|
callerName?: string | null,
|
|
143
162
|
): ReadonlyArray<{ id: number; file: string }> {
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const dotIdx = callerName.lastIndexOf('.');
|
|
158
|
-
if (dotIdx > -1) {
|
|
159
|
-
const callerClass = callerName.slice(0, dotIdx);
|
|
160
|
-
typeEntry = typeMap.get(`${callerClass}.${effectiveReceiver}`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
typeEntry ??=
|
|
164
|
-
typeMap.get(effectiveReceiver) ??
|
|
165
|
-
typeMap.get(call.receiver) ??
|
|
166
|
-
// Phase 8.3f: callee-scoped rest-param key (`callee::restName`) to avoid
|
|
167
|
-
// same-name rest-binding collision across functions in the same file (#1358).
|
|
168
|
-
(callerName ? typeMap.get(`${callerName}::${effectiveReceiver}`) : undefined);
|
|
169
|
-
let typeName = typeEntry
|
|
170
|
-
? typeof typeEntry === 'string'
|
|
171
|
-
? typeEntry
|
|
172
|
-
: (typeEntry as { type?: string }).type
|
|
173
|
-
: null;
|
|
174
|
-
|
|
175
|
-
// Belt-and-suspenders fallback for inline new-expression receivers that
|
|
176
|
-
// extractReceiverName did not normalise (e.g. raw text leaked from an
|
|
177
|
-
// unhandled AST node type). extractReceiverName already handles the common
|
|
178
|
-
// `new_expression` / `parenthesized_expression(new_expression)` shapes by
|
|
179
|
-
// returning the constructor name directly, so this branch is exercised only
|
|
180
|
-
// by future node types or constructs that fall through to the raw-text path.
|
|
181
|
-
// The uppercase-initial restriction ([A-Z_$]) is a heuristic to distinguish
|
|
182
|
-
// constructors (PascalCase) from regular functions and avoids false positives
|
|
183
|
-
// on `(new xmlParser()).parse()` style calls.
|
|
184
|
-
if (!typeName && call.receiver) {
|
|
185
|
-
const m = /^\(?\s*new\s+([A-Z_$][A-Za-z0-9_$]*)/.exec(call.receiver);
|
|
186
|
-
if (m?.[1]) typeName = m[1];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (typeName) {
|
|
190
|
-
const typed = lookup
|
|
191
|
-
.byName(`${typeName}.${call.name}`)
|
|
192
|
-
.filter((n) => n.kind === 'method' && computeConfidence(relPath, n.file, null) >= 0.5);
|
|
193
|
-
if (typed.length > 0) return typed;
|
|
194
|
-
|
|
195
|
-
// Prototype alias: `Foo.prototype.bar = identifier` seeds typeMap['Foo.bar'] = { type: identifier }.
|
|
196
|
-
// Checked after the symbol-DB lookup so an actual method definition always wins.
|
|
197
|
-
const protoEntry = typeMap.get(`${typeName}.${call.name}`);
|
|
198
|
-
const protoTarget = protoEntry
|
|
199
|
-
? typeof protoEntry === 'string'
|
|
200
|
-
? protoEntry
|
|
201
|
-
: (protoEntry as { type?: string }).type
|
|
202
|
-
: null;
|
|
203
|
-
if (protoTarget) {
|
|
204
|
-
const resolved = lookup
|
|
205
|
-
.byName(protoTarget)
|
|
206
|
-
.filter((t) => computeConfidence(relPath, t.file, null) >= 0.5);
|
|
207
|
-
if (resolved.length > 0) return resolved;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Direct qualified method lookup: ClassName.staticMethod() or ClassName.instanceMethod()
|
|
212
|
-
// when the receiver is a class name with no typeMap entry. Handles static method calls
|
|
213
|
-
// like `C6.staticMethod()` or `D.d()` where the receiver IS the class.
|
|
214
|
-
// Matches both 'method' and 'function' kinds to cover field-initializer synthetic defs.
|
|
215
|
-
if (!typeName) {
|
|
216
|
-
const qualifiedName = `${effectiveReceiver}.${call.name}`;
|
|
217
|
-
const direct = lookup
|
|
218
|
-
.byName(qualifiedName)
|
|
219
|
-
.filter(
|
|
220
|
-
(n) =>
|
|
221
|
-
(n.kind === 'method' || n.kind === 'function') &&
|
|
222
|
-
computeConfidence(relPath, n.file, null) >= 0.5,
|
|
223
|
-
);
|
|
224
|
-
if (direct.length > 0) return direct;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Phase 8.3d: composite pts key — `obj.prop = fn` seeds typeMap['obj.prop'] = { type: 'fn' }.
|
|
228
|
-
// When a call site references `obj.prop` as a callback, resolve directly to the target fn.
|
|
229
|
-
const compositeEntry = typeMap.get(`${call.receiver}.${call.name}`);
|
|
230
|
-
const ptsTarget = compositeEntry
|
|
231
|
-
? typeof compositeEntry === 'string'
|
|
232
|
-
? compositeEntry
|
|
233
|
-
: (compositeEntry as { type?: string }).type
|
|
234
|
-
: null;
|
|
235
|
-
if (ptsTarget) {
|
|
236
|
-
const resolved = lookup
|
|
237
|
-
.byName(ptsTarget)
|
|
238
|
-
.filter((t) => computeConfidence(relPath, t.file, null) >= 0.5);
|
|
239
|
-
if (resolved.length > 0) return resolved;
|
|
240
|
-
}
|
|
163
|
+
if (
|
|
164
|
+
call.receiver &&
|
|
165
|
+
call.receiver !== 'this' &&
|
|
166
|
+
call.receiver !== 'self' &&
|
|
167
|
+
call.receiver !== 'super'
|
|
168
|
+
) {
|
|
169
|
+
return resolveByReceiver(
|
|
170
|
+
lookup,
|
|
171
|
+
call as { name: string; receiver: string },
|
|
172
|
+
relPath,
|
|
173
|
+
typeMap,
|
|
174
|
+
callerName,
|
|
175
|
+
);
|
|
241
176
|
}
|
|
242
177
|
if (
|
|
243
178
|
!call.receiver ||
|
|
@@ -245,68 +180,7 @@ export function resolveByMethodOrGlobal(
|
|
|
245
180
|
call.receiver === 'self' ||
|
|
246
181
|
call.receiver === 'super'
|
|
247
182
|
) {
|
|
248
|
-
|
|
249
|
-
// When a plain function (no class prefix) is registered as a get/set accessor for `obj`
|
|
250
|
-
// via Object.defineProperty, typeMap seeds 'callerName:this' = 'obj'.
|
|
251
|
-
// We then resolve this.method() → typeMap['obj.method'] → the concrete definition.
|
|
252
|
-
// This runs before the broad exact-name lookup to avoid false positives from
|
|
253
|
-
// unrelated same-file definitions.
|
|
254
|
-
if (call.receiver === 'this' && callerName && !callerName.includes('.')) {
|
|
255
|
-
const accessorThisEntry = typeMap.get(`${callerName}:this`);
|
|
256
|
-
const objName = accessorThisEntry
|
|
257
|
-
? typeof accessorThisEntry === 'string'
|
|
258
|
-
? accessorThisEntry
|
|
259
|
-
: (accessorThisEntry as { type?: string }).type
|
|
260
|
-
: null;
|
|
261
|
-
if (objName) {
|
|
262
|
-
const objMethodEntry = typeMap.get(`${objName}.${call.name}`);
|
|
263
|
-
const targetFn = objMethodEntry
|
|
264
|
-
? typeof objMethodEntry === 'string'
|
|
265
|
-
? objMethodEntry
|
|
266
|
-
: (objMethodEntry as { type?: string }).type
|
|
267
|
-
: null;
|
|
268
|
-
if (targetFn) {
|
|
269
|
-
const resolved = lookup
|
|
270
|
-
.byName(targetFn)
|
|
271
|
-
.filter((t) => computeConfidence(relPath, t.file, null) >= 0.5);
|
|
272
|
-
if (resolved.length > 0) return resolved;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const exact = lookup
|
|
278
|
-
.byName(call.name)
|
|
279
|
-
.filter((t) => computeConfidence(relPath, t.file, null) >= 0.5);
|
|
280
|
-
if (exact.length > 0) return exact;
|
|
281
|
-
|
|
282
|
-
// Try same-class method lookup via callerName.
|
|
283
|
-
// e.g. `this.area()` inside `Shape.describe` → try `Shape.area`.
|
|
284
|
-
// Also covers no-receiver calls inside class methods, e.g. `IsValidEmail(x)` inside
|
|
285
|
-
// `Validators.ValidateUser` → try `Validators.IsValidEmail` (C#/Java static siblings).
|
|
286
|
-
// This seeds the initial edge that runChaPostPass later expands to subclass overrides.
|
|
287
|
-
//
|
|
288
|
-
// For JS/TS, bare (no-receiver) calls are module-scoped — there is no implicit class
|
|
289
|
-
// binding. Skip the same-class fallback for bare calls in those languages to prevent
|
|
290
|
-
// false positives (e.g. `flush()` inside `Processor.run` must not resolve to
|
|
291
|
-
// `Processor.flush`). this.method() calls are unaffected: they still reach the fallback
|
|
292
|
-
// because `call.receiver === 'this'` is truthy, not a bare call.
|
|
293
|
-
const isBareCall = !call.receiver;
|
|
294
|
-
if (callerName && !(isBareCall && isModuleScopedLanguage(relPath))) {
|
|
295
|
-
const dotIdx = callerName.lastIndexOf('.');
|
|
296
|
-
if (dotIdx > -1) {
|
|
297
|
-
// Extract only the segment immediately before the method name so that
|
|
298
|
-
// 'Namespace.ClassName.method' yields 'ClassName', not 'Namespace.ClassName'.
|
|
299
|
-
// Symbols are stored under their bare class name, not their qualified path.
|
|
300
|
-
const prevDot = callerName.lastIndexOf('.', dotIdx - 1);
|
|
301
|
-
const callerClass = callerName.slice(prevDot + 1, dotIdx);
|
|
302
|
-
const qualifiedName = `${callerClass}.${call.name}`;
|
|
303
|
-
const sameClass = lookup
|
|
304
|
-
.byName(qualifiedName)
|
|
305
|
-
.filter((t) => t.kind === 'method' && computeConfidence(relPath, t.file, null) >= 0.5);
|
|
306
|
-
if (sameClass.length > 0) return sameClass;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return exact; // empty
|
|
183
|
+
return resolveByGlobal(lookup, call, relPath, typeMap, callerName);
|
|
310
184
|
}
|
|
311
185
|
return [];
|
|
312
186
|
}
|
|
@@ -319,6 +193,12 @@ export function resolveCallTargets(
|
|
|
319
193
|
typeMap: Map<string, unknown>,
|
|
320
194
|
callerName?: string | null,
|
|
321
195
|
): { targets: Array<{ id: number; file: string }>; importedFrom: string | undefined } {
|
|
196
|
+
// Flagged dynamic calls use synthetic names like '<dynamic:eval>'. Short-circuit
|
|
197
|
+
// so they never accidentally match a real symbol via lookup.byName.
|
|
198
|
+
if (call.name.startsWith('<dynamic:')) {
|
|
199
|
+
return { targets: [], importedFrom: undefined };
|
|
200
|
+
}
|
|
201
|
+
|
|
322
202
|
const importedFrom = importedNames.get(call.name);
|
|
323
203
|
let targets: ReadonlyArray<{ id: number; file: string }> | undefined;
|
|
324
204
|
|