gitnexus 1.6.9 → 1.6.10-aptos.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 +211 -53
- package/dist/_shared/graph/types.d.ts +67 -3
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.d.ts +3 -1
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.js +4 -3
- package/dist/_shared/integrations/resilient-fetch.js.map +1 -1
- package/dist/_shared/language-detection.d.ts.map +1 -1
- package/dist/_shared/language-detection.js +2 -0
- package/dist/_shared/language-detection.js.map +1 -1
- package/dist/_shared/languages.d.ts +2 -0
- package/dist/_shared/languages.d.ts.map +1 -1
- package/dist/_shared/languages.js +2 -0
- package/dist/_shared/languages.js.map +1 -1
- package/dist/_shared/lbug/schema-constants.d.ts +2 -2
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
- package/dist/_shared/lbug/schema-constants.js +8 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -1
- package/dist/_shared/pipeline.d.ts +1 -1
- package/dist/_shared/pipeline.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/callable-flow-site.d.ts +110 -0
- package/dist/_shared/scope-resolution/callable-flow-site.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/callable-flow-site.js +11 -0
- package/dist/_shared/scope-resolution/callable-flow-site.js.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.js +1 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +7 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +9 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +20 -3
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +1 -1
- package/dist/cli/ai-context.js +25 -44
- package/dist/cli/analyze.d.ts +5 -2
- package/dist/cli/analyze.js +197 -11
- package/dist/cli/clean.js +17 -3
- package/dist/cli/cli-message.d.ts +1 -1
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.js +96 -5
- package/dist/cli/editor-targets.d.ts +17 -2
- package/dist/cli/editor-targets.js +44 -0
- package/dist/cli/embeddings.d.ts +12 -0
- package/dist/cli/embeddings.js +49 -0
- package/dist/cli/eval-server.d.ts +23 -1
- package/dist/cli/eval-server.js +126 -8
- package/dist/cli/help-i18n.js +6 -0
- package/dist/cli/i18n/en.d.ts +18 -8
- package/dist/cli/i18n/en.js +18 -8
- package/dist/cli/i18n/resources.d.ts +28 -8
- package/dist/cli/i18n/zh-CN.d.ts +10 -0
- package/dist/cli/i18n/zh-CN.js +18 -8
- package/dist/cli/index.js +21 -7
- package/dist/cli/lazy-action.d.ts +7 -0
- package/dist/cli/lazy-action.js +27 -0
- package/dist/cli/mcp.js +6 -3
- package/dist/cli/move-availability.d.ts +5 -0
- package/dist/cli/move-availability.js +11 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +230 -32
- package/dist/cli/skill-gen.js +38 -18
- package/dist/cli/standard-skills.d.ts +76 -0
- package/dist/cli/standard-skills.js +45 -0
- package/dist/cli/status.d.ts +4 -1
- package/dist/cli/status.js +57 -4
- package/dist/cli/tool.js +11 -0
- package/dist/cli/uninstall.js +77 -18
- package/dist/cli/wiki.d.ts +1 -0
- package/dist/cli/wiki.js +7 -1
- package/dist/config/ignore-service.d.ts +2 -0
- package/dist/config/ignore-service.js +27 -0
- package/dist/core/analysis-features.d.ts +21 -0
- package/dist/core/analysis-features.js +59 -0
- package/dist/core/analyzer-identity.d.ts +74 -0
- package/dist/core/analyzer-identity.js +1820 -0
- package/dist/core/augmentation/engine.js +13 -8
- package/dist/core/embeddings/embedder.d.ts +3 -2
- package/dist/core/embeddings/embedder.js +24 -7
- package/dist/core/embeddings/embedding-identity.d.ts +11 -0
- package/dist/core/embeddings/embedding-identity.js +24 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +36 -1
- package/dist/core/embeddings/embedding-pipeline.js +100 -9
- package/dist/core/embeddings/http-client.d.ts +33 -3
- package/dist/core/embeddings/http-client.js +237 -25
- package/dist/core/embeddings/node-module-compat.d.ts +25 -0
- package/dist/core/embeddings/node-module-compat.js +25 -0
- package/dist/core/embeddings/onnxruntime-common-resolver.js +8 -5
- package/dist/core/embeddings/onnxruntime-node-resolver.js +33 -7
- package/dist/core/embeddings/runtime-install.d.ts +119 -0
- package/dist/core/embeddings/runtime-install.js +372 -0
- package/dist/core/embeddings/runtime-support.d.ts +48 -17
- package/dist/core/embeddings/runtime-support.js +96 -0
- package/dist/core/git-staleness.js +1 -1
- package/dist/core/group/bridge-db.js +2 -0
- package/dist/core/group/extractors/http-patterns/python.js +246 -108
- package/dist/core/group/extractors/manifest-extractor.js +4 -0
- package/dist/core/incremental/escalation-gate.d.ts +38 -0
- package/dist/core/incremental/escalation-gate.js +48 -0
- package/dist/core/incremental/shadow-candidates.d.ts +3 -3
- package/dist/core/incremental/shadow-candidates.js +3 -3
- package/dist/core/incremental/subgraph-extract.d.ts +2 -2
- package/dist/core/incremental/subgraph-extract.js +2 -2
- package/dist/core/index-freshness.d.ts +5 -0
- package/dist/core/index-freshness.js +13 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.js +29 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +1 -1
- package/dist/core/ingestion/cobol/jcl-processor.js +9 -8
- package/dist/core/ingestion/cobol-processor.js +27 -26
- package/dist/core/ingestion/community-processor.d.ts +51 -1
- package/dist/core/ingestion/community-processor.js +323 -64
- package/dist/core/ingestion/emit-references.js +7 -2
- package/dist/core/ingestion/filesystem-walker.js +4 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.d.ts +3 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.js +7 -0
- package/dist/core/ingestion/frameworks/spring/bean-candidates.d.ts +30 -0
- package/dist/core/ingestion/frameworks/spring/bean-candidates.js +182 -0
- package/dist/core/ingestion/frameworks/spring/bean-catalog.d.ts +12 -0
- package/dist/core/ingestion/frameworks/spring/bean-catalog.js +26 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.d.ts +24 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.js +115 -0
- package/dist/core/ingestion/languages/c/captures.js +56 -0
- package/dist/core/ingestion/languages/c/query.js +17 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +6 -0
- package/dist/core/ingestion/languages/cobol/captures.js +93 -0
- package/dist/core/ingestion/languages/cobol/scope-resolver.js +7 -0
- package/dist/core/ingestion/languages/cpp/captures.js +365 -75
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +14 -0
- package/dist/core/ingestion/languages/csharp/captures.js +25 -0
- package/dist/core/ingestion/languages/dart/captures.js +90 -2
- package/dist/core/ingestion/languages/dart/extension-type-preprocess.d.ts +7 -0
- package/dist/core/ingestion/languages/dart/extension-type-preprocess.js +30 -0
- package/dist/core/ingestion/languages/dart.js +2 -0
- package/dist/core/ingestion/languages/go/captures.js +34 -0
- package/dist/core/ingestion/languages/index.d.ts +1 -0
- package/dist/core/ingestion/languages/index.js +2 -0
- package/dist/core/ingestion/languages/java/analysis-features.d.ts +3 -0
- package/dist/core/ingestion/languages/java/analysis-features.js +13 -0
- package/dist/core/ingestion/languages/java/capture-side-channel.d.ts +22 -0
- package/dist/core/ingestion/languages/java/capture-side-channel.js +58 -0
- package/dist/core/ingestion/languages/java/captures.d.ts +4 -3
- package/dist/core/ingestion/languages/java/captures.js +193 -17
- package/dist/core/ingestion/languages/java/package-facts.d.ts +5 -0
- package/dist/core/ingestion/languages/java/package-facts.js +9 -0
- package/dist/core/ingestion/languages/java/package-siblings.d.ts +3 -16
- package/dist/core/ingestion/languages/java/package-siblings.js +8 -147
- package/dist/core/ingestion/languages/java/query.js +23 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +23 -0
- package/dist/core/ingestion/languages/java/spring-bean-metadata.d.ts +2 -0
- package/dist/core/ingestion/languages/java/spring-bean-metadata.js +8 -0
- package/dist/core/ingestion/languages/java/spring-config-bindings.d.ts +23 -0
- package/dist/core/ingestion/languages/java/spring-config-bindings.js +215 -0
- package/dist/core/ingestion/languages/java.js +3 -0
- package/dist/core/ingestion/languages/javascript/captures.js +16 -0
- package/dist/core/ingestion/languages/javascript/query.js +21 -0
- package/dist/core/ingestion/languages/jvm/package-facts.d.ts +35 -0
- package/dist/core/ingestion/languages/jvm/package-facts.js +40 -0
- package/dist/core/ingestion/languages/jvm/package-siblings.d.ts +14 -0
- package/dist/core/ingestion/languages/jvm/package-siblings.js +129 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +17 -3
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +42 -8
- package/dist/core/ingestion/languages/kotlin/captures.js +59 -0
- package/dist/core/ingestion/languages/kotlin/package-facts.d.ts +5 -0
- package/dist/core/ingestion/languages/kotlin/package-facts.js +9 -0
- package/dist/core/ingestion/languages/kotlin/package-siblings.d.ts +4 -0
- package/dist/core/ingestion/languages/kotlin/package-siblings.js +8 -0
- package/dist/core/ingestion/languages/kotlin/query.js +19 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +9 -1
- package/dist/core/ingestion/languages/kotlin/spring-bean-metadata.d.ts +2 -0
- package/dist/core/ingestion/languages/kotlin/spring-bean-metadata.js +8 -0
- package/dist/core/ingestion/languages/kotlin.js +5 -6
- package/dist/core/ingestion/languages/move.d.ts +1 -0
- package/dist/core/ingestion/languages/move.js +27 -0
- package/dist/core/ingestion/languages/php/captures.js +40 -0
- package/dist/core/ingestion/languages/php/import-decomposer.js +12 -0
- package/dist/core/ingestion/languages/php/import-target.d.ts +2 -1
- package/dist/core/ingestion/languages/php/import-target.js +110 -2
- package/dist/core/ingestion/languages/php/interpret.js +10 -0
- package/dist/core/ingestion/languages/php/scope-resolver.js +1 -1
- package/dist/core/ingestion/languages/python/captures.d.ts +3 -4
- package/dist/core/ingestion/languages/python/captures.js +24 -5
- package/dist/core/ingestion/languages/python/interpret.js +4 -0
- package/dist/core/ingestion/languages/python/receiver-binding.d.ts +15 -2
- package/dist/core/ingestion/languages/python/receiver-binding.js +96 -2
- package/dist/core/ingestion/languages/python/simple-hooks.d.ts +5 -5
- package/dist/core/ingestion/languages/python/simple-hooks.js +15 -5
- package/dist/core/ingestion/languages/ruby/captures.js +42 -0
- package/dist/core/ingestion/languages/rust/captures.js +13 -0
- package/dist/core/ingestion/languages/rust/interpret.js +18 -0
- package/dist/core/ingestion/languages/rust/query.js +9 -0
- package/dist/core/ingestion/languages/rust/range-binding.js +6 -2
- package/dist/core/ingestion/languages/swift/captures.js +12 -0
- package/dist/core/ingestion/languages/typescript/captures.js +21 -0
- package/dist/core/ingestion/languages/typescript/nuxt-auto-imports.js +2 -1
- package/dist/core/ingestion/languages/typescript/query.js +37 -0
- package/dist/core/ingestion/markdown-processor.js +3 -2
- package/dist/core/ingestion/model/registration-table.js +1 -0
- package/dist/core/ingestion/parsing-processor.d.ts +3 -1
- package/dist/core/ingestion/parsing-processor.js +36 -1
- 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.js +56 -2
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +0 -2
- package/dist/core/ingestion/pipeline-phases/parse.js +12 -3
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +8 -0
- package/dist/core/ingestion/pipeline-phases/processes.js +11 -1
- package/dist/core/ingestion/pipeline-phases/spring-config.d.ts +37 -0
- package/dist/core/ingestion/pipeline-phases/spring-config.js +433 -0
- package/dist/core/ingestion/pipeline-phases/standalone-ingest.d.ts +10 -0
- package/dist/core/ingestion/pipeline-phases/standalone-ingest.js +6 -0
- package/dist/core/ingestion/pipeline.d.ts +4 -2
- package/dist/core/ingestion/pipeline.js +5 -2
- package/dist/core/ingestion/resolve-references.js +12 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.d.ts +83 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.js +131 -0
- package/dist/core/ingestion/route-extractors/python-const-resolver.d.ts +75 -0
- package/dist/core/ingestion/route-extractors/python-const-resolver.js +299 -0
- package/dist/core/ingestion/scope-extractor.js +306 -43
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +71 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.d.ts +7 -7
- package/dist/core/ingestion/scope-resolution/graph-bridge/callee-id-sink.js +8 -7
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +3 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +6 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +1 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +4 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +7 -2
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.d.ts +47 -0
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.js +1138 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +16 -4
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +97 -1
- package/dist/core/ingestion/scope-resolution/passes/property-dispatch.d.ts +60 -0
- package/dist/core/ingestion/scope-resolution/passes/property-dispatch.js +111 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +4 -3
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +5 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +25 -38
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +6 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +147 -35
- package/dist/core/ingestion/scope-resolution/resolution-outcome.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +73 -44
- package/dist/core/ingestion/taint/typescript-model.js +34 -2
- package/dist/core/ingestion/tree-sitter-queries.d.ts +2 -2
- package/dist/core/ingestion/tree-sitter-queries.js +23 -2
- package/dist/core/ingestion/type-extractors/jvm.js +17 -2
- package/dist/core/ingestion/utils/ast-helpers.d.ts +1 -0
- package/dist/core/ingestion/utils/ast-helpers.js +153 -2
- package/dist/core/ingestion/utils/callable-flow-captures.d.ts +94 -0
- package/dist/core/ingestion/utils/callable-flow-captures.js +878 -0
- package/dist/core/ingestion/utils/line-base.d.ts +20 -0
- package/dist/core/ingestion/utils/line-base.js +20 -0
- package/dist/core/ingestion/utils/symbol-labels.d.ts +21 -0
- package/dist/core/ingestion/utils/symbol-labels.js +45 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +34 -0
- package/dist/core/ingestion/workers/parse-worker.js +40 -5
- package/dist/core/ingestion/workers/result-merge.js +4 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +28 -0
- package/dist/core/ingestion/workers/worker-pool.js +128 -28
- package/dist/core/lbug/csv-generator.d.ts +15 -0
- package/dist/core/lbug/csv-generator.js +124 -27
- package/dist/core/lbug/cypher-escape.d.ts +20 -0
- package/dist/core/lbug/cypher-escape.js +20 -0
- package/dist/core/lbug/extension-load-error.d.ts +67 -0
- package/dist/core/lbug/extension-load-error.js +326 -0
- package/dist/core/lbug/extension-loader.d.ts +17 -2
- package/dist/core/lbug/extension-loader.js +38 -13
- package/dist/core/lbug/lbug-adapter.d.ts +203 -2
- package/dist/core/lbug/lbug-adapter.js +527 -86
- package/dist/core/lbug/lbug-config.d.ts +56 -2
- package/dist/core/lbug/lbug-config.js +267 -7
- package/dist/core/lbug/move-columns.d.ts +7 -0
- package/dist/core/lbug/move-columns.js +86 -0
- package/dist/core/lbug/native-check.d.ts +40 -0
- package/dist/core/lbug/native-check.js +90 -0
- package/dist/core/lbug/node-table-layout.d.ts +29 -0
- package/dist/core/lbug/node-table-layout.js +119 -0
- package/dist/core/lbug/pool-adapter.d.ts +23 -1
- package/dist/core/lbug/pool-adapter.js +115 -8
- package/dist/core/lbug/schema.d.ts +4 -3
- package/dist/core/lbug/schema.js +16 -16
- package/dist/core/lbug/sidecar-recovery.d.ts +172 -0
- package/dist/core/lbug/sidecar-recovery.js +418 -16
- package/dist/core/lbug/wal-checkpoint-driver.js +3 -0
- package/dist/core/move/artifact-download.d.ts +19 -0
- package/dist/core/move/artifact-download.js +179 -0
- package/dist/core/move/compiler-facts.d.ts +120 -0
- package/dist/core/move/compiler-facts.js +9 -0
- package/dist/core/move/consistency.d.ts +28 -0
- package/dist/core/move/consistency.js +98 -0
- package/dist/core/move/constants.d.ts +98 -0
- package/dist/core/move/constants.js +136 -0
- package/dist/core/move/discovery.d.ts +10 -0
- package/dist/core/move/discovery.js +22 -0
- package/dist/core/move/entry-points.d.ts +14 -0
- package/dist/core/move/entry-points.js +40 -0
- package/dist/core/move/facts-mapper.d.ts +75 -0
- package/dist/core/move/facts-mapper.js +534 -0
- package/dist/core/move/install-lock.d.ts +14 -0
- package/dist/core/move/install-lock.js +102 -0
- package/dist/core/move/install.d.ts +39 -0
- package/dist/core/move/install.js +391 -0
- package/dist/core/move/mcp-client.d.ts +115 -0
- package/dist/core/move/mcp-client.js +436 -0
- package/dist/core/move/move-ingest.d.ts +49 -0
- package/dist/core/move/move-ingest.js +320 -0
- package/dist/core/move/provision.d.ts +19 -0
- package/dist/core/move/provision.js +91 -0
- package/dist/core/move/release.d.ts +6 -0
- package/dist/core/move/release.js +10 -0
- package/dist/core/move/symbol-id.d.ts +35 -0
- package/dist/core/move/symbol-id.js +65 -0
- package/dist/core/move/type-parser.d.ts +11 -0
- package/dist/core/move/type-parser.js +38 -0
- package/dist/core/platform/capabilities.d.ts +0 -1
- package/dist/core/platform/capabilities.js +39 -8
- package/dist/core/run-analyze.d.ts +3 -3
- package/dist/core/run-analyze.js +1001 -184
- package/dist/core/search/fts-indexes.d.ts +31 -0
- package/dist/core/search/fts-indexes.js +73 -0
- package/dist/core/search/fts-schema.js +2 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +8 -3
- package/dist/core/tree-sitter/safe-parse.js +21 -7
- package/dist/core/wiki/graph-queries.js +6 -5
- package/dist/core/wiki/llm-client.d.ts +8 -2
- package/dist/core/wiki/llm-client.js +41 -5
- package/dist/mcp/core/embedder.js +16 -2
- package/dist/mcp/http-transport.d.ts +5 -0
- package/dist/mcp/http-transport.js +19 -5
- package/dist/mcp/local/bean-metadata.d.ts +2 -0
- package/dist/mcp/local/bean-metadata.js +25 -0
- package/dist/mcp/local/line-display.d.ts +22 -0
- package/dist/mcp/local/line-display.js +3 -0
- package/dist/mcp/local/local-backend.d.ts +19 -1
- package/dist/mcp/local/local-backend.js +402 -155
- package/dist/mcp/local/pdg-impact.d.ts +5 -3
- package/dist/mcp/local/pdg-impact.js +5 -2
- package/dist/mcp/output-budget.d.ts +5 -0
- package/dist/mcp/output-budget.js +52 -0
- package/dist/mcp/read-only-policy.d.ts +12 -0
- package/dist/mcp/read-only-policy.js +102 -0
- package/dist/mcp/repository-policy.d.ts +34 -0
- package/dist/mcp/repository-policy.js +328 -0
- package/dist/mcp/resources.js +32 -5
- package/dist/mcp/server.d.ts +5 -2
- package/dist/mcp/server.js +29 -9
- package/dist/mcp/tools.d.ts +0 -8
- package/dist/mcp/tools.js +102 -5
- package/dist/server/analyze-job.d.ts +3 -0
- package/dist/server/analyze-job.js +17 -0
- package/dist/server/analyze-launch.d.ts +6 -0
- package/dist/server/analyze-launch.js +82 -6
- package/dist/server/analyze-worker-core.d.ts +2 -1
- package/dist/server/analyze-worker-core.js +5 -2
- package/dist/server/analyze-worker.js +29 -6
- package/dist/server/api.d.ts +30 -0
- package/dist/server/api.js +120 -34
- package/dist/server/mcp-http.d.ts +1 -1
- package/dist/server/mcp-http.js +4 -2
- package/dist/server/upload-ingest.js +2 -1
- package/dist/server/validation.js +2 -1
- package/dist/storage/git.d.ts +31 -0
- package/dist/storage/git.js +111 -1
- package/dist/storage/parse-cache.js +7 -1
- package/dist/storage/parsedfile-store.d.ts +8 -0
- package/dist/storage/parsedfile-store.js +165 -1
- package/dist/storage/repo-manager.d.ts +194 -2
- package/dist/storage/repo-manager.js +56 -1
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +50 -3
- package/hooks/claude/gitnexus-hook.cjs +59 -9
- package/hooks/claude/pre-tool-use.sh +0 -0
- package/hooks/claude/session-start.sh +0 -0
- package/package.json +21 -15
- package/scripts/cross-platform-tests.ts +56 -0
- package/scripts/ensure-fts.ts +43 -0
- package/scripts/install-duckdb-extension.mjs +85 -24
- package/scripts/run-cross-platform.ts +61 -6
- package/scripts/shard-arg.ts +30 -0
- package/scripts/sync-plugin-manifests.mjs +192 -0
- package/skills/gitnexus-lfg/README.md +55 -0
- package/skills/gitnexus-lfg/SKILL.md +86 -0
- package/skills/gitnexus-plan/README.md +142 -0
- package/skills/gitnexus-plan/SKILL.md +348 -0
- package/skills/gitnexus-plan/references/context-ledger.md +137 -0
- package/skills/gitnexus-plan/references/context-pack.md +126 -0
- package/skills/gitnexus-plan/references/evidence-provenance.md +272 -0
- package/skills/gitnexus-plan/references/pdg-slice.md +109 -0
- package/skills/gitnexus-plan/references/plan-template.md +201 -0
- package/skills/gitnexus-plan/scripts/evidence-provenance.mjs +2084 -0
- package/skills/gitnexus-review/SKILL.md +273 -0
- package/skills/gitnexus-review/ci-personas/ci-adversarial-lens.md +42 -0
- package/skills/gitnexus-review/ci-personas/ci-blast-radius-lens.md +39 -0
- package/skills/gitnexus-review/ci-personas/ci-correctness-lens.md +37 -0
- package/skills/gitnexus-review/ci-personas/ci-coverage-lens.md +40 -0
- package/skills/gitnexus-review/ci-personas/ci-critic-lens.md +42 -0
- package/skills/gitnexus-review/ci-personas/ci-security-lens.md +39 -0
- package/skills/gitnexus-work/README.md +71 -0
- package/skills/gitnexus-work/SKILL.md +269 -0
- package/skills/gitnexus-work/references/evidence-provenance.md +272 -0
- package/skills/gitnexus-work/scripts/evidence-provenance.mjs +2084 -0
- package/web/assets/ProcessFlowModal-B_bfBySy.js +22 -0
- package/web/assets/__vite-browser-external-bMKyYQkO.js +1 -0
- package/web/assets/agent-Bqxn-abU.js +626 -0
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-BVWFvYz2.js +1 -0
- package/web/assets/architectureDiagram-UL44E2DR-CmG3uPWf.js +36 -0
- package/web/assets/{blockDiagram-7IZFK4PR-BkWhpzWB.js → blockDiagram-7IZFK4PR-DBefcjof.js} +7 -7
- package/web/assets/{c4Diagram-Y2BXMSZH-DtBvpzWD.js → c4Diagram-Y2BXMSZH-EjWnjEJl.js} +6 -6
- package/web/assets/chunk-2T2R6R2M-Bb6Sy3_j.js +4 -0
- package/web/assets/chunk-2UTLFMKG-CXlhF3Pt.js +1 -0
- package/web/assets/chunk-3SSMPTDK-rPsRM1x0.js +321 -0
- package/web/assets/chunk-4R4BOZG6-Be_F0JoX.js +159 -0
- package/web/assets/{chunk-6764PJDD-DpIS7hxD.js → chunk-6764PJDD-C7xxk063.js} +1 -1
- package/web/assets/chunk-67TQ5CYL-CA7OhIEf.js +124 -0
- package/web/assets/chunk-7FYTHRHK-CsmYIswB.js +32 -0
- package/web/assets/chunk-7J6CGLKN-BlKwgXKs.js +10 -0
- package/web/assets/chunk-7W6UQGC5-pyKGssV3.js +1 -0
- package/web/assets/chunk-C62D2QBJ-3gdL8EKc.js +1 -0
- package/web/assets/chunk-CEXFNPSA-CjwtMDkc.js +1 -0
- package/web/assets/{chunk-INKRHTLW-Nu4ri9P-.js → chunk-INKRHTLW-Ckl3_KkO.js} +13 -13
- package/web/assets/chunk-J5EP6P6S-L19oz55R.js +1 -0
- package/web/assets/{chunk-KGFNY3KK-JGMJvKCK.js → chunk-KGFNY3KK-BZeP-55u.js} +17 -17
- package/web/assets/chunk-KGYTTC2M-zm6n242I.js +1 -0
- package/web/assets/{chunk-KRXBNO2N-BW5o0KUN.js → chunk-KRXBNO2N-C-UNuKKf.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-CfLLCywY.js → chunk-LCXTWHL2-C162wE5z.js} +5 -5
- package/web/assets/chunk-LII3EMHJ-BL6lKJ_P.js +1 -0
- package/web/assets/chunk-LRIF4GLE-n59lhprL.js +1 -0
- package/web/assets/chunk-QA3QBVWF-DVXPOIxe.js +2 -0
- package/web/assets/chunk-RERM46MO-B5dAdWpP.js +1 -0
- package/web/assets/chunk-RG4AUYOV-ZNgyLFq6.js +206 -0
- package/web/assets/chunk-RKZBBQEN-MyIQbGgD.js +1 -0
- package/web/assets/chunk-RLI5ZMPA-CkXZ0y0U.js +1 -0
- package/web/assets/chunk-T2UQINTJ-BEyXhZWe.js +1 -0
- package/web/assets/chunk-UP6H54XL-BG-n7qDp.js +1 -0
- package/web/assets/chunk-UXSXWOXI-CW1_r5cS.js +1 -0
- package/web/assets/chunk-UY5QBCOK-ByqTVLvh.js +1 -0
- package/web/assets/chunk-VU6ZFW4Y-BLeasdkU.js +2 -0
- package/web/assets/{chunk-W44A43WB-JqMLIpR0.js → chunk-W44A43WB-BN8EQc_u.js} +1 -1
- package/web/assets/chunk-ZXARS5L4-C3v-4Fsw.js +1 -0
- package/web/assets/classDiagram-KGZ6W3CR-olpO3fMe.js +1 -0
- package/web/assets/classDiagram-v2-72OJOZXJ-olpO3fMe.js +1 -0
- package/web/assets/cose-bilkent-UX7MHV2Q-BmnZ7Mvj.js +1 -0
- package/web/assets/dagre-ND4H6XIP-CY4iIF7v.js +4 -0
- package/web/assets/diagram-3NCE3AQN-CO6QpzEE.js +43 -0
- package/web/assets/diagram-GF46GFSD-B2atbzmU.js +24 -0
- package/web/assets/diagram-HNR7UZ2L-DVRltWbL.js +3 -0
- package/web/assets/diagram-QXG6HAR7-DR6AHD2h.js +24 -0
- package/web/assets/diagram-WEQXMOUZ-DkpoMwTL.js +10 -0
- package/web/assets/erDiagram-L5TCEMPS-n8g_90bc.js +85 -0
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-CgFBM7e-.js +1 -0
- package/web/assets/flowDiagram-H6V6AXG4-SGMDiCkB.js +162 -0
- package/web/assets/ganttDiagram-JCBTUEKG-Cb3UBqRS.js +292 -0
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-DCJv7SII.js +1 -0
- package/web/assets/gitGraphDiagram-S2ZK5IYY-Bs9CR7tq.js +106 -0
- package/web/assets/index-CX_fADmQ.css +2 -0
- package/web/assets/index-D1Z3dGGz.js +575 -0
- package/web/assets/info-J43DQDTF-KCYPFFUO-BfNy-9Nd.js +1 -0
- package/web/assets/infoDiagram-3YFTVSEB-T368on4D.js +2 -0
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-DfYpxnE5.js → ishikawaDiagram-BNXS4ZKH-XpjJRU9h.js} +6 -6
- package/web/assets/journeyDiagram-M6C3CM3L-C6wjooas.js +139 -0
- package/web/assets/kanban-definition-75IXJCU3-5_UVY79g.js +89 -0
- package/web/assets/{katex-K3KEBU37-CTc5BslQ.js → katex-K3KEBU37-qRQBy-EZ.js} +2 -2
- package/web/assets/{mindmap-definition-2TDM6QVE-DypvbOMQ.js → mindmap-definition-2TDM6QVE-8xDLzk2e.js} +29 -29
- package/web/assets/node-Ct_zna8U.js +8 -0
- package/web/assets/packet-YPE3B663-LP52Z2RK-D4qkeG9k.js +1 -0
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-B_yMKyQa.js +1 -0
- package/web/assets/pieDiagram-CU6KROY3-Bv4LpAbr.js +30 -0
- package/web/assets/preload-helper-Czpn1I53.js +1 -0
- package/web/assets/{quadrantDiagram-VICAPDV7-yXSZ2lLz.js → quadrantDiagram-VICAPDV7-DR54jOeR.js} +6 -6
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-DeD6yN_0.js +1 -0
- package/web/assets/requirementDiagram-JXO7QTGE-PEkg7sKC.js +84 -0
- package/web/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/assets/sankeyDiagram-URQDO5SZ-DDWEtjcs.js +40 -0
- package/web/assets/sdk-CzHHH8tD.js +37 -0
- package/web/assets/sequenceDiagram-VS2MUI6T-Bv-uwANx.js +162 -0
- package/web/assets/src-JV30wyV8.js +1 -0
- package/web/assets/stateDiagram-7D4R322I-DVNjmkEq.js +1 -0
- package/web/assets/stateDiagram-v2-36443NZ5-CyN4Fh7_.js +1 -0
- package/web/assets/timeline-definition-O6YCAMPW-Qmsuo7qS.js +120 -0
- package/web/assets/treeView-BLDUP644-QA4HXRO3-CDuSYnd4.js +1 -0
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-imazucyJ.js +1 -0
- package/web/assets/vennDiagram-MWXL3ELB-BD1iK1SX.js +34 -0
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-DqrT9tB8.js +1 -0
- package/web/assets/wardleyDiagram-CUQ6CDDI-D6TzLVob.js +78 -0
- package/web/assets/{xychartDiagram-N2JHSOCM-BOLm0eNm.js → xychartDiagram-N2JHSOCM-CoZ_Tits.js} +6 -6
- package/web/index.html +18 -10
- package/skills/gitnexus-pr-review.md +0 -163
- package/web/assets/agent-Dli_x7bU.js +0 -660
- package/web/assets/architecture-7EHR7CIX-6QZW5X65-DxJw65fT.js +0 -1
- package/web/assets/architectureDiagram-UL44E2DR-dEkqUZN9.js +0 -36
- package/web/assets/chunk-3SSMPTDK-B4_etUhr.js +0 -321
- package/web/assets/chunk-67TQ5CYL-4sNPJU1q.js +0 -124
- package/web/assets/chunk-7W6UQGC5-KyEG0HQg.js +0 -1
- package/web/assets/chunk-KGYTTC2M-CWC_c3H9.js +0 -161
- package/web/assets/chunk-LII3EMHJ-D-jm-dLa.js +0 -1
- package/web/assets/chunk-QA3QBVWF-BgRW3SXd.js +0 -2
- package/web/assets/chunk-RG4AUYOV-CqWzWsV3.js +0 -206
- package/web/assets/chunk-T2UQINTJ-DSBqkzH7.js +0 -1
- package/web/assets/chunk-UY5QBCOK-DyF0vyGd.js +0 -1
- package/web/assets/chunk-ZXARS5L4-CxN8oiwI.js +0 -1
- package/web/assets/classDiagram-KGZ6W3CR-CMne4tG9.js +0 -1
- package/web/assets/classDiagram-v2-72OJOZXJ-CMne4tG9.js +0 -1
- package/web/assets/cose-bilkent-UX7MHV2Q-D71wNYRJ.js +0 -1
- package/web/assets/dagre-ND4H6XIP-Co5rRx9X.js +0 -4
- package/web/assets/diagram-3NCE3AQN-DBp4O00j.js +0 -43
- package/web/assets/diagram-GF46GFSD-6N_8yS0i.js +0 -24
- package/web/assets/diagram-HNR7UZ2L-DFCfd5LI.js +0 -3
- package/web/assets/diagram-QXG6HAR7-Di093rFg.js +0 -24
- package/web/assets/diagram-WEQXMOUZ-DZWi4SUN.js +0 -10
- package/web/assets/erDiagram-L5TCEMPS-8X1y6R4Y.js +0 -85
- package/web/assets/eventmodeling-FCH6USID-MREXMVOE-BQm9QzEa.js +0 -1
- package/web/assets/flowDiagram-H6V6AXG4-CMpY8Ufn.js +0 -162
- package/web/assets/ganttDiagram-JCBTUEKG-D3iL2Aet.js +0 -292
- package/web/assets/gitGraph-WXDBUCRP-R675I2BI-Cr_Bm2Nb.js +0 -1
- package/web/assets/gitGraphDiagram-S2ZK5IYY-CPIDgxGm.js +0 -106
- package/web/assets/index-KctnI3Vq.js +0 -635
- package/web/assets/index-_lgn7hs5.css +0 -2
- package/web/assets/info-J43DQDTF-KCYPFFUO-Cs4p2oyk.js +0 -1
- package/web/assets/infoDiagram-3YFTVSEB-BaLMZkUg.js +0 -2
- package/web/assets/journeyDiagram-M6C3CM3L-CvArszLo.js +0 -139
- package/web/assets/kanban-definition-75IXJCU3-CpfVLLf9.js +0 -89
- package/web/assets/packet-YPE3B663-LP52Z2RK-CKCrztD2.js +0 -1
- package/web/assets/pie-LRSECV5Y-TCRJHUBD-BB7pHqoD.js +0 -1
- package/web/assets/pieDiagram-CU6KROY3-s27EFWgP.js +0 -30
- package/web/assets/radar-GUYGQ44K-RDLRG3WG-DhoTOcuK.js +0 -1
- package/web/assets/requirementDiagram-JXO7QTGE-CWhqInuf.js +0 -84
- package/web/assets/sankeyDiagram-URQDO5SZ-1qEjlFIB.js +0 -40
- package/web/assets/sequenceDiagram-VS2MUI6T-RyTlZ5cR.js +0 -162
- package/web/assets/stateDiagram-7D4R322I-DTjVfX4A.js +0 -1
- package/web/assets/stateDiagram-v2-36443NZ5-xY9_k9_Q.js +0 -1
- package/web/assets/timeline-definition-O6YCAMPW-DrrqLYAf.js +0 -120
- package/web/assets/treeView-BLDUP644-QA4HXRO3-ODehyGKL.js +0 -1
- package/web/assets/treemap-LRROVOQU-LLAWBHMP-BfpgC-7o.js +0 -1
- package/web/assets/vennDiagram-MWXL3ELB-B0RkWAim.js +0 -34
- package/web/assets/wardley-L42UT6IY-5TKZOOLJ-CNeL6VHE.js +0 -1
- package/web/assets/wardleyDiagram-CUQ6CDDI-boUxiQ5F.js +0 -78
|
@@ -4,7 +4,7 @@ import { getTreeSitterBufferSize } from '../../constants.js';
|
|
|
4
4
|
import { parseSourceSafe } from '../../../tree-sitter/safe-parse.js';
|
|
5
5
|
import { normalizeQualifiedName } from '../../utils/qualified-name.js';
|
|
6
6
|
import { splitCppInclude, splitCppUsingDecl } from './import-decomposer.js';
|
|
7
|
-
import { classifyCppParameterType, computeCppDeclarationArity, computeCppCallArity, } from './arity-metadata.js';
|
|
7
|
+
import { classifyCppParameterType, computeCppDeclarationArity, computeCppCallArity, normalizeCppParamType, } from './arity-metadata.js';
|
|
8
8
|
import { markCppAnonymousNamespaceRange, markFileLocal } from './file-local-linkage.js';
|
|
9
9
|
import { markCppDependentBase, markCppDependentPackBase } from './two-phase-lookup.js';
|
|
10
10
|
import { markCppAdlSiteArgs, markCppAdlSiteNoAdl } from './adl.js';
|
|
@@ -12,6 +12,117 @@ import { markCppInlineNamespaceRange } from './inline-namespaces.js';
|
|
|
12
12
|
import { extractCppTemplateConstraints } from './constraint-extractor.js';
|
|
13
13
|
import { captureCppMemberLookupFacts } from './member-lookup.js';
|
|
14
14
|
import { CPP_BRACED_INIT_TYPE_PREFIX } from './conversion-rank.js';
|
|
15
|
+
import { logger } from '../../../logger.js';
|
|
16
|
+
import { synthesizeCallableFlowCaptures, } from '../../utils/callable-flow-captures.js';
|
|
17
|
+
const CPP_CALLABLE_CAPTURE_OPTIONS = {
|
|
18
|
+
functionNodeTypes: new Set(['function_definition', 'lambda_expression']),
|
|
19
|
+
callNodeTypes: new Set(['call_expression']),
|
|
20
|
+
parameterListNodeTypes: new Set(['parameter_list', 'argument_list']),
|
|
21
|
+
parameterNodeTypes: new Set(['parameter_declaration', 'optional_parameter_declaration']),
|
|
22
|
+
bindingNodeTypes: new Set(['init_declarator']),
|
|
23
|
+
assignmentNodeTypes: new Set(['assignment_expression']),
|
|
24
|
+
identifierNodeTypes: new Set([
|
|
25
|
+
'identifier',
|
|
26
|
+
'field_identifier',
|
|
27
|
+
'type_identifier',
|
|
28
|
+
'namespace_identifier',
|
|
29
|
+
]),
|
|
30
|
+
callableSignatureDeclarationNodeTypes: new Set([
|
|
31
|
+
'declaration',
|
|
32
|
+
'field_declaration',
|
|
33
|
+
'parameter_declaration',
|
|
34
|
+
'optional_parameter_declaration',
|
|
35
|
+
]),
|
|
36
|
+
callableReferenceNodeTypes: new Set(['qualified_identifier']),
|
|
37
|
+
emitCanonicalInvokeReference: true,
|
|
38
|
+
memberPointerOperators: new Set(['.*', '->*']),
|
|
39
|
+
memberPointerParts: (node) => cppRecoveredMemberPointerParts(node),
|
|
40
|
+
parameterPassingMode: (parameter) => cppOutermostPassingMode(parameter),
|
|
41
|
+
isTrueReferenceBinding: (_container, destination) => cppContainsNodeType(destination, 'reference_declarator'),
|
|
42
|
+
expectedSignature: (container, destination) => cppFunctionDeclaratorSignature(destination) ?? cppFunctionDeclaratorSignature(container),
|
|
43
|
+
normalizeQualifiedName: (raw) => raw.replaceAll('::', '.'),
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Passing mode from the parameter's OUTERMOST declarator chain only. A deep
|
|
47
|
+
* subtree scan inverted copy vs alias: `void reg(void (*cb)(int& out))` has a
|
|
48
|
+
* `reference_declarator` inside the nested parameter list, but `cb` itself is
|
|
49
|
+
* a by-value pointer copy — classifying it 'reference' made the solver
|
|
50
|
+
* back-propagate formal targets into every caller's argument cell (#2522
|
|
51
|
+
* review, M5). The chain walk never descends into nested parameter lists.
|
|
52
|
+
*/
|
|
53
|
+
function cppOutermostPassingMode(parameter) {
|
|
54
|
+
let sawReference = false;
|
|
55
|
+
let sawPointer = false;
|
|
56
|
+
let node = parameter.childForFieldName('declarator') ?? null;
|
|
57
|
+
const visited = new Set();
|
|
58
|
+
while (node !== null && !visited.has(node.id)) {
|
|
59
|
+
visited.add(node.id);
|
|
60
|
+
if (node.type === 'reference_declarator' || node.type === 'abstract_reference_declarator') {
|
|
61
|
+
// A reference ANYWHERE on the chain aliases the caller's storage —
|
|
62
|
+
// `void (*&cb)(int)` is a reference to pointer, i.e. an alias.
|
|
63
|
+
sawReference = true;
|
|
64
|
+
}
|
|
65
|
+
else if (node.type === 'pointer_declarator' || node.type === 'abstract_pointer_declarator') {
|
|
66
|
+
sawPointer = true;
|
|
67
|
+
}
|
|
68
|
+
const next = node.childForFieldName('declarator');
|
|
69
|
+
if (next !== null) {
|
|
70
|
+
node = next;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (node.type === 'parenthesized_declarator') {
|
|
74
|
+
node =
|
|
75
|
+
node.namedChildren.find((child) => child !== null && child.type.includes('declarator')) ?? null;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
return sawReference ? 'reference' : sawPointer ? 'pointer' : 'value';
|
|
81
|
+
}
|
|
82
|
+
function cppRecoveredMemberPointerParts(node) {
|
|
83
|
+
if (!node.type.includes('parenthesized'))
|
|
84
|
+
return undefined;
|
|
85
|
+
const recovered = node.namedChildren.find((child) => child !== null && child.type === 'ERROR');
|
|
86
|
+
if (recovered === undefined)
|
|
87
|
+
return undefined;
|
|
88
|
+
const operator = recovered.children.find((child) => child !== null && child.text === '->*');
|
|
89
|
+
const sibling = node.namedChildren.find((child) => child !== null && child.id !== recovered.id);
|
|
90
|
+
const errIdentifier = recovered.namedChildren.find((child) => child !== null);
|
|
91
|
+
if (operator === undefined || sibling === undefined || errIdentifier === undefined) {
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
// tree-sitter's error recovery groups `(obj->*ptr)` two ways depending on
|
|
95
|
+
// recovery cost (identifier lengths!): either `[identifier, ERROR "->*m"]`
|
|
96
|
+
// or `[ERROR "obj->*", identifier]`. Disambiguate by token order INSIDE the
|
|
97
|
+
// ERROR: an identifier BEFORE `->*` is the receiver (the sibling is the
|
|
98
|
+
// pointer/member); an identifier AFTER `->*` is the member (the sibling is
|
|
99
|
+
// the receiver). Assuming one fixed grouping swapped the roles and silently
|
|
100
|
+
// dropped the call site (#2522 review, H2).
|
|
101
|
+
if (errIdentifier.startIndex < operator.startIndex) {
|
|
102
|
+
return { receiver: errIdentifier, member: sibling, operator: operator.text };
|
|
103
|
+
}
|
|
104
|
+
return { receiver: sibling, member: errIdentifier, operator: operator.text };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Per-file wall-clock budget for the capture-emit loop (#2432). A worker
|
|
108
|
+
* thread stuck in this loop cannot be terminated safely (terminating a
|
|
109
|
+
* thread mid-N-API call aborts the whole process with Napi::Error), so the
|
|
110
|
+
* loop must bound itself: on breach we return the captures accumulated so
|
|
111
|
+
* far with a warning — degraded coverage for one file, never a crash or a
|
|
112
|
+
* thrown error (a throw here would make the language-group catch drop every
|
|
113
|
+
* remaining file in the batch).
|
|
114
|
+
*
|
|
115
|
+
* `GITNEXUS_CPP_CAPTURE_BUDGET_MS`: unset/invalid/negative → 20000; explicit
|
|
116
|
+
* 0 → expires immediately (deterministic test hook).
|
|
117
|
+
*/
|
|
118
|
+
const CPP_CAPTURE_BUDGET_DEFAULT_MS = 20_000;
|
|
119
|
+
function cppCaptureBudgetMs() {
|
|
120
|
+
const raw = process.env.GITNEXUS_CPP_CAPTURE_BUDGET_MS;
|
|
121
|
+
if (raw === undefined || raw === '')
|
|
122
|
+
return CPP_CAPTURE_BUDGET_DEFAULT_MS;
|
|
123
|
+
const parsed = Number(raw);
|
|
124
|
+
return Number.isFinite(parsed) && parsed >= 0 ? parsed : CPP_CAPTURE_BUDGET_DEFAULT_MS;
|
|
125
|
+
}
|
|
15
126
|
export function emitCppScopeCaptures(sourceText, filePath, cachedTree) {
|
|
16
127
|
let tree = cachedTree;
|
|
17
128
|
if (tree === undefined) {
|
|
@@ -21,10 +132,27 @@ export function emitCppScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
21
132
|
}
|
|
22
133
|
const rawMatches = getCppScopeQuery().matches(tree.rootNode);
|
|
23
134
|
const out = [];
|
|
135
|
+
// #2432: reset the per-file lookup index. The identifier-argument type
|
|
136
|
+
// lookups below used to re-walk the AST per identifier (full-tree DFS in
|
|
137
|
+
// isKnownEnumName, per-scope declaration scans) — O(calls × args × treeSize)
|
|
138
|
+
// per file, 151s on a 194KB file that parses in 46ms. The index makes each
|
|
139
|
+
// lookup O(1) after a single lazily-built pass.
|
|
140
|
+
resetCppFileLookupIndex();
|
|
24
141
|
// Track ranges where typedef-struct/enum was captured as its concrete type
|
|
25
142
|
// so we can suppress the duplicate @declaration.typedef match.
|
|
26
143
|
const concreteTypedefRanges = new Set();
|
|
144
|
+
// #2432: per-file deadline for the loop below (see cppCaptureBudgetMs).
|
|
145
|
+
// Checked every 64 matches — post-index a single iteration is microseconds,
|
|
146
|
+
// so the check granularity costs nothing and bounds the drift past the
|
|
147
|
+
// deadline to well under a second.
|
|
148
|
+
const budgetMs = cppCaptureBudgetMs();
|
|
149
|
+
const deadline = Date.now() + budgetMs;
|
|
150
|
+
let matchIndex = 0;
|
|
27
151
|
for (const m of rawMatches) {
|
|
152
|
+
if ((matchIndex++ & 63) === 0 && Date.now() >= deadline) {
|
|
153
|
+
logger.warn({ filePath, budgetMs, processedMatches: matchIndex - 1, totalMatches: rawMatches.length }, `C++ capture extraction exceeded its ${budgetMs}ms budget for ${filePath}; returning partial captures for this file (#2432).`);
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
28
156
|
const grouped = {};
|
|
29
157
|
// Parallel tag -> captured SyntaxNode map. The tree-sitter query already
|
|
30
158
|
// hands us each matched node as `c.node`, so anchors resolve via a
|
|
@@ -360,8 +488,125 @@ export function emitCppScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
360
488
|
// bases per ISO C++ two-phase lookup.
|
|
361
489
|
detectCppDependentBases(tree.rootNode, filePath);
|
|
362
490
|
captureCppMemberLookupFacts(tree.rootNode, filePath);
|
|
491
|
+
out.push(...synthesizeCallableFlowCaptures(tree.rootNode, CPP_CALLABLE_CAPTURE_OPTIONS));
|
|
363
492
|
return out;
|
|
364
493
|
}
|
|
494
|
+
function cppFunctionDeclaratorSignature(node) {
|
|
495
|
+
const declarator = cppFindDescendantOfType(node, 'function_declarator');
|
|
496
|
+
const parameters = declarator?.childForFieldName('parameters');
|
|
497
|
+
if (parameters === null || parameters === undefined) {
|
|
498
|
+
return recoverCppMemberPointerSignature(node.text);
|
|
499
|
+
}
|
|
500
|
+
const parameterNodes = parameters.namedChildren.filter((child) => child !== null && child.type.includes('parameter_declaration'));
|
|
501
|
+
const hasEllipsis = parameters.children.some((child) => child.type === '...' || (!child.isNamed && child.text === '...')) || parameterNodes.some((parameter) => parameter.type === 'variadic_parameter_declaration');
|
|
502
|
+
const isVoidOnly = parameterNodes.length === 1 &&
|
|
503
|
+
parameterNodes[0].namedChildCount === 1 &&
|
|
504
|
+
parameterNodes[0].firstNamedChild?.text === 'void';
|
|
505
|
+
if (isVoidOnly) {
|
|
506
|
+
return { parameterCount: 0, parameterTypes: [], parameterTypeClasses: [] };
|
|
507
|
+
}
|
|
508
|
+
const parameterTypes = [];
|
|
509
|
+
const parameterTypeClasses = [];
|
|
510
|
+
for (const parameter of parameterNodes) {
|
|
511
|
+
if (parameter.type === 'variadic_parameter_declaration') {
|
|
512
|
+
parameterTypes.push('...');
|
|
513
|
+
parameterTypeClasses.push({
|
|
514
|
+
base: '...',
|
|
515
|
+
cv: 'unknown',
|
|
516
|
+
indirection: 'unknown',
|
|
517
|
+
pointerDepth: 0,
|
|
518
|
+
});
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
const rawType = parameter.childForFieldName('type')?.text ?? 'unknown';
|
|
522
|
+
const declaratorText = parameter.childForFieldName('declarator')?.text;
|
|
523
|
+
parameterTypes.push(normalizeCppParamType(rawType));
|
|
524
|
+
parameterTypeClasses.push(classifyCppParameterType(rawType, declaratorText, parameter.text));
|
|
525
|
+
}
|
|
526
|
+
if (hasEllipsis && !parameterTypes.includes('...')) {
|
|
527
|
+
parameterTypes.push('...');
|
|
528
|
+
parameterTypeClasses.push({
|
|
529
|
+
base: '...',
|
|
530
|
+
cv: 'unknown',
|
|
531
|
+
indirection: 'unknown',
|
|
532
|
+
pointerDepth: 0,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return {
|
|
536
|
+
...(hasEllipsis ? {} : { parameterCount: parameterNodes.length }),
|
|
537
|
+
parameterTypes,
|
|
538
|
+
parameterTypeClasses,
|
|
539
|
+
isConst: /\)\s*const(?:\s|$)/.test(declarator.text),
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* tree-sitter-cpp parses a non-const pointer-to-member variable such as
|
|
544
|
+
* `void (Base::*member)()` as nested call expressions (while the cv-qualified
|
|
545
|
+
* twin is a declaration). Recover the callable shape from the declarator text
|
|
546
|
+
* so `const`/non-`const` overload sets remain distinguishable.
|
|
547
|
+
*/
|
|
548
|
+
function recoverCppMemberPointerSignature(text) {
|
|
549
|
+
const match = text.match(/\(\s*[^()]*::\s*\*\s*[A-Za-z_]\w*\s*\)\s*\(([^()]*)\)\s*(const\b)?/);
|
|
550
|
+
if (match === null)
|
|
551
|
+
return undefined;
|
|
552
|
+
const rawParameters = match[1].trim();
|
|
553
|
+
const parameterCount = rawParameters === '' || rawParameters === 'void'
|
|
554
|
+
? 0
|
|
555
|
+
: splitTopLevelCppParameters(rawParameters).length;
|
|
556
|
+
return { parameterCount, isConst: match[2] !== undefined };
|
|
557
|
+
}
|
|
558
|
+
function splitTopLevelCppParameters(text) {
|
|
559
|
+
const out = [];
|
|
560
|
+
let start = 0;
|
|
561
|
+
let angleDepth = 0;
|
|
562
|
+
let parenDepth = 0;
|
|
563
|
+
let bracketDepth = 0;
|
|
564
|
+
for (let index = 0; index < text.length; index++) {
|
|
565
|
+
switch (text[index]) {
|
|
566
|
+
case '<':
|
|
567
|
+
angleDepth++;
|
|
568
|
+
break;
|
|
569
|
+
case '>':
|
|
570
|
+
angleDepth = Math.max(0, angleDepth - 1);
|
|
571
|
+
break;
|
|
572
|
+
case '(':
|
|
573
|
+
parenDepth++;
|
|
574
|
+
break;
|
|
575
|
+
case ')':
|
|
576
|
+
parenDepth = Math.max(0, parenDepth - 1);
|
|
577
|
+
break;
|
|
578
|
+
case '[':
|
|
579
|
+
bracketDepth++;
|
|
580
|
+
break;
|
|
581
|
+
case ']':
|
|
582
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
583
|
+
break;
|
|
584
|
+
case ',':
|
|
585
|
+
if (angleDepth === 0 && parenDepth === 0 && bracketDepth === 0) {
|
|
586
|
+
out.push(text.slice(start, index).trim());
|
|
587
|
+
start = index + 1;
|
|
588
|
+
}
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
out.push(text.slice(start).trim());
|
|
593
|
+
return out.filter((parameter) => parameter.length > 0);
|
|
594
|
+
}
|
|
595
|
+
function cppContainsNodeType(root, type) {
|
|
596
|
+
return cppFindDescendantOfType(root, type) !== null;
|
|
597
|
+
}
|
|
598
|
+
function cppFindDescendantOfType(root, type) {
|
|
599
|
+
const stack = [root];
|
|
600
|
+
while (stack.length > 0) {
|
|
601
|
+
const node = stack.pop();
|
|
602
|
+
if (node.type === type)
|
|
603
|
+
return node;
|
|
604
|
+
for (const child of node.namedChildren)
|
|
605
|
+
if (child !== null)
|
|
606
|
+
stack.push(child);
|
|
607
|
+
}
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
365
610
|
function extractCppDeclarationReturnType(fnNode) {
|
|
366
611
|
const typeNode = fnNode.childForFieldName('type');
|
|
367
612
|
if (typeNode === null)
|
|
@@ -960,6 +1205,47 @@ function inferCppBracedInitType(node) {
|
|
|
960
1205
|
? `${CPP_BRACED_INIT_TYPE_PREFIX}${first}:${elementTypes.length}`
|
|
961
1206
|
: `${CPP_BRACED_INIT_TYPE_PREFIX}unknown:${elementTypes.length}`;
|
|
962
1207
|
}
|
|
1208
|
+
let fileLookupIndex = {
|
|
1209
|
+
enumNames: null,
|
|
1210
|
+
scopeDecls: new Map(),
|
|
1211
|
+
fnParams: new Map(),
|
|
1212
|
+
};
|
|
1213
|
+
function resetCppFileLookupIndex() {
|
|
1214
|
+
fileLookupIndex = { enumNames: null, scopeDecls: new Map(), fnParams: new Map() };
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* First-declaration-wins map of the scope's `declaration` children that
|
|
1218
|
+
* carry a concrete (non-placeholder) type and a nameable declarator —
|
|
1219
|
+
* exactly the entries the replaced per-identifier scans could match.
|
|
1220
|
+
*/
|
|
1221
|
+
function scopeDeclarationsFor(scope) {
|
|
1222
|
+
const cached = fileLookupIndex.scopeDecls.get(scope.id);
|
|
1223
|
+
if (cached !== undefined)
|
|
1224
|
+
return cached;
|
|
1225
|
+
const decls = new Map();
|
|
1226
|
+
for (let i = 0; i < scope.childCount; i++) {
|
|
1227
|
+
const stmt = scope.child(i);
|
|
1228
|
+
if (stmt === null || stmt.type !== 'declaration')
|
|
1229
|
+
continue;
|
|
1230
|
+
const typeNode = stmt.childForFieldName('type');
|
|
1231
|
+
if (typeNode === null)
|
|
1232
|
+
continue;
|
|
1233
|
+
if (typeNode.type === 'placeholder_type_specifier')
|
|
1234
|
+
continue;
|
|
1235
|
+
const declarator = stmt.childForFieldName('declarator');
|
|
1236
|
+
if (declarator === null)
|
|
1237
|
+
continue;
|
|
1238
|
+
const nameChild = declaredNameNode(declarator);
|
|
1239
|
+
if (nameChild === null)
|
|
1240
|
+
continue;
|
|
1241
|
+
const name = extractDeclaratorLeafName(nameChild);
|
|
1242
|
+
if (name === '' || decls.has(name))
|
|
1243
|
+
continue;
|
|
1244
|
+
decls.set(name, stmt);
|
|
1245
|
+
}
|
|
1246
|
+
fileLookupIndex.scopeDecls.set(scope.id, decls);
|
|
1247
|
+
return decls;
|
|
1248
|
+
}
|
|
963
1249
|
/**
|
|
964
1250
|
* Look up the declared type of a variable by scanning sibling declarations
|
|
965
1251
|
* in the enclosing compound_statement (function body). Handles:
|
|
@@ -991,27 +1277,14 @@ function lookupDeclaredTypeForIdentifier(identNode) {
|
|
|
991
1277
|
const paramType = lookupFunctionParameterType(scope, varName);
|
|
992
1278
|
if (paramType !== '')
|
|
993
1279
|
return paramType;
|
|
994
|
-
//
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
// Skip auto/placeholder types — those need chain-follow, not literal
|
|
1003
|
-
if (typeNode.type === 'placeholder_type_specifier')
|
|
1004
|
-
continue;
|
|
1005
|
-
// Check init_declarator children for the variable name
|
|
1006
|
-
const declarator = stmt.childForFieldName('declarator');
|
|
1007
|
-
if (declarator === null)
|
|
1008
|
-
continue;
|
|
1009
|
-
const nameChild = declaredNameNode(declarator);
|
|
1010
|
-
if (nameChild !== null && extractDeclaratorLeafName(nameChild) === varName) {
|
|
1011
|
-
return normalizeCppTypeText(typeNode.text);
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
return '';
|
|
1280
|
+
// Indexed scope-declaration lookup (#2432; was a per-identifier scan).
|
|
1281
|
+
const stmt = scopeDeclarationsFor(scope).get(varName);
|
|
1282
|
+
if (stmt === undefined)
|
|
1283
|
+
return '';
|
|
1284
|
+
const typeNode = stmt.childForFieldName('type');
|
|
1285
|
+
if (typeNode === null)
|
|
1286
|
+
return '';
|
|
1287
|
+
return normalizeCppTypeText(typeNode.text);
|
|
1015
1288
|
}
|
|
1016
1289
|
function lookupDeclaredTypeClassForIdentifier(identNode) {
|
|
1017
1290
|
const varName = identNode.text;
|
|
@@ -1026,28 +1299,20 @@ function lookupDeclaredTypeClassForIdentifier(identNode) {
|
|
|
1026
1299
|
const paramTypeClass = lookupFunctionParameterTypeClass(scope, varName, identNode);
|
|
1027
1300
|
if (paramTypeClass !== undefined)
|
|
1028
1301
|
return paramTypeClass;
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
const nameChild = declaredNameNode(declarator);
|
|
1042
|
-
if (nameChild === null || extractDeclaratorLeafName(nameChild) !== varName)
|
|
1043
|
-
continue;
|
|
1044
|
-
const typeClass = classifyCppParameterType(typeNode.text, nameChild.text, stmt.text.replace(/;\s*$/, ''));
|
|
1045
|
-
if (isKnownEnumName(identNode, typeClass.base)) {
|
|
1046
|
-
return { ...typeClass, base: `enum:${typeClass.base}` };
|
|
1047
|
-
}
|
|
1048
|
-
return typeClass;
|
|
1302
|
+
// Indexed scope-declaration lookup (#2432; was a per-identifier scan).
|
|
1303
|
+
const stmt = scopeDeclarationsFor(scope).get(varName);
|
|
1304
|
+
if (stmt === undefined)
|
|
1305
|
+
return unknownTypeClass('unknown');
|
|
1306
|
+
const typeNode = stmt.childForFieldName('type');
|
|
1307
|
+
const declarator = stmt.childForFieldName('declarator');
|
|
1308
|
+
const nameChild = declarator !== null ? declaredNameNode(declarator) : null;
|
|
1309
|
+
if (typeNode === null || nameChild === null)
|
|
1310
|
+
return unknownTypeClass('unknown');
|
|
1311
|
+
const typeClass = classifyCppParameterType(typeNode.text, nameChild.text, stmt.text.replace(/;\s*$/, ''));
|
|
1312
|
+
if (isKnownEnumName(identNode, typeClass.base)) {
|
|
1313
|
+
return { ...typeClass, base: `enum:${typeClass.base}` };
|
|
1049
1314
|
}
|
|
1050
|
-
return
|
|
1315
|
+
return typeClass;
|
|
1051
1316
|
}
|
|
1052
1317
|
function lookupFunctionParameterType(scope, varName) {
|
|
1053
1318
|
const param = findEnclosingFunctionParameter(scope, varName);
|
|
@@ -1078,27 +1343,45 @@ function findEnclosingFunctionParameter(scope, varName) {
|
|
|
1078
1343
|
let node = scope.parent;
|
|
1079
1344
|
while (node !== null) {
|
|
1080
1345
|
if (node.type === 'function_definition' || node.type === 'function_declarator') {
|
|
1081
|
-
|
|
1082
|
-
? node
|
|
1083
|
-
: findFirstDescendantOfType(node, 'function_declarator');
|
|
1084
|
-
const params = fnDecl?.childForFieldName('parameters') ?? null;
|
|
1085
|
-
if (params !== null) {
|
|
1086
|
-
for (let i = 0; i < params.namedChildCount; i++) {
|
|
1087
|
-
const param = params.namedChild(i);
|
|
1088
|
-
if (param === null || param.type !== 'parameter_declaration')
|
|
1089
|
-
continue;
|
|
1090
|
-
const declarator = param.childForFieldName('declarator');
|
|
1091
|
-
if (declarator !== null && extractDeclaratorLeafName(declarator) === varName) {
|
|
1092
|
-
return param;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
return null;
|
|
1346
|
+
return enclosingFunctionParametersFor(node)?.get(varName) ?? null;
|
|
1097
1347
|
}
|
|
1098
1348
|
node = node.parent;
|
|
1099
1349
|
}
|
|
1100
1350
|
return null;
|
|
1101
1351
|
}
|
|
1352
|
+
/**
|
|
1353
|
+
* First-wins map of a function's `parameter_declaration`s by declarator
|
|
1354
|
+
* leaf name (#2432; was a per-identifier scan). `null` when the function
|
|
1355
|
+
* has no parameter list — the caller returns null without walking further
|
|
1356
|
+
* up, preserving the replaced scan's early-return.
|
|
1357
|
+
*/
|
|
1358
|
+
function enclosingFunctionParametersFor(fnNode) {
|
|
1359
|
+
const cached = fileLookupIndex.fnParams.get(fnNode.id);
|
|
1360
|
+
if (cached !== undefined)
|
|
1361
|
+
return cached;
|
|
1362
|
+
const fnDecl = fnNode.type === 'function_declarator'
|
|
1363
|
+
? fnNode
|
|
1364
|
+
: findFirstDescendantOfType(fnNode, 'function_declarator');
|
|
1365
|
+
const params = fnDecl?.childForFieldName('parameters') ?? null;
|
|
1366
|
+
let index = null;
|
|
1367
|
+
if (params !== null) {
|
|
1368
|
+
index = new Map();
|
|
1369
|
+
for (let i = 0; i < params.namedChildCount; i++) {
|
|
1370
|
+
const param = params.namedChild(i);
|
|
1371
|
+
if (param === null || param.type !== 'parameter_declaration')
|
|
1372
|
+
continue;
|
|
1373
|
+
const declarator = param.childForFieldName('declarator');
|
|
1374
|
+
if (declarator === null)
|
|
1375
|
+
continue;
|
|
1376
|
+
const name = extractDeclaratorLeafName(declarator);
|
|
1377
|
+
if (name === '' || index.has(name))
|
|
1378
|
+
continue;
|
|
1379
|
+
index.set(name, param);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
fileLookupIndex.fnParams.set(fnNode.id, index);
|
|
1383
|
+
return index;
|
|
1384
|
+
}
|
|
1102
1385
|
function declaredNameNode(declarator) {
|
|
1103
1386
|
if (declarator.type !== 'init_declarator')
|
|
1104
1387
|
return declarator;
|
|
@@ -1126,24 +1409,31 @@ function normalizeCppTypeText(text) {
|
|
|
1126
1409
|
function isKnownEnumName(node, typeName) {
|
|
1127
1410
|
if (typeName === '' || typeName === 'unknown')
|
|
1128
1411
|
return false;
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1412
|
+
// One full-tree DFS per FILE (lazy), not per identifier argument — the
|
|
1413
|
+
// per-identifier walk here was the dominant cost of #2432 (87s of a 151s
|
|
1414
|
+
// extraction on a file that parses in 46ms).
|
|
1415
|
+
if (fileLookupIndex.enumNames === null) {
|
|
1416
|
+
let root = node;
|
|
1417
|
+
while (root.parent !== null)
|
|
1418
|
+
root = root.parent;
|
|
1419
|
+
const names = new Set();
|
|
1420
|
+
const stack = [root];
|
|
1421
|
+
while (stack.length > 0) {
|
|
1422
|
+
const cur = stack.pop();
|
|
1423
|
+
if (cur.type === 'enum_specifier') {
|
|
1424
|
+
const name = cur.childForFieldName('name');
|
|
1425
|
+
if (name !== null)
|
|
1426
|
+
names.add(name.text);
|
|
1427
|
+
}
|
|
1428
|
+
for (let i = 0; i < cur.childCount; i++) {
|
|
1429
|
+
const child = cur.child(i);
|
|
1430
|
+
if (child !== null)
|
|
1431
|
+
stack.push(child);
|
|
1432
|
+
}
|
|
1144
1433
|
}
|
|
1434
|
+
fileLookupIndex.enumNames = names;
|
|
1145
1435
|
}
|
|
1146
|
-
return
|
|
1436
|
+
return fileLookupIndex.enumNames.has(typeName);
|
|
1147
1437
|
}
|
|
1148
1438
|
/**
|
|
1149
1439
|
* Detect whether a `namespace_definition` AST node is inline.
|
|
@@ -238,6 +238,20 @@ export const cppScopeResolver = {
|
|
|
238
238
|
return true;
|
|
239
239
|
return false;
|
|
240
240
|
},
|
|
241
|
+
// Keep declaration/definition identity narrower than the global free-call
|
|
242
|
+
// visibility gate above: namespace and class ownership do not imply
|
|
243
|
+
// internal linkage, while a namespace-scope `static` function does.
|
|
244
|
+
hasFileLocalCallableLinkage: (def) => {
|
|
245
|
+
// Class members have EXTERNAL linkage even when declared `static` —
|
|
246
|
+
// inside a class, `static` means "no instance", not internal linkage.
|
|
247
|
+
// The name-keyed set below is populated from every `static` declaration,
|
|
248
|
+
// so without this gate a header-declared static member refused its
|
|
249
|
+
// cross-file definition join (#2522 review, M2).
|
|
250
|
+
if (def.type === 'Method' || def.type === 'Constructor')
|
|
251
|
+
return false;
|
|
252
|
+
const simple = def.qualifiedName?.split('.').pop() ?? def.qualifiedName ?? '';
|
|
253
|
+
return isFileLocal(def.filePath, simple);
|
|
254
|
+
},
|
|
241
255
|
// C++ two-phase template lookup: inside a class template body,
|
|
242
256
|
// unqualified calls MUST NOT bind to members of a dependent base
|
|
243
257
|
// class. The standard requires `this->name()` or `Base<T>::name()`
|
|
@@ -23,6 +23,7 @@ import { getCsharpParser, getCsharpScopeQuery } from './query.js';
|
|
|
23
23
|
import { recordCacheHit, recordCacheMiss } from './cache-stats.js';
|
|
24
24
|
import { getTreeSitterBufferSize } from '../../constants.js';
|
|
25
25
|
import { parseSourceSafe } from '../../../tree-sitter/safe-parse.js';
|
|
26
|
+
import { synthesizeCallableFlowCaptures } from '../../utils/callable-flow-captures.js';
|
|
26
27
|
/** Declaration anchors that carry function-like arity metadata. */
|
|
27
28
|
const FUNCTION_DECL_TAGS = [
|
|
28
29
|
'@declaration.method',
|
|
@@ -38,6 +39,29 @@ const FUNCTION_NODE_TYPES = [
|
|
|
38
39
|
'conversion_operator_declaration',
|
|
39
40
|
'local_function_statement',
|
|
40
41
|
];
|
|
42
|
+
const CSHARP_CALLABLE_CAPTURE_OPTIONS = {
|
|
43
|
+
functionNodeTypes: new Set([
|
|
44
|
+
...FUNCTION_NODE_TYPES,
|
|
45
|
+
'lambda_expression',
|
|
46
|
+
'anonymous_method_expression',
|
|
47
|
+
]),
|
|
48
|
+
callNodeTypes: new Set(['invocation_expression']),
|
|
49
|
+
parameterListNodeTypes: new Set(['parameter_list', 'argument_list']),
|
|
50
|
+
parameterNodeTypes: new Set(['parameter']),
|
|
51
|
+
bindingNodeTypes: new Set(['variable_declarator']),
|
|
52
|
+
assignmentNodeTypes: new Set(['assignment_expression']),
|
|
53
|
+
identifierNodeTypes: new Set(['identifier', 'generic_name']),
|
|
54
|
+
callableProtocolMethods: new Set(['Invoke']),
|
|
55
|
+
extractAssignment: (node) => {
|
|
56
|
+
if (node.type !== 'variable_declarator')
|
|
57
|
+
return undefined;
|
|
58
|
+
const destination = node.childForFieldName('name');
|
|
59
|
+
const source = node.lastNamedChild;
|
|
60
|
+
if (destination === null || source === null || source.id === destination.id)
|
|
61
|
+
return undefined;
|
|
62
|
+
return { destination, source };
|
|
63
|
+
},
|
|
64
|
+
};
|
|
41
65
|
const BUILTIN_TYPE_NAMES = new Set([
|
|
42
66
|
'bool',
|
|
43
67
|
'byte',
|
|
@@ -228,6 +252,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
228
252
|
out.push(...synthesizeGenericTypeArgumentReferences(tree.rootNode));
|
|
229
253
|
out.push(...synthesizeCsharpInheritanceReferences(tree.rootNode));
|
|
230
254
|
out.push(...synthesizeCsharpConstructorInitializerReferences(tree.rootNode));
|
|
255
|
+
out.push(...synthesizeCallableFlowCaptures(tree.rootNode, CSHARP_CALLABLE_CAPTURE_OPTIONS));
|
|
231
256
|
return out;
|
|
232
257
|
}
|
|
233
258
|
/**
|