gitnexus 1.6.8-rc.8 → 1.6.8
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 +3 -3
- package/dist/_shared/graph/types.d.ts +31 -1
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/language-detection.d.ts.map +1 -1
- package/dist/_shared/language-detection.js +11 -1
- package/dist/_shared/language-detection.js.map +1 -1
- package/dist/_shared/lbug/schema-constants.d.ts +1 -1
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
- package/dist/_shared/lbug/schema-constants.js +6 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +21 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +6 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +31 -1
- package/dist/cli/ai-context.js +18 -16
- package/dist/cli/analyze-config.js +11 -0
- package/dist/cli/analyze.d.ts +14 -0
- package/dist/cli/analyze.js +98 -0
- package/dist/cli/embedding-dims.d.ts +33 -0
- package/dist/cli/embedding-dims.js +39 -0
- package/dist/cli/eval-server.d.ts +8 -0
- package/dist/cli/eval-server.js +242 -2
- package/dist/cli/help-i18n.js +19 -0
- package/dist/cli/i18n/en.d.ts +15 -1
- package/dist/cli/i18n/en.js +15 -1
- package/dist/cli/i18n/resources.d.ts +29 -1
- package/dist/cli/i18n/zh-CN.d.ts +14 -0
- package/dist/cli/i18n/zh-CN.js +15 -1
- package/dist/cli/index.js +89 -1
- package/dist/cli/mcp.d.ts +6 -1
- package/dist/cli/mcp.js +26 -1
- package/dist/cli/optional-grammars.d.ts +6 -8
- package/dist/cli/optional-grammars.js +8 -11
- package/dist/cli/setup.d.ts +3 -1
- package/dist/cli/setup.js +67 -17
- package/dist/cli/skill-gen.js +2 -1
- package/dist/cli/tool.d.ts +19 -1
- package/dist/cli/tool.js +96 -3
- package/dist/core/embeddings/hf-env.d.ts +0 -66
- package/dist/core/embeddings/http-client.d.ts +7 -0
- package/dist/core/embeddings/http-client.js +5 -3
- package/dist/core/embeddings/server-mapping.d.ts +1 -1
- package/dist/core/embeddings/server-mapping.js +7 -3
- package/dist/core/graph/import-cycles.d.ts +10 -0
- package/dist/core/graph/import-cycles.js +103 -0
- package/dist/core/group/cross-impact.d.ts +2 -1
- package/dist/core/group/cross-impact.js +5 -1
- package/dist/core/group/extractors/grpc-patterns/proto.js +10 -6
- package/dist/core/group/extractors/http-patterns/kotlin.js +7 -7
- package/dist/core/group/extractors/http-route-extractor.d.ts +24 -0
- package/dist/core/group/extractors/http-route-extractor.js +22 -4
- package/dist/core/group/extractors/include-extractor.js +22 -13
- package/dist/core/group/sync.d.ts +27 -1
- package/dist/core/group/sync.js +0 -0
- package/dist/core/incremental/subgraph-extract.js +18 -1
- package/dist/core/ingestion/cfg/cfg-builder.d.ts +114 -0
- package/dist/core/ingestion/cfg/cfg-builder.js +196 -0
- package/dist/core/ingestion/cfg/collect.d.ts +51 -0
- package/dist/core/ingestion/cfg/collect.js +77 -0
- package/dist/core/ingestion/cfg/control-dependence.d.ts +58 -0
- package/dist/core/ingestion/cfg/control-dependence.js +182 -0
- package/dist/core/ingestion/cfg/control-flow-context.d.ts +106 -0
- package/dist/core/ingestion/cfg/control-flow-context.js +124 -0
- package/dist/core/ingestion/cfg/emit.d.ts +293 -0
- package/dist/core/ingestion/cfg/emit.js +646 -0
- package/dist/core/ingestion/cfg/post-dominators.d.ts +79 -0
- package/dist/core/ingestion/cfg/post-dominators.js +176 -0
- package/dist/core/ingestion/cfg/reaching-def-reason-codec.d.ts +106 -0
- package/dist/core/ingestion/cfg/reaching-def-reason-codec.js +133 -0
- package/dist/core/ingestion/cfg/reaching-defs-graph.d.ts +18 -0
- package/dist/core/ingestion/cfg/reaching-defs-graph.js +312 -0
- package/dist/core/ingestion/cfg/reaching-defs.d.ts +162 -0
- package/dist/core/ingestion/cfg/reaching-defs.js +785 -0
- package/dist/core/ingestion/cfg/synthetic-escape.d.ts +124 -0
- package/dist/core/ingestion/cfg/synthetic-escape.js +300 -0
- package/dist/core/ingestion/cfg/traversal-result.d.ts +20 -0
- package/dist/core/ingestion/cfg/traversal-result.js +2 -0
- package/dist/core/ingestion/cfg/types.d.ts +274 -0
- package/dist/core/ingestion/cfg/types.js +13 -0
- package/dist/core/ingestion/cfg/visitors/c-cpp-harvest.d.ts +111 -0
- package/dist/core/ingestion/cfg/visitors/c-cpp-harvest.js +541 -0
- package/dist/core/ingestion/cfg/visitors/c-cpp.d.ts +74 -0
- package/dist/core/ingestion/cfg/visitors/c-cpp.js +584 -0
- package/dist/core/ingestion/cfg/visitors/call-site-harvest.d.ts +195 -0
- package/dist/core/ingestion/cfg/visitors/call-site-harvest.js +350 -0
- package/dist/core/ingestion/cfg/visitors/csharp-harvest.d.ts +124 -0
- package/dist/core/ingestion/cfg/visitors/csharp-harvest.js +589 -0
- package/dist/core/ingestion/cfg/visitors/csharp.d.ts +87 -0
- package/dist/core/ingestion/cfg/visitors/csharp.js +867 -0
- package/dist/core/ingestion/cfg/visitors/dart-harvest.d.ts +278 -0
- package/dist/core/ingestion/cfg/visitors/dart-harvest.js +870 -0
- package/dist/core/ingestion/cfg/visitors/dart.d.ts +119 -0
- package/dist/core/ingestion/cfg/visitors/dart.js +836 -0
- package/dist/core/ingestion/cfg/visitors/go-harvest.d.ts +160 -0
- package/dist/core/ingestion/cfg/visitors/go-harvest.js +621 -0
- package/dist/core/ingestion/cfg/visitors/go.d.ts +108 -0
- package/dist/core/ingestion/cfg/visitors/go.js +638 -0
- package/dist/core/ingestion/cfg/visitors/java-harvest.d.ts +108 -0
- package/dist/core/ingestion/cfg/visitors/java-harvest.js +513 -0
- package/dist/core/ingestion/cfg/visitors/java.d.ts +101 -0
- package/dist/core/ingestion/cfg/visitors/java.js +812 -0
- package/dist/core/ingestion/cfg/visitors/kotlin-harvest.d.ts +253 -0
- package/dist/core/ingestion/cfg/visitors/kotlin-harvest.js +719 -0
- package/dist/core/ingestion/cfg/visitors/kotlin.d.ts +121 -0
- package/dist/core/ingestion/cfg/visitors/kotlin.js +809 -0
- package/dist/core/ingestion/cfg/visitors/php-harvest.d.ts +172 -0
- package/dist/core/ingestion/cfg/visitors/php-harvest.js +626 -0
- package/dist/core/ingestion/cfg/visitors/php.d.ts +96 -0
- package/dist/core/ingestion/cfg/visitors/php.js +721 -0
- package/dist/core/ingestion/cfg/visitors/python-harvest.d.ts +212 -0
- package/dist/core/ingestion/cfg/visitors/python-harvest.js +739 -0
- package/dist/core/ingestion/cfg/visitors/python.d.ts +103 -0
- package/dist/core/ingestion/cfg/visitors/python.js +558 -0
- package/dist/core/ingestion/cfg/visitors/ruby-harvest.d.ts +223 -0
- package/dist/core/ingestion/cfg/visitors/ruby-harvest.js +587 -0
- package/dist/core/ingestion/cfg/visitors/ruby.d.ts +112 -0
- package/dist/core/ingestion/cfg/visitors/ruby.js +756 -0
- package/dist/core/ingestion/cfg/visitors/rust-harvest.d.ts +324 -0
- package/dist/core/ingestion/cfg/visitors/rust-harvest.js +873 -0
- package/dist/core/ingestion/cfg/visitors/rust.d.ts +95 -0
- package/dist/core/ingestion/cfg/visitors/rust.js +558 -0
- package/dist/core/ingestion/cfg/visitors/scope-tree-harvest.d.ts +87 -0
- package/dist/core/ingestion/cfg/visitors/scope-tree-harvest.js +116 -0
- package/dist/core/ingestion/cfg/visitors/swift-harvest.d.ts +255 -0
- package/dist/core/ingestion/cfg/visitors/swift-harvest.js +679 -0
- package/dist/core/ingestion/cfg/visitors/swift.d.ts +116 -0
- package/dist/core/ingestion/cfg/visitors/swift.js +787 -0
- package/dist/core/ingestion/cfg/visitors/typescript-harvest.d.ts +149 -0
- package/dist/core/ingestion/cfg/visitors/typescript-harvest.js +1056 -0
- package/dist/core/ingestion/cfg/visitors/typescript.d.ts +66 -0
- package/dist/core/ingestion/cfg/visitors/typescript.js +583 -0
- package/dist/core/ingestion/import-resolvers/utils.js +2 -0
- package/dist/core/ingestion/language-provider.d.ts +23 -2
- package/dist/core/ingestion/languages/c-cpp.js +17 -5
- package/dist/core/ingestion/languages/cobol.js +4 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +41 -2
- package/dist/core/ingestion/languages/cpp/captures.js +50 -1
- package/dist/core/ingestion/languages/cpp/conversion-rank.d.ts +2 -0
- package/dist/core/ingestion/languages/cpp/conversion-rank.js +89 -0
- package/dist/core/ingestion/languages/cpp/header-scan.d.ts +1 -1
- package/dist/core/ingestion/languages/cpp/header-scan.js +2 -2
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +7 -2
- package/dist/core/ingestion/languages/cpp/member-lookup.js +2 -1
- package/dist/core/ingestion/languages/cpp/query.js +23 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +2 -1
- package/dist/core/ingestion/languages/csharp.js +2 -0
- package/dist/core/ingestion/languages/dart.js +2 -0
- package/dist/core/ingestion/languages/go.js +2 -0
- package/dist/core/ingestion/languages/java.js +3 -0
- package/dist/core/ingestion/languages/kotlin/query.js +3 -2
- package/dist/core/ingestion/languages/kotlin.js +8 -1
- package/dist/core/ingestion/languages/php.js +2 -0
- package/dist/core/ingestion/languages/python.js +2 -0
- package/dist/core/ingestion/languages/ruby.js +2 -0
- package/dist/core/ingestion/languages/rust.js +2 -0
- package/dist/core/ingestion/languages/swift.js +2 -0
- package/dist/core/ingestion/languages/typescript.js +5 -0
- package/dist/core/ingestion/languages/vue.js +6 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.js +6 -13
- package/dist/core/ingestion/method-extractors/generic.js +1 -0
- package/dist/core/ingestion/method-types.d.ts +2 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -0
- package/dist/core/ingestion/model/symbol-table.js +1 -0
- package/dist/core/ingestion/mro-processor.js +109 -0
- package/dist/core/ingestion/parsing-processor.js +44 -0
- package/dist/core/ingestion/pipeline-phases/call-summaries.d.ts +26 -0
- package/dist/core/ingestion/pipeline-phases/call-summaries.js +46 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +2 -0
- package/dist/core/ingestion/pipeline-phases/index.js +2 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +0 -21
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +18 -1
- package/dist/core/ingestion/pipeline-phases/routes.d.ts +10 -0
- package/dist/core/ingestion/pipeline-phases/routes.js +30 -1
- package/dist/core/ingestion/pipeline-phases/taint-summaries.d.ts +30 -0
- package/dist/core/ingestion/pipeline-phases/taint-summaries.js +81 -0
- package/dist/core/ingestion/pipeline.d.ts +92 -10
- package/dist/core/ingestion/pipeline.js +11 -2
- package/dist/core/ingestion/scope-extractor.js +12 -2
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +9 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.d.ts +75 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +67 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +12 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +14 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +6 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +13 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +9 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +28 -2
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +4 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +9 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +6 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +174 -40
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +24 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +276 -190
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +43 -3
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +75 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +349 -1
- package/dist/core/ingestion/scope-resolution/resolution-outcome.d.ts +1 -1
- package/dist/core/ingestion/taint/call-summary-codec.d.ts +75 -0
- package/dist/core/ingestion/taint/call-summary-codec.js +128 -0
- package/dist/core/ingestion/taint/call-summary-emit.d.ts +43 -0
- package/dist/core/ingestion/taint/call-summary-emit.js +70 -0
- package/dist/core/ingestion/taint/call-summary-harvest.d.ts +77 -0
- package/dist/core/ingestion/taint/call-summary-harvest.js +179 -0
- package/dist/core/ingestion/taint/call-summary-model.d.ts +47 -0
- package/dist/core/ingestion/taint/call-summary-model.js +25 -0
- package/dist/core/ingestion/taint/emit.d.ts +125 -0
- package/dist/core/ingestion/taint/emit.js +208 -0
- package/dist/core/ingestion/taint/interproc-emit.d.ts +50 -0
- package/dist/core/ingestion/taint/interproc-emit.js +88 -0
- package/dist/core/ingestion/taint/interproc-solver.d.ts +110 -0
- package/dist/core/ingestion/taint/interproc-solver.js +312 -0
- package/dist/core/ingestion/taint/match.d.ts +153 -0
- package/dist/core/ingestion/taint/match.js +278 -0
- package/dist/core/ingestion/taint/path-codec.d.ts +134 -0
- package/dist/core/ingestion/taint/path-codec.js +190 -0
- package/dist/core/ingestion/taint/propagate.d.ts +216 -0
- package/dist/core/ingestion/taint/propagate.js +659 -0
- package/dist/core/ingestion/taint/site-safety.d.ts +29 -0
- package/dist/core/ingestion/taint/site-safety.js +98 -0
- package/dist/core/ingestion/taint/source-sink-config.d.ts +107 -23
- package/dist/core/ingestion/taint/source-sink-config.js +35 -12
- package/dist/core/ingestion/taint/source-sink-registry.d.ts +6 -4
- package/dist/core/ingestion/taint/source-sink-registry.js +6 -4
- package/dist/core/ingestion/taint/summary-harvest-driver.d.ts +80 -0
- package/dist/core/ingestion/taint/summary-harvest-driver.js +179 -0
- package/dist/core/ingestion/taint/summary-harvest.d.ts +89 -0
- package/dist/core/ingestion/taint/summary-harvest.js +537 -0
- package/dist/core/ingestion/taint/summary-model.d.ts +200 -0
- package/dist/core/ingestion/taint/summary-model.js +86 -0
- package/dist/core/ingestion/taint/typescript-model.d.ts +38 -0
- package/dist/core/ingestion/taint/typescript-model.js +102 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +21 -0
- package/dist/core/ingestion/utils/env.d.ts +7 -0
- package/dist/core/ingestion/utils/env.js +12 -0
- package/dist/core/ingestion/utils/method-props.js +1 -0
- package/dist/core/ingestion/workers/clone-safety.d.ts +109 -0
- package/dist/core/ingestion/workers/clone-safety.js +465 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +23 -0
- package/dist/core/ingestion/workers/parse-worker.js +81 -53
- package/dist/core/ingestion/workers/post-result.d.ts +22 -0
- package/dist/core/ingestion/workers/post-result.js +87 -0
- package/dist/core/ingestion/workers/result-merge.d.ts +20 -0
- package/dist/core/ingestion/workers/result-merge.js +43 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +15 -40
- package/dist/core/ingestion/workers/worker-pool.js +43 -16
- package/dist/core/lbug/csv-generator.d.ts +51 -3
- package/dist/core/lbug/csv-generator.js +369 -255
- package/dist/core/lbug/lbug-adapter.d.ts +58 -18
- package/dist/core/lbug/lbug-adapter.js +346 -84
- package/dist/core/lbug/lbug-config.d.ts +19 -0
- package/dist/core/lbug/lbug-config.js +29 -0
- package/dist/core/lbug/pdg-emit-sink.d.ts +127 -0
- package/dist/core/lbug/pdg-emit-sink.js +358 -0
- package/dist/core/lbug/pool-adapter.d.ts +35 -0
- package/dist/core/lbug/pool-adapter.js +90 -1
- package/dist/core/lbug/rel-pair-routing.d.ts +54 -0
- package/dist/core/lbug/rel-pair-routing.js +140 -0
- package/dist/core/lbug/schema.d.ts +2 -2
- package/dist/core/lbug/schema.js +3 -0
- package/dist/core/logger.d.ts +0 -5
- package/dist/core/run-analyze.d.ts +96 -0
- package/dist/core/run-analyze.js +207 -3
- package/dist/core/tree-sitter/parser-loader.js +5 -4
- package/dist/core/tree-sitter/safe-parse.d.ts +0 -5
- package/dist/core/tree-sitter/vendored-grammars.d.ts +39 -0
- package/dist/core/tree-sitter/vendored-grammars.js +57 -0
- package/dist/core/wiki/generator.js +3 -1
- package/dist/core/wiki/graph-queries.d.ts +6 -0
- package/dist/core/wiki/graph-queries.js +9 -1
- package/dist/mcp/http-transport.d.ts +134 -0
- package/dist/mcp/http-transport.js +503 -0
- package/dist/mcp/local/local-backend.d.ts +110 -24
- package/dist/mcp/local/local-backend.js +1225 -19
- package/dist/mcp/local/pdg-impact.d.ts +384 -0
- package/dist/mcp/local/pdg-impact.js +1972 -0
- package/dist/mcp/resources.js +13 -1
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.js +214 -7
- package/dist/server/analyze-launch.d.ts +29 -0
- package/dist/server/analyze-launch.js +137 -0
- package/dist/server/analyze-upload.d.ts +33 -0
- package/dist/server/analyze-upload.js +123 -0
- package/dist/server/analyze-worker-ipc.d.ts +58 -0
- package/dist/server/analyze-worker-ipc.js +16 -0
- package/dist/server/analyze-worker.d.ts +17 -1
- package/dist/server/analyze-worker.js +7 -1
- package/dist/server/api.d.ts +17 -0
- package/dist/server/api.js +132 -168
- package/dist/server/git-clone.d.ts +43 -2
- package/dist/server/git-clone.js +211 -16
- package/dist/server/mcp-http.d.ts +5 -6
- package/dist/server/mcp-http.js +9 -82
- package/dist/server/middleware.d.ts +40 -0
- package/dist/server/middleware.js +92 -0
- package/dist/server/private-ip.d.ts +1 -0
- package/dist/server/private-ip.js +15 -0
- package/dist/server/upload-ingest.d.ts +56 -0
- package/dist/server/upload-ingest.js +276 -0
- package/dist/server/upload-paths.d.ts +37 -0
- package/dist/server/upload-paths.js +57 -0
- package/dist/server/upload-sweep.d.ts +20 -0
- package/dist/server/upload-sweep.js +57 -0
- package/dist/storage/git.js +5 -8
- package/dist/storage/parse-cache.d.ts +22 -1
- package/dist/storage/parse-cache.js +44 -10
- package/dist/storage/repo-manager.d.ts +121 -10
- package/dist/storage/repo-manager.js +43 -5
- package/dist/types/pipeline.d.ts +9 -0
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +110 -10
- package/hooks/claude/gitnexus-hook.cjs +110 -13
- package/hooks/claude/hook-db-lock-probe.cjs +513 -26
- package/package.json +8 -2
- package/scripts/assert-publish-grammar-coverage.cjs +31 -0
- package/scripts/build-tree-sitter-grammars.cjs +16 -10
- package/scripts/cross-platform-tests.ts +1 -0
- package/skills/gitnexus-debugging.md +16 -4
- package/skills/gitnexus-exploring.md +3 -3
- package/skills/gitnexus-guide.md +33 -0
- package/skills/gitnexus-pdg-query.md +89 -0
- package/skills/gitnexus-refactoring.md +1 -1
- package/skills/gitnexus-taint-analysis.md +178 -0
- package/vendor/tree-sitter-c/package.json +1 -1
- package/vendor/tree-sitter-dart/package.json +1 -1
- package/vendor/tree-sitter-kotlin/package.json +1 -1
- package/vendor/tree-sitter-proto/package.json +1 -1
- package/vendor/tree-sitter-swift/package.json +1 -1
- package/web/assets/{agent-CKPMqImC.js → agent-D3Xd7zZE.js} +123 -123
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-DxJw65fT.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-ChH9xW-N.js +36 -0
- package/web/assets/{blockDiagram-7IZFK4PR-B4niSLvR.js → blockDiagram-7IZFK4PR-BkWhpzWB.js} +1 -1
- package/web/assets/{c4Diagram-Y2BXMSZH-DIzEXalR.js → c4Diagram-Y2BXMSZH-DtBvpzWD.js} +1 -1
- package/web/assets/{chunk-3SSMPTDK-BzGeeheI.js → chunk-3SSMPTDK-B4_etUhr.js} +2 -2
- package/web/assets/{chunk-5IMINLNL-CnTLsXIV.js → chunk-5IMINLNL-DOdTeQri.js} +1 -1
- package/web/assets/{chunk-5VCL7Z4A-w1BCx98Z.js → chunk-5VCL7Z4A-CQ-2dYWj.js} +1 -1
- package/web/assets/chunk-6764PJDD-DpIS7hxD.js +1 -0
- package/web/assets/{chunk-67TQ5CYL-CChC2cAv.js → chunk-67TQ5CYL-4sNPJU1q.js} +3 -3
- package/web/assets/{chunk-7W6UQGC5-CgFyfZ6k.js → chunk-7W6UQGC5-KyEG0HQg.js} +1 -1
- package/web/assets/{chunk-AZZRMDJM-5E9ARdDQ.js → chunk-AZZRMDJM-y-xJBuMz.js} +1 -1
- package/web/assets/{chunk-INKRHTLW-ELpfuk9h.js → chunk-INKRHTLW-Nu4ri9P-.js} +1 -1
- package/web/assets/{chunk-JQRUD6KW-Dcq_Qnyy.js → chunk-JQRUD6KW-Dbva2Z17.js} +1 -1
- package/web/assets/{chunk-KGFNY3KK-W-VR57xb.js → chunk-KGFNY3KK-JGMJvKCK.js} +1 -1
- package/web/assets/chunk-KGYTTC2M-CWC_c3H9.js +161 -0
- package/web/assets/{chunk-KNLZD3CH-BuZBOcso.js → chunk-KNLZD3CH-BGlP6X9R.js} +1 -1
- package/web/assets/{chunk-KRXBNO2N-DH2NPM7I.js → chunk-KRXBNO2N-BW5o0KUN.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-Dfmux4m1.js → chunk-LCXTWHL2-zoomRtWX.js} +1 -1
- package/web/assets/{chunk-LII3EMHJ-3X33tCpU.js → chunk-LII3EMHJ-D-jm-dLa.js} +1 -1
- package/web/assets/{chunk-QA3QBVWF-D5Ha3GgB.js → chunk-QA3QBVWF-BgRW3SXd.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-CAkzcoRj.js → chunk-RG4AUYOV-DD0B2N2B.js} +1 -1
- package/web/assets/{chunk-T2UQINTJ-kGYG7ppP.js → chunk-T2UQINTJ-DSBqkzH7.js} +1 -1
- package/web/assets/chunk-T5OCTHI4-DdZvN-9i.js +1 -0
- package/web/assets/{chunk-UY5QBCOK-Du-c56gs.js → chunk-UY5QBCOK-DyF0vyGd.js} +1 -1
- package/web/assets/{chunk-W44A43WB-lrCpuupA.js → chunk-W44A43WB-JqMLIpR0.js} +1 -1
- package/web/assets/{chunk-ZXARS5L4-CSZRiyOf.js → chunk-ZXARS5L4-CxN8oiwI.js} +1 -1
- package/web/assets/classDiagram-KGZ6W3CR-DJm9BgF-.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-DJm9BgF-.js +1 -0
- package/web/assets/{context-builder-_HS0v2ma.js → context-builder-BHiFUA8O.js} +10 -2
- package/web/assets/{cose-bilkent-UX7MHV2Q-BHv2bbtl.js → cose-bilkent-UX7MHV2Q-D71wNYRJ.js} +1 -1
- package/web/assets/dagre-ND4H6XIP-BIkxmhcu.js +4 -0
- package/web/assets/diagram-3NCE3AQN-BTa6iH0T.js +43 -0
- package/web/assets/diagram-GF46GFSD-DZDV0vBj.js +24 -0
- package/web/assets/{diagram-HNR7UZ2L-fUWreZzx.js → diagram-HNR7UZ2L-DFCfd5LI.js} +2 -2
- package/web/assets/diagram-QXG6HAR7-BzM--Jj0.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-DFFwz0k4.js +10 -0
- package/web/assets/{erDiagram-L5TCEMPS-QN2eEP1e.js → erDiagram-L5TCEMPS-CfHMJJqo.js} +1 -1
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-BQm9QzEa.js +1 -0
- package/web/assets/{flowDiagram-H6V6AXG4-CXbXImlN.js → flowDiagram-H6V6AXG4-Be805QiJ.js} +3 -3
- package/web/assets/{ganttDiagram-JCBTUEKG-BHQssTz6.js → ganttDiagram-JCBTUEKG-D3iL2Aet.js} +1 -1
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-Cr_Bm2Nb.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CPIDgxGm.js +106 -0
- package/web/assets/index-BvYev1UJ.js +635 -0
- package/web/assets/index-_lgn7hs5.css +2 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-Cs4p2oyk.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-Y7BKSoke.js +2 -0
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-6LKOvBfp.js → ishikawaDiagram-BNXS4ZKH-CT4SHFuI.js} +1 -1
- package/web/assets/{journeyDiagram-M6C3CM3L-DNPYCpvq.js → journeyDiagram-M6C3CM3L-CvArszLo.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-DgDi9oJT.js → kanban-definition-75IXJCU3-C6yDxr7N.js} +3 -3
- package/web/assets/{katex-K3KEBU37-CrVLz8l7.js → katex-K3KEBU37-CTc5BslQ.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CwR5sBB-.js → mindmap-definition-2TDM6QVE-BOc2WEne.js} +1 -1
- package/web/assets/packet-YPE3B663-LP52Z2RK-CKCrztD2.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-BB7pHqoD.js +1 -0
- package/web/assets/{pieDiagram-CU6KROY3-By8g6f6B.js → pieDiagram-CU6KROY3-Cvc0f_Pd.js} +1 -1
- package/web/assets/{quadrantDiagram-VICAPDV7-bAm6Hi_5.js → quadrantDiagram-VICAPDV7-yXSZ2lLz.js} +1 -1
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-DhoTOcuK.js +1 -0
- package/web/assets/{requirementDiagram-JXO7QTGE-7oDcJ1_J.js → requirementDiagram-JXO7QTGE-BRcZvHs4.js} +1 -1
- package/web/assets/{sankeyDiagram-URQDO5SZ-LFJz53u5.js → sankeyDiagram-URQDO5SZ-1qEjlFIB.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-FySeKCUy.js → sequenceDiagram-VS2MUI6T-PcSCuvrB.js} +3 -3
- package/web/assets/stateDiagram-7D4R322I-D6qYSV1E.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-Bg-ImOSX.js +1 -0
- package/web/assets/{timeline-definition-O6YCAMPW-Ds2CnVZK.js → timeline-definition-O6YCAMPW-QWkh01xw.js} +1 -1
- package/web/assets/treeView-BLDUP644-QA4HXRO3-ODehyGKL.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-BfpgC-7o.js +1 -0
- package/web/assets/{vennDiagram-MWXL3ELB-DUIEwXWp.js → vennDiagram-MWXL3ELB-ak4DfwuM.js} +3 -3
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-CNeL6VHE.js +1 -0
- package/web/assets/{wardleyDiagram-CUQ6CDDI-DEiFPQih.js → wardleyDiagram-CUQ6CDDI-CTzR4Loq.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-BUbayhST.js → xychartDiagram-N2JHSOCM-DA1BEaQz.js} +1 -1
- package/web/index.html +13 -15
- package/scripts/materialize-vendor-grammars.cjs +0 -97
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-BETj2x4g.js +0 -1
- package/web/assets/architectureDiagram-UL44E2DR-D1EXI0zA.js +0 -36
- package/web/assets/chunk-2T2R6R2M-n6s9JZqv.js +0 -4
- package/web/assets/chunk-2UTLFMKG-CMBB1TMN.js +0 -1
- package/web/assets/chunk-4R4BOZG6-mKhL59ul.js +0 -159
- package/web/assets/chunk-6764PJDD-ChwMM2z4.js +0 -1
- package/web/assets/chunk-7J6CGLKN-DT-b53FT.js +0 -10
- package/web/assets/chunk-C62D2QBJ-CDAWj26E.js +0 -1
- package/web/assets/chunk-CEXFNPSA-D68Tk6ls.js +0 -1
- package/web/assets/chunk-CilyBKbf.js +0 -1
- package/web/assets/chunk-J5EP6P6S-DxWW0yvu.js +0 -1
- package/web/assets/chunk-KGYTTC2M-C6PHeuay.js +0 -1
- package/web/assets/chunk-RERM46MO-DQNbXtfw.js +0 -1
- package/web/assets/chunk-RKZBBQEN-BmTPLSyv.js +0 -1
- package/web/assets/chunk-RLI5ZMPA-DExu2DOK.js +0 -1
- package/web/assets/chunk-T5OCTHI4--9wWpVws.js +0 -1
- package/web/assets/chunk-UP6H54XL-DsKdC6jC.js +0 -1
- package/web/assets/chunk-UXSXWOXI-DR81EqLr.js +0 -1
- package/web/assets/classDiagram-KGZ6W3CR-Bv93af_b.js +0 -1
- package/web/assets/classDiagram-v2-72OJOZXJ-CLfEqHUa.js +0 -1
- package/web/assets/dagre-ND4H6XIP-DsIr9MOv.js +0 -4
- package/web/assets/diagram-3NCE3AQN-BqAtKUpW.js +0 -43
- package/web/assets/diagram-GF46GFSD-CaBG6n6o.js +0 -24
- package/web/assets/diagram-QXG6HAR7-CZ-O3rcV.js +0 -24
- package/web/assets/diagram-WEQXMOUZ-P4lSL4GH.js +0 -10
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-B3myHUst.js +0 -1
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-DF3rtf4A.js +0 -1
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CCwVLT__.js +0 -106
- package/web/assets/index-BKWA-m7o.css +0 -2
- package/web/assets/index-CG6q8eTs.js +0 -626
- package/web/assets/info-J43DQDTF-KCYPFFUO-R4XV_akJ.js +0 -1
- package/web/assets/infoDiagram-3YFTVSEB-DmLICZx1.js +0 -2
- package/web/assets/packet-YPE3B663-LP52Z2RK-CgQPdNZa.js +0 -1
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-BzWOwc_c.js +0 -1
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-B7KG0FN7.js +0 -1
- package/web/assets/stateDiagram-7D4R322I-CB2nABwH.js +0 -1
- package/web/assets/stateDiagram-v2-36443NZ5-COBGd2RL.js +0 -1
- package/web/assets/treeView-BLDUP644-QA4HXRO3-CRSxEwLO.js +0 -1
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-a0PfKoVn.js +0 -1
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-BKQ6e5mC.js +0 -1
- /package/web/assets/{chunk-AQ6EADP3-CCFje6lL.js → chunk-AQ6EADP3-CZhslHi-.js} +0 -0
|
@@ -19,6 +19,7 @@ import type { MethodExtractor } from './method-types.js';
|
|
|
19
19
|
import type { VariableExtractor } from './variable-types.js';
|
|
20
20
|
import type { ImportResolverFn } from './import-resolvers/types.js';
|
|
21
21
|
import type { SyntaxNode } from './utils/ast-helpers.js';
|
|
22
|
+
import type { CfgVisitor } from './cfg/types.js';
|
|
22
23
|
import type { NodeLabel } from '../../_shared/index.js';
|
|
23
24
|
import type Parser from 'tree-sitter';
|
|
24
25
|
import type { ExtractedDecoratorRoute } from './workers/parse-worker.js';
|
|
@@ -147,6 +148,12 @@ interface LanguageProviderConfig {
|
|
|
147
148
|
* `undefined` when no constraints exist / the node isn't a templated
|
|
148
149
|
* function. Languages without SFINAE / concept semantics leave this
|
|
149
150
|
* undefined and the disambiguation is a pass-through.
|
|
151
|
+
*
|
|
152
|
+
* Cloneability contract: the returned payload crosses the worker boundary
|
|
153
|
+
* via structured clone, so it MUST be structured-clone-safe (no functions,
|
|
154
|
+
* symbols, or tree-sitter `SyntaxNode`s — only plain data). Wrap the return
|
|
155
|
+
* with `assertCloneable` from `workers/clone-safety.ts` so a future leak is a
|
|
156
|
+
* compile error at the source instead of a runtime DataCloneError (#2143).
|
|
150
157
|
*/
|
|
151
158
|
readonly extractTemplateConstraints?: (definitionNode: SyntaxNode) => unknown;
|
|
152
159
|
/** Override the default node label for definition.function captures.
|
|
@@ -268,12 +275,26 @@ interface LanguageProviderConfig {
|
|
|
268
275
|
* disk store WITHOUT a main-thread re-parse. The main thread restores them
|
|
269
276
|
* via the matching `ScopeResolver.applyCaptureSideChannel` hook.
|
|
270
277
|
*
|
|
271
|
-
* MUST return plain data (objects / arrays /
|
|
272
|
-
*
|
|
278
|
+
* Cloneability contract: MUST return plain data (objects / arrays /
|
|
279
|
+
* primitives — no functions, symbols, or tree-sitter `SyntaxNode`s) so it
|
|
280
|
+
* survives BOTH the worker→main structured clone AND `JSON.stringify` + the
|
|
281
|
+
* parsedfile-store interning reviver. Wrap the return with `assertCloneable`
|
|
282
|
+
* from `workers/clone-safety.ts` so a future non-serializable leak is a
|
|
283
|
+
* compile error at the source instead of a runtime DataCloneError (#2143).
|
|
273
284
|
*
|
|
274
285
|
* Default: undefined (provider has no capture-time module-level side effects).
|
|
275
286
|
*/
|
|
276
287
|
readonly collectCaptureSideChannel?: (filePath: string) => unknown;
|
|
288
|
+
/**
|
|
289
|
+
* Per-language control-flow-graph builder (#2081 M1, PDG/taint substrate).
|
|
290
|
+
* Invoked IN THE PARSE WORKER (where the AST lives) for each function node,
|
|
291
|
+
* gated on the `--pdg` opt-in; the resulting per-function CFGs are serialized
|
|
292
|
+
* onto `ParsedFile.cfgSideChannel` and emitted as BasicBlock nodes + CFG
|
|
293
|
+
* edges during scope-resolution. `TNode` is `SyntaxNode` for the tree-sitter
|
|
294
|
+
* languages. Default: undefined (language has no CFG support yet — TS/JS are
|
|
295
|
+
* the M1 set).
|
|
296
|
+
*/
|
|
297
|
+
readonly cfgVisitor?: CfgVisitor<SyntaxNode>;
|
|
277
298
|
/**
|
|
278
299
|
* Interpret a raw `@import.statement` capture group into a `ParsedImport`.
|
|
279
300
|
* The central finalize algorithm resolves `ParsedImport.targetRaw` to a
|
|
@@ -38,7 +38,9 @@ import { cCallConfig, cppCallConfig } from '../call-extractors/configs/c-cpp.js'
|
|
|
38
38
|
import { stripUeMacros } from '../cpp-ue-preprocessor.js';
|
|
39
39
|
import { emitCScopeCaptures, interpretCImport, interpretCTypeBinding, cArityCompatibility, cBindingScopeFor, cImportOwningScope, cReceiverBinding, collectCStaticLinkageSideChannel, } from './c/index.js';
|
|
40
40
|
import { emitCppScopeCaptures, interpretCppImport, interpretCppTypeBinding, cppArityCompatibility, cppBindingScopeFor, cppImportOwningScope, cppReceiverBinding, collectCppCaptureSideChannel, } from './cpp/index.js';
|
|
41
|
-
import { extractCppTemplateConstraints } from './cpp/constraint-extractor.js';
|
|
41
|
+
import { extractCppTemplateConstraints, } from './cpp/constraint-extractor.js';
|
|
42
|
+
import { assertCloneable } from '../workers/clone-safety.js';
|
|
43
|
+
import { createCCfgVisitor, createCppCfgVisitor } from '../cfg/visitors/c-cpp.js';
|
|
42
44
|
const C_BUILT_INS = new Set([
|
|
43
45
|
'printf',
|
|
44
46
|
'fprintf',
|
|
@@ -350,6 +352,7 @@ export const cProvider = defineLanguage({
|
|
|
350
352
|
builtInNames: C_BUILT_INS,
|
|
351
353
|
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
352
354
|
emitScopeCaptures: emitCScopeCaptures,
|
|
355
|
+
cfgVisitor: createCCfgVisitor(),
|
|
353
356
|
// Worker-side: snapshot the module-level `static`-linkage marks
|
|
354
357
|
// `emitCScopeCaptures` just populated for this file (`markStaticName` →
|
|
355
358
|
// `staticNames`) into plain data on `ParsedFile.captureSideChannel`, so the
|
|
@@ -358,7 +361,10 @@ export const cProvider = defineLanguage({
|
|
|
358
361
|
// `static` functions look non-file-local on the main thread and leak into
|
|
359
362
|
// cross-file global free-call resolution / wildcard imports. See
|
|
360
363
|
// `c/capture-side-channel.ts`.
|
|
361
|
-
|
|
364
|
+
// `assertCloneable` is a runtime identity; it makes a future non-serializable
|
|
365
|
+
// value in the side-channel payload a compile error here, at the source, rather
|
|
366
|
+
// than a DataCloneError at the worker boundary (#2143).
|
|
367
|
+
collectCaptureSideChannel: (filePath) => assertCloneable(collectCStaticLinkageSideChannel(filePath)),
|
|
362
368
|
interpretImport: interpretCImport,
|
|
363
369
|
interpretTypeBinding: interpretCTypeBinding,
|
|
364
370
|
bindingScopeFor: cBindingScopeFor,
|
|
@@ -369,7 +375,9 @@ export const cProvider = defineLanguage({
|
|
|
369
375
|
});
|
|
370
376
|
export const cppProvider = defineLanguage({
|
|
371
377
|
id: SupportedLanguages.CPlusPlus,
|
|
372
|
-
|
|
378
|
+
// CUDA files route through tree-sitter-cpp as a conservative C++-subset parser:
|
|
379
|
+
// definitions still extract, but CUDA launch syntax (`<<< >>>`) is not modeled as calls.
|
|
380
|
+
extensions: ['.cpp', '.cc', '.cxx', '.h', '.hpp', '.hxx', '.hh', '.cu', '.cuh'],
|
|
373
381
|
entryPointPatterns: [
|
|
374
382
|
/^main$/,
|
|
375
383
|
/^init_/,
|
|
@@ -427,11 +435,12 @@ export const cppProvider = defineLanguage({
|
|
|
427
435
|
extractTemplateConstraints: extractCppTemplateConstraintsForProvider,
|
|
428
436
|
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
429
437
|
emitScopeCaptures: emitCppScopeCaptures,
|
|
438
|
+
cfgVisitor: createCppCfgVisitor(),
|
|
430
439
|
// Worker-side: snapshot the module-level capture marks `emitCppScopeCaptures`
|
|
431
440
|
// just populated for this file into plain data on `ParsedFile.captureSideChannel`,
|
|
432
441
|
// so the main thread can restore them via `applyCaptureSideChannel` WITHOUT a
|
|
433
442
|
// re-parse (#1983). See `cpp/capture-side-channel.ts`.
|
|
434
|
-
collectCaptureSideChannel: collectCppCaptureSideChannel,
|
|
443
|
+
collectCaptureSideChannel: (filePath) => assertCloneable(collectCppCaptureSideChannel(filePath)),
|
|
435
444
|
interpretImport: interpretCppImport,
|
|
436
445
|
interpretTypeBinding: interpretCppTypeBinding,
|
|
437
446
|
bindingScopeFor: cppBindingScopeFor,
|
|
@@ -482,5 +491,8 @@ function extractCppTemplateConstraintsForProvider(definitionNode) {
|
|
|
482
491
|
}
|
|
483
492
|
break;
|
|
484
493
|
}
|
|
485
|
-
|
|
494
|
+
// Guard the boundary at the source: a future non-cloneable member of the
|
|
495
|
+
// constraint payload becomes a compile error here, not a runtime
|
|
496
|
+
// DataCloneError at the worker post (#2143).
|
|
497
|
+
return assertCloneable(extractCppTemplateConstraints(templateDecl, declarator));
|
|
486
498
|
}
|
|
@@ -27,6 +27,10 @@ export const cobolProvider = defineLanguage({
|
|
|
27
27
|
},
|
|
28
28
|
exportChecker: () => false,
|
|
29
29
|
importResolver: () => null,
|
|
30
|
+
// No `cfgVisitor`: COBOL is the deliberate non-goal of the PDG-language
|
|
31
|
+
// rollout (#2195). There is no installed tree-sitter grammar and COBOL's
|
|
32
|
+
// PERFORM / GO-TO control flow is exotic; the worker's `provider.cfgVisitor &&`
|
|
33
|
+
// gate therefore emits no CFG/PDG layer for COBOL (see worker-roundtrip.test.ts).
|
|
30
34
|
// ── Scope-resolution hooks ───────────────────────────────────────
|
|
31
35
|
emitScopeCaptures: emitCobolScopeCaptures,
|
|
32
36
|
interpretImport: interpretCobolImport,
|
|
@@ -173,6 +173,7 @@ export function classifyCppParameterType(rawType, declaratorText, fullParameterT
|
|
|
173
173
|
cv,
|
|
174
174
|
indirection,
|
|
175
175
|
pointerDepth,
|
|
176
|
+
...templateArgumentsFor(`${source} ${rawType} ${declaratorText ?? ''}`),
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
function unknownTypeClass(base) {
|
|
@@ -183,6 +184,40 @@ function unknownTypeClass(base) {
|
|
|
183
184
|
pointerDepth: 0,
|
|
184
185
|
};
|
|
185
186
|
}
|
|
187
|
+
function templateArgumentsFor(rawType) {
|
|
188
|
+
const args = parseTopLevelTemplateArguments(rawType);
|
|
189
|
+
return args === undefined ? {} : { templateArguments: args };
|
|
190
|
+
}
|
|
191
|
+
function parseTopLevelTemplateArguments(rawType) {
|
|
192
|
+
const start = rawType.indexOf('<');
|
|
193
|
+
if (start < 0)
|
|
194
|
+
return undefined;
|
|
195
|
+
const args = [];
|
|
196
|
+
let depth = 0;
|
|
197
|
+
let argStart = start + 1;
|
|
198
|
+
for (let i = start + 1; i < rawType.length; i++) {
|
|
199
|
+
const ch = rawType[i];
|
|
200
|
+
if (ch === '<') {
|
|
201
|
+
depth++;
|
|
202
|
+
}
|
|
203
|
+
else if (ch === '>') {
|
|
204
|
+
if (depth === 0) {
|
|
205
|
+
const finalArg = rawType.slice(argStart, i).trim();
|
|
206
|
+
if (finalArg.length > 0)
|
|
207
|
+
args.push(normalizeCppParamType(finalArg));
|
|
208
|
+
return args.length > 0 ? args : undefined;
|
|
209
|
+
}
|
|
210
|
+
depth--;
|
|
211
|
+
}
|
|
212
|
+
else if (ch === ',' && depth === 0) {
|
|
213
|
+
const arg = rawType.slice(argStart, i).trim();
|
|
214
|
+
if (arg.length > 0)
|
|
215
|
+
args.push(normalizeCppParamType(arg));
|
|
216
|
+
argStart = i + 1;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return undefined;
|
|
220
|
+
}
|
|
186
221
|
function findFuncDeclarator(node) {
|
|
187
222
|
let decl = node.childForFieldName('declarator');
|
|
188
223
|
if (decl === null) {
|
|
@@ -193,8 +228,12 @@ function findFuncDeclarator(node) {
|
|
|
193
228
|
}
|
|
194
229
|
return null;
|
|
195
230
|
}
|
|
196
|
-
// Unwrap
|
|
197
|
-
|
|
231
|
+
// Unwrap declarator wrappers. Deleted free functions are represented as
|
|
232
|
+
// `init_declarator(function_declarator, delete_expression)` by
|
|
233
|
+
// tree-sitter-cpp 0.23.
|
|
234
|
+
while (decl.type === 'pointer_declarator' ||
|
|
235
|
+
decl.type === 'reference_declarator' ||
|
|
236
|
+
decl.type === 'init_declarator') {
|
|
198
237
|
const next = decl.childForFieldName('declarator');
|
|
199
238
|
if (next === null) {
|
|
200
239
|
// reference_declarator may not use field name
|
|
@@ -11,6 +11,7 @@ import { markCppAdlSiteArgs, markCppAdlSiteNoAdl } from './adl.js';
|
|
|
11
11
|
import { markCppInlineNamespaceRange } from './inline-namespaces.js';
|
|
12
12
|
import { extractCppTemplateConstraints } from './constraint-extractor.js';
|
|
13
13
|
import { captureCppMemberLookupFacts } from './member-lookup.js';
|
|
14
|
+
import { CPP_BRACED_INIT_TYPE_PREFIX } from './conversion-rank.js';
|
|
14
15
|
export function emitCppScopeCaptures(sourceText, filePath, cachedTree) {
|
|
15
16
|
let tree = cachedTree;
|
|
16
17
|
if (tree === undefined) {
|
|
@@ -113,6 +114,9 @@ export function emitCppScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
113
114
|
if (hasExplicitSpecifier(fnNode)) {
|
|
114
115
|
grouped['@declaration.is-explicit'] = syntheticCapture('@declaration.is-explicit', fnNode, 'true');
|
|
115
116
|
}
|
|
117
|
+
if (hasDeletedMethodClause(fnNode, grouped['@declaration.name']?.text)) {
|
|
118
|
+
grouped['@declaration.is-deleted'] = syntheticCapture('@declaration.is-deleted', fnNode, 'true');
|
|
119
|
+
}
|
|
116
120
|
// Detect static storage class (file-local linkage)
|
|
117
121
|
if (hasStaticStorageClass(fnNode)) {
|
|
118
122
|
const nameText = grouped['@declaration.name']?.text;
|
|
@@ -547,6 +551,8 @@ function isFollowedByPackExpansion(baseClause, childIndex) {
|
|
|
547
551
|
return true;
|
|
548
552
|
if (sibling.type === ',' || sibling.type === 'access_specifier')
|
|
549
553
|
return false;
|
|
554
|
+
if (sibling.type === 'comment')
|
|
555
|
+
continue;
|
|
550
556
|
if (sibling.isNamed)
|
|
551
557
|
return false;
|
|
552
558
|
}
|
|
@@ -903,6 +909,8 @@ function unknownTypeClass(base) {
|
|
|
903
909
|
*/
|
|
904
910
|
function inferCppLiteralType(node) {
|
|
905
911
|
switch (node.type) {
|
|
912
|
+
case 'initializer_list':
|
|
913
|
+
return inferCppBracedInitType(node);
|
|
906
914
|
case 'number_literal': {
|
|
907
915
|
const text = node.text;
|
|
908
916
|
// Floating-point literals contain '.', 'e', 'E', or end with 'f'/'F'
|
|
@@ -931,6 +939,27 @@ function inferCppLiteralType(node) {
|
|
|
931
939
|
return '';
|
|
932
940
|
}
|
|
933
941
|
}
|
|
942
|
+
function inferCppBracedInitType(node) {
|
|
943
|
+
const elementTypes = [];
|
|
944
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
945
|
+
const child = node.child(i);
|
|
946
|
+
if (child === null)
|
|
947
|
+
continue;
|
|
948
|
+
if (child.type === ',' || child.type === '{' || child.type === '}')
|
|
949
|
+
continue;
|
|
950
|
+
const elementType = inferCppLiteralType(child);
|
|
951
|
+
if (elementType === '' || elementType.startsWith(CPP_BRACED_INIT_TYPE_PREFIX)) {
|
|
952
|
+
return `${CPP_BRACED_INIT_TYPE_PREFIX}unknown:${elementTypes.length + 1}`;
|
|
953
|
+
}
|
|
954
|
+
elementTypes.push(elementType);
|
|
955
|
+
}
|
|
956
|
+
if (elementTypes.length === 0)
|
|
957
|
+
return `${CPP_BRACED_INIT_TYPE_PREFIX}unknown:0`;
|
|
958
|
+
const first = elementTypes[0];
|
|
959
|
+
return elementTypes.every((type) => type === first)
|
|
960
|
+
? `${CPP_BRACED_INIT_TYPE_PREFIX}${first}:${elementTypes.length}`
|
|
961
|
+
: `${CPP_BRACED_INIT_TYPE_PREFIX}unknown:${elementTypes.length}`;
|
|
962
|
+
}
|
|
934
963
|
/**
|
|
935
964
|
* Look up the declared type of a variable by scanning sibling declarations
|
|
936
965
|
* in the enclosing compound_statement (function body). Handles:
|
|
@@ -1562,8 +1591,11 @@ function extractDeclaratorLeafName(node) {
|
|
|
1562
1591
|
let cur = node;
|
|
1563
1592
|
let safety = 16;
|
|
1564
1593
|
while (safety-- > 0) {
|
|
1565
|
-
if (cur.type === 'identifier' ||
|
|
1594
|
+
if (cur.type === 'identifier' ||
|
|
1595
|
+
cur.type === 'type_identifier' ||
|
|
1596
|
+
cur.type === 'operator_name') {
|
|
1566
1597
|
return cur.text;
|
|
1598
|
+
}
|
|
1567
1599
|
// Common wrapper nodes — follow the 'declarator' field when present.
|
|
1568
1600
|
const next = cur.childForFieldName('declarator') ??
|
|
1569
1601
|
// parenthesized_declarator: single named child
|
|
@@ -1590,6 +1622,23 @@ function hasExplicitSpecifier(node) {
|
|
|
1590
1622
|
}
|
|
1591
1623
|
return /\bexplicit\b/.test(node.text.slice(0, 128));
|
|
1592
1624
|
}
|
|
1625
|
+
function hasDeletedMethodClause(node, callableName) {
|
|
1626
|
+
for (let i = 0; i < node.namedChildCount; i++) {
|
|
1627
|
+
const child = node.namedChild(i);
|
|
1628
|
+
if (child?.type === 'delete_method_clause')
|
|
1629
|
+
return true;
|
|
1630
|
+
// tree-sitter-cpp 0.23 parses a deleted free-function declaration as
|
|
1631
|
+
// `declaration > init_declarator > delete_expression`, while class
|
|
1632
|
+
// members use the dedicated `delete_method_clause`.
|
|
1633
|
+
if (child?.type === 'init_declarator' &&
|
|
1634
|
+
child.childForFieldName('value')?.type === 'delete_expression' &&
|
|
1635
|
+
callableName !== undefined &&
|
|
1636
|
+
extractDeclaratorLeafName(child.childForFieldName('declarator') ?? child) === callableName) {
|
|
1637
|
+
return true;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
return false;
|
|
1641
|
+
}
|
|
1593
1642
|
/**
|
|
1594
1643
|
* Check if a C++ function_definition or declaration has `static` storage class.
|
|
1595
1644
|
*/
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
* their own `ConversionRankFn` in the future.
|
|
21
21
|
*/
|
|
22
22
|
import type { ParameterTypeClass } from '../../../../_shared/index.js';
|
|
23
|
+
export declare const CPP_BRACED_INIT_TYPE_PREFIX = "braced-init:";
|
|
24
|
+
export declare const CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES: readonly ["braced-init:"];
|
|
23
25
|
/**
|
|
24
26
|
* Return the conversion rank from `argType` to `paramType`.
|
|
25
27
|
*
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* This function is intentionally C++-specific. Other languages may define
|
|
20
20
|
* their own `ConversionRankFn` in the future.
|
|
21
21
|
*/
|
|
22
|
+
import { normalizeCppParamType } from './arity-metadata.js';
|
|
22
23
|
import { hasCppUserDefinedConversion } from './user-defined-conversions.js';
|
|
23
24
|
/** Set of normalized arithmetic types that support implicit conversion. */
|
|
24
25
|
const ARITHMETIC = new Set(['int', 'double', 'char', 'bool']);
|
|
@@ -27,6 +28,22 @@ const INTEGRAL_PROMOTION = new Map([
|
|
|
27
28
|
['char', 'int'],
|
|
28
29
|
['bool', 'int'],
|
|
29
30
|
]);
|
|
31
|
+
export const CPP_BRACED_INIT_TYPE_PREFIX = 'braced-init:';
|
|
32
|
+
export const CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES = [CPP_BRACED_INIT_TYPE_PREFIX];
|
|
33
|
+
const BRACED_INIT_CONTAINER_TYPES = new Set([
|
|
34
|
+
'array',
|
|
35
|
+
'deque',
|
|
36
|
+
'list',
|
|
37
|
+
'set',
|
|
38
|
+
'std::array',
|
|
39
|
+
'std::deque',
|
|
40
|
+
'std::list',
|
|
41
|
+
'std::set',
|
|
42
|
+
'std::unordered_set',
|
|
43
|
+
'std::vector',
|
|
44
|
+
'unordered_set',
|
|
45
|
+
'vector',
|
|
46
|
+
]);
|
|
30
47
|
/**
|
|
31
48
|
* Return the conversion rank from `argType` to `paramType`.
|
|
32
49
|
*
|
|
@@ -36,6 +53,17 @@ const INTEGRAL_PROMOTION = new Map([
|
|
|
36
53
|
* for mismatch.
|
|
37
54
|
*/
|
|
38
55
|
export function cppConversionRank(argType, paramType, argTypeClass, paramTypeClass) {
|
|
56
|
+
const bracedInitType = parseBracedInitArgType(argType);
|
|
57
|
+
if (bracedInitType !== undefined) {
|
|
58
|
+
if (bracedInitType.elementType === 'unknown')
|
|
59
|
+
return Infinity;
|
|
60
|
+
if (bracedInitType.elementCount === 1) {
|
|
61
|
+
const scalarRank = cppConversionRank(bracedInitType.elementType, paramType, undefined, paramTypeClass);
|
|
62
|
+
if (isFinite(scalarRank))
|
|
63
|
+
return scalarRank;
|
|
64
|
+
}
|
|
65
|
+
return bracedInitConversionRank(paramType, bracedInitType, paramTypeClass);
|
|
66
|
+
}
|
|
39
67
|
if (argType === paramType) {
|
|
40
68
|
return exactShapeCompatible(argTypeClass, paramTypeClass) ? 0 : Infinity;
|
|
41
69
|
}
|
|
@@ -57,6 +85,67 @@ export function cppConversionRank(argType, paramType, argTypeClass, paramTypeCla
|
|
|
57
85
|
return 4;
|
|
58
86
|
return Infinity;
|
|
59
87
|
}
|
|
88
|
+
function parseBracedInitArgType(argType) {
|
|
89
|
+
if (!argType.startsWith(CPP_BRACED_INIT_TYPE_PREFIX))
|
|
90
|
+
return undefined;
|
|
91
|
+
const payload = argType.slice(CPP_BRACED_INIT_TYPE_PREFIX.length);
|
|
92
|
+
if (payload === '')
|
|
93
|
+
return undefined;
|
|
94
|
+
const separator = payload.lastIndexOf(':');
|
|
95
|
+
if (separator > 0) {
|
|
96
|
+
const countText = payload.slice(separator + 1);
|
|
97
|
+
if (/^\d+$/.test(countText)) {
|
|
98
|
+
return {
|
|
99
|
+
elementType: payload.slice(0, separator),
|
|
100
|
+
elementCount: Number(countText),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { elementType: payload };
|
|
105
|
+
}
|
|
106
|
+
function bracedInitConversionRank(paramType, argType, paramTypeClass) {
|
|
107
|
+
const targetBase = bracedInitTargetBase(paramType);
|
|
108
|
+
if (targetBase === 'initializer_list' || targetBase === 'std::initializer_list') {
|
|
109
|
+
return bracedInitValueTypeMatches(paramType, argType, paramTypeClass) ? 0 : Infinity;
|
|
110
|
+
}
|
|
111
|
+
if (BRACED_INIT_CONTAINER_TYPES.has(targetBase)) {
|
|
112
|
+
return bracedInitValueTypeMatches(paramType, argType, paramTypeClass) ? 4 : Infinity;
|
|
113
|
+
}
|
|
114
|
+
return Infinity;
|
|
115
|
+
}
|
|
116
|
+
function bracedInitValueTypeMatches(paramType, argType, paramTypeClass) {
|
|
117
|
+
const valueType = bracedInitTargetValueType(paramType, paramTypeClass);
|
|
118
|
+
if (valueType === undefined)
|
|
119
|
+
return false;
|
|
120
|
+
return isFinite(cppConversionRank(argType.elementType, valueType));
|
|
121
|
+
}
|
|
122
|
+
function bracedInitTargetValueType(paramType, paramTypeClass) {
|
|
123
|
+
return firstTemplateArgument(paramType) ?? paramTypeClass?.templateArguments?.[0];
|
|
124
|
+
}
|
|
125
|
+
function firstTemplateArgument(rawType) {
|
|
126
|
+
const start = rawType.indexOf('<');
|
|
127
|
+
if (start < 0)
|
|
128
|
+
return undefined;
|
|
129
|
+
let depth = 0;
|
|
130
|
+
for (let i = start + 1; i < rawType.length; i++) {
|
|
131
|
+
const ch = rawType[i];
|
|
132
|
+
if (ch === '<') {
|
|
133
|
+
depth++;
|
|
134
|
+
}
|
|
135
|
+
else if (ch === '>') {
|
|
136
|
+
if (depth === 0)
|
|
137
|
+
return bracedInitTargetBase(rawType.slice(start + 1, i));
|
|
138
|
+
depth--;
|
|
139
|
+
}
|
|
140
|
+
else if (ch === ',' && depth === 0) {
|
|
141
|
+
return bracedInitTargetBase(rawType.slice(start + 1, i));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
function bracedInitTargetBase(paramType) {
|
|
147
|
+
return normalizeCppParamType(paramType);
|
|
148
|
+
}
|
|
60
149
|
function isPointer(typeClass) {
|
|
61
150
|
return typeClass?.indirection === 'pointer' && typeClass.pointerDepth > 0;
|
|
62
151
|
}
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Used by `loadResolutionConfig` so the C++ resolver can resolve `#include`
|
|
4
4
|
* targets that live in header files.
|
|
5
5
|
*
|
|
6
|
-
* Scans for: .h, .hpp, .hxx, .hh
|
|
6
|
+
* Scans for: .h, .hpp, .hxx, .hh, .cuh
|
|
7
7
|
*/
|
|
8
8
|
export declare function scanCppHeaderFiles(repoPath: string): ReadonlySet<string>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { readdirSync } from 'fs';
|
|
2
2
|
import { join, relative } from 'path';
|
|
3
3
|
/** C++ header extensions to scan for in the workspace. */
|
|
4
|
-
const HEADER_EXTENSIONS = new Set(['.h', '.hpp', '.hxx', '.hh']);
|
|
4
|
+
const HEADER_EXTENSIONS = new Set(['.h', '.hpp', '.hxx', '.hh', '.cuh']);
|
|
5
5
|
/**
|
|
6
6
|
* Walk `repoPath` recursively and return relative paths of all C++ header files.
|
|
7
7
|
* Used by `loadResolutionConfig` so the C++ resolver can resolve `#include`
|
|
8
8
|
* targets that live in header files.
|
|
9
9
|
*
|
|
10
|
-
* Scans for: .h, .hpp, .hxx, .hh
|
|
10
|
+
* Scans for: .h, .hpp, .hxx, .hh, .cuh
|
|
11
11
|
*/
|
|
12
12
|
export function scanCppHeaderFiles(repoPath) {
|
|
13
13
|
const headers = new Set();
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* declaration transparently.
|
|
28
28
|
*/
|
|
29
29
|
import { isOverloadAmbiguousAfterNormalization, narrowOverloadCandidates, } from '../../scope-resolution/passes/overload-narrowing.js';
|
|
30
|
-
import { cppConversionRank } from './conversion-rank.js';
|
|
30
|
+
import { CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES, cppConversionRank } from './conversion-rank.js';
|
|
31
31
|
const inlineNamespaceRangesByFile = new Map();
|
|
32
32
|
const inlineNamespaceScopeIds = new Set();
|
|
33
33
|
function rangeKey(r) {
|
|
@@ -142,7 +142,12 @@ export function resolveCppQualifiedNamespaceMember(receiverName, memberName, par
|
|
|
142
142
|
// can disambiguate via exact-type match and, when available, conversion-rank
|
|
143
143
|
// scoring (`cppConversionRank`). Same-signature ambiguity is still detected
|
|
144
144
|
// by `isOverloadAmbiguousAfterNormalization` below.
|
|
145
|
-
const narrowed = narrowOverloadCandidates(allHits, callsite?.arity, callsite?.argumentTypes, callsite !== undefined
|
|
145
|
+
const narrowed = narrowOverloadCandidates(allHits, callsite?.arity, callsite?.argumentTypes, callsite !== undefined
|
|
146
|
+
? {
|
|
147
|
+
conversionRankFn: cppConversionRank,
|
|
148
|
+
conversionOnlyArgTypePrefixes: CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES,
|
|
149
|
+
}
|
|
150
|
+
: undefined);
|
|
146
151
|
if (narrowed.length === 1)
|
|
147
152
|
return narrowed[0];
|
|
148
153
|
if (narrowed.length === 0)
|
|
@@ -3,7 +3,7 @@ import { buildMro, defaultLinearize } from '../../scope-resolution/passes/mro.js
|
|
|
3
3
|
import { isOverloadAmbiguousAfterNormalization, narrowOverloadCandidates, } from '../../scope-resolution/passes/overload-narrowing.js';
|
|
4
4
|
import { isClassLike } from '../../scope-resolution/scope/walkers.js';
|
|
5
5
|
import { cppConstraintCompatibility } from './constraint-filter.js';
|
|
6
|
-
import { cppConversionRank } from './conversion-rank.js';
|
|
6
|
+
import { CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES, cppConversionRank } from './conversion-rank.js';
|
|
7
7
|
const capturedByFile = new Map();
|
|
8
8
|
let directParentsByDefId = new Map();
|
|
9
9
|
let virtualEdges = new Set();
|
|
@@ -193,6 +193,7 @@ function chooseOverload(candidates, callsite) {
|
|
|
193
193
|
const narrowed = narrowOverloadCandidates(candidates, callsite.arity, callsite.argumentTypes, {
|
|
194
194
|
argumentTypeClasses: callsite.argumentTypeClasses,
|
|
195
195
|
conversionRankFn: cppConversionRank,
|
|
196
|
+
conversionOnlyArgTypePrefixes: CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES,
|
|
196
197
|
constraintCompatibility: cppConstraintCompatibility,
|
|
197
198
|
});
|
|
198
199
|
if (narrowed.length === 1)
|
|
@@ -193,6 +193,29 @@ const CPP_SCOPE_QUERY = `
|
|
|
193
193
|
declarator: (function_declarator
|
|
194
194
|
declarator: (identifier) @declaration.name)) @declaration.function
|
|
195
195
|
|
|
196
|
+
;; tree-sitter-cpp 0.23 represents a deleted free function as an
|
|
197
|
+
;; init_declarator whose value is a delete_expression.
|
|
198
|
+
(declaration
|
|
199
|
+
declarator: (init_declarator
|
|
200
|
+
declarator: (function_declarator
|
|
201
|
+
declarator: (identifier) @declaration.name)
|
|
202
|
+
value: (delete_expression))) @declaration.function
|
|
203
|
+
|
|
204
|
+
;; Deleted free operator declaration.
|
|
205
|
+
(declaration
|
|
206
|
+
declarator: (init_declarator
|
|
207
|
+
declarator: (function_declarator
|
|
208
|
+
declarator: (operator_name) @declaration.name)
|
|
209
|
+
value: (delete_expression))) @declaration.function
|
|
210
|
+
|
|
211
|
+
;; Deleted free function with a pointer return type.
|
|
212
|
+
(declaration
|
|
213
|
+
declarator: (init_declarator
|
|
214
|
+
declarator: (pointer_declarator
|
|
215
|
+
declarator: (function_declarator
|
|
216
|
+
declarator: (identifier) @declaration.name))
|
|
217
|
+
value: (delete_expression))) @declaration.function
|
|
218
|
+
|
|
196
219
|
;; Free operator prototype: std::ostream& operator<<(std::ostream&, T)
|
|
197
220
|
(declaration
|
|
198
221
|
declarator: (function_declarator
|
|
@@ -3,7 +3,7 @@ import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
|
3
3
|
import { populateClassOwnedMembers, tagNamespacePrefixes, } from '../../scope-resolution/scope/walkers.js';
|
|
4
4
|
import { cppProvider } from '../c-cpp.js';
|
|
5
5
|
import { cppArityCompatibility } from './arity.js';
|
|
6
|
-
import { cppConversionRank } from './conversion-rank.js';
|
|
6
|
+
import { CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES, cppConversionRank } from './conversion-rank.js';
|
|
7
7
|
import { cppMergeBindings } from './merge-bindings.js';
|
|
8
8
|
import { resolveCppImportTarget } from './import-target.js';
|
|
9
9
|
import { scanCppHeaderFiles } from './header-scan.js';
|
|
@@ -205,6 +205,7 @@ export const cppScopeResolver = {
|
|
|
205
205
|
// Disambiguates `f(int)` vs `f(double)` called with `f(2.5)` by scoring
|
|
206
206
|
// each candidate's conversion cost; exact match wins over standard conversion.
|
|
207
207
|
conversionRankFn: cppConversionRank,
|
|
208
|
+
conversionOnlyArgTypePrefixes: CPP_CONVERSION_ONLY_ARG_TYPE_PREFIXES,
|
|
208
209
|
// Range-for element type inference: for (auto& user : users) → bind user to User
|
|
209
210
|
populateRangeBindings: populateCppRangeBindings,
|
|
210
211
|
// C++ method return-type bindings need to be visible from module scope
|
|
@@ -22,6 +22,7 @@ import { createMethodExtractor } from '../method-extractors/generic.js';
|
|
|
22
22
|
import { csharpMethodConfig } from '../method-extractors/configs/csharp.js';
|
|
23
23
|
import { createVariableExtractor } from '../variable-extractors/generic.js';
|
|
24
24
|
import { csharpVariableConfig } from '../variable-extractors/configs/csharp.js';
|
|
25
|
+
import { createCsharpCfgVisitor } from '../cfg/visitors/csharp.js';
|
|
25
26
|
import { emitCsharpScopeCaptures, interpretCsharpImport, interpretCsharpTypeBinding, csharpBindingScopeFor, csharpImportOwningScope, csharpMergeBindings, csharpReceiverBinding, csharpArityCompatibility, resolveCsharpImportTarget, } from './csharp/index.js';
|
|
26
27
|
const BUILT_INS = new Set([
|
|
27
28
|
'Console',
|
|
@@ -185,6 +186,7 @@ export const csharpProvider = defineLanguage({
|
|
|
185
186
|
// the full per-hook rationale and the canonical capture vocabulary
|
|
186
187
|
// in ./csharp/query.ts (CSHARP_SCOPE_QUERY constant).
|
|
187
188
|
emitScopeCaptures: emitCsharpScopeCaptures,
|
|
189
|
+
cfgVisitor: createCsharpCfgVisitor(),
|
|
188
190
|
interpretImport: interpretCsharpImport,
|
|
189
191
|
interpretTypeBinding: interpretCsharpTypeBinding,
|
|
190
192
|
bindingScopeFor: csharpBindingScopeFor,
|
|
@@ -18,6 +18,7 @@ import { dartExportChecker } from '../export-detection.js';
|
|
|
18
18
|
import { createImportResolver } from '../import-resolvers/resolver-factory.js';
|
|
19
19
|
import { dartImportConfig } from '../import-resolvers/configs/dart.js';
|
|
20
20
|
import { DART_QUERIES } from '../tree-sitter-queries.js';
|
|
21
|
+
import { createDartCfgVisitor } from '../cfg/visitors/dart.js';
|
|
21
22
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
22
23
|
import { dartConfig as dartFieldConfig } from '../field-extractors/configs/dart.js';
|
|
23
24
|
import { createMethodExtractor } from '../method-extractors/generic.js';
|
|
@@ -114,6 +115,7 @@ export const dartProvider = defineLanguage({
|
|
|
114
115
|
// emit-side `ScopeResolver` lives in `dart/scope-resolver.ts`; the same
|
|
115
116
|
// function references flow through both interfaces.
|
|
116
117
|
emitScopeCaptures: emitDartScopeCaptures,
|
|
118
|
+
cfgVisitor: createDartCfgVisitor(),
|
|
117
119
|
interpretImport: interpretDartImport,
|
|
118
120
|
interpretTypeBinding: interpretDartTypeBinding,
|
|
119
121
|
bindingScopeFor: dartBindingScopeFor,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
11
11
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
12
12
|
import { goClassConfig } from '../class-extractors/configs/go.js';
|
|
13
|
+
import { createGoCfgVisitor } from '../cfg/visitors/go.js';
|
|
13
14
|
import { defineLanguage } from '../language-provider.js';
|
|
14
15
|
import { typeConfig as goConfig } from '../type-extractors/go.js';
|
|
15
16
|
import { goExportChecker } from '../export-detection.js';
|
|
@@ -128,6 +129,7 @@ export const goProvider = defineLanguage({
|
|
|
128
129
|
builtInNames: GO_BUILT_INS,
|
|
129
130
|
// ── RFC #909 Ring 3: scope-based resolution hooks ──────────
|
|
130
131
|
emitScopeCaptures: emitGoScopeCaptures,
|
|
132
|
+
cfgVisitor: createGoCfgVisitor(),
|
|
131
133
|
interpretImport: interpretGoImport,
|
|
132
134
|
interpretTypeBinding: interpretGoTypeBinding,
|
|
133
135
|
bindingScopeFor: goBindingScopeFor,
|
|
@@ -24,6 +24,7 @@ import { createMethodExtractor } from '../method-extractors/generic.js';
|
|
|
24
24
|
import { javaMethodConfig } from '../method-extractors/configs/jvm.js';
|
|
25
25
|
import { createVariableExtractor } from '../variable-extractors/generic.js';
|
|
26
26
|
import { javaVariableConfig } from '../variable-extractors/configs/jvm.js';
|
|
27
|
+
import { createJavaCfgVisitor } from '../cfg/visitors/java.js';
|
|
27
28
|
import { emitJavaScopeCaptures, interpretJavaImport, interpretJavaTypeBinding, javaBindingScopeFor, javaImportOwningScope, javaMergeBindings, javaReceiverBinding, javaArityCompatibility, resolveJavaImportTarget, } from './java/index.js';
|
|
28
29
|
const orderJavaSameNameTypeCandidates = ({ callSiteFilePath, candidates, }) => {
|
|
29
30
|
if (!callSiteFilePath.endsWith('.java'))
|
|
@@ -95,6 +96,8 @@ export const javaProvider = defineLanguage({
|
|
|
95
96
|
classExtractor: createClassExtractor(javaClassConfig),
|
|
96
97
|
// ── RFC #909 Ring 3: scope-based resolution hooks ──
|
|
97
98
|
emitScopeCaptures: emitJavaScopeCaptures,
|
|
99
|
+
// ── PDG: per-function CFG + def/use harvest (#2195 U4) ──
|
|
100
|
+
cfgVisitor: createJavaCfgVisitor(),
|
|
98
101
|
interpretImport: interpretJavaImport,
|
|
99
102
|
interpretTypeBinding: interpretJavaTypeBinding,
|
|
100
103
|
bindingScopeFor: javaBindingScopeFor,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Parser from 'tree-sitter';
|
|
2
2
|
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
3
|
-
// `tree-sitter-kotlin` is
|
|
4
|
-
//
|
|
3
|
+
// `tree-sitter-kotlin` is a vendored grammar (loaded from vendor/ by absolute
|
|
4
|
+
// path, never node_modules — vendored-grammars.ts / #2111) that may be absent on
|
|
5
|
+
// a platform without a matching prebuild. Loaded lazily + guarded via parser-loader
|
|
5
6
|
// rather than statically imported: this module is pulled onto the main thread
|
|
6
7
|
// eagerly by the scope-resolution registry and the language-provider index, so
|
|
7
8
|
// a top-level `import Kotlin from 'tree-sitter-kotlin'` would throw
|
|
@@ -10,6 +10,7 @@ import { SupportedLanguages } from '../../../_shared/index.js';
|
|
|
10
10
|
import { createClassExtractor } from '../class-extractors/generic.js';
|
|
11
11
|
import { kotlinClassConfig } from '../class-extractors/configs/jvm.js';
|
|
12
12
|
import { defineLanguage } from '../language-provider.js';
|
|
13
|
+
import { assertCloneable } from '../workers/clone-safety.js';
|
|
13
14
|
import { kotlinTypeConfig } from '../type-extractors/jvm.js';
|
|
14
15
|
import { kotlinExportChecker } from '../export-detection.js';
|
|
15
16
|
import { createImportResolver } from '../import-resolvers/resolver-factory.js';
|
|
@@ -18,6 +19,7 @@ import { appendKotlinWildcard } from '../import-resolvers/jvm.js';
|
|
|
18
19
|
import { KOTLIN_QUERIES } from '../tree-sitter-queries.js';
|
|
19
20
|
import { createCallExtractor } from '../call-extractors/generic.js';
|
|
20
21
|
import { kotlinCallConfig } from '../call-extractors/configs/jvm.js';
|
|
22
|
+
import { createKotlinCfgVisitor } from '../cfg/visitors/kotlin.js';
|
|
21
23
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
22
24
|
import { kotlinConfig } from '../field-extractors/configs/jvm.js';
|
|
23
25
|
import { createMethodExtractor } from '../method-extractors/generic.js';
|
|
@@ -160,13 +162,18 @@ export const kotlinProvider = defineLanguage({
|
|
|
160
162
|
},
|
|
161
163
|
// ── RFC #909 Ring 3: scope-based resolution hooks ──
|
|
162
164
|
emitScopeCaptures: emitKotlinScopeCaptures,
|
|
165
|
+
// ── #2195 PDG layer: Kotlin CFG visitor (vendored grammar) ──
|
|
166
|
+
cfgVisitor: createKotlinCfgVisitor(),
|
|
163
167
|
// Worker-side: snapshot the module-level companion-scope marks
|
|
164
168
|
// `emitKotlinScopeCaptures` just populated for this file (`markCompanionScope`
|
|
165
169
|
// → `companionScopesByFile`) into plain data on `ParsedFile.captureSideChannel`,
|
|
166
170
|
// so the main thread can restore them via `applyCaptureSideChannel` WITHOUT a
|
|
167
171
|
// re-parse (#1983). Without this, companion/static dispatch emits no CALLS
|
|
168
172
|
// edges on the worker path. See `kotlin/capture-side-channel.ts`.
|
|
169
|
-
|
|
173
|
+
// `assertCloneable` is a runtime identity; it makes a future non-serializable
|
|
174
|
+
// value in the side-channel payload a compile error here, at the source, rather
|
|
175
|
+
// than a DataCloneError at the worker boundary (#2143).
|
|
176
|
+
collectCaptureSideChannel: (filePath) => assertCloneable(collectKotlinCaptureSideChannel(filePath)),
|
|
170
177
|
interpretImport: interpretKotlinImport,
|
|
171
178
|
interpretTypeBinding: interpretKotlinTypeBinding,
|
|
172
179
|
bindingScopeFor: kotlinBindingScopeFor,
|