gitnexus 1.6.11-rc.8 → 1.6.11
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 +95 -26
- package/dist/_shared/graph/types.d.ts +81 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.d.ts.map +1 -1
- package/dist/_shared/integrations/circuit-breaker.js.map +1 -1
- package/dist/_shared/integrations/resilient-fetch.d.ts.map +1 -1
- 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 -1
- package/dist/_shared/languages.d.ts.map +1 -1
- package/dist/_shared/languages.js +1 -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 +4 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -1
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/finalize-algorithm.js +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.d.ts +3 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/language-classification.js +4 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +10 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +15 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +4 -0
- package/dist/cli/ai-context.js +90 -14
- package/dist/cli/analyze-config.js +14 -0
- package/dist/cli/analyze-options.d.ts +14 -0
- package/dist/cli/analyze-watch.d.ts +20 -0
- package/dist/cli/analyze-watch.js +434 -0
- package/dist/cli/analyze.js +27 -9
- package/dist/cli/auto-sync.d.ts +1 -0
- package/dist/cli/auto-sync.js +107 -0
- package/dist/cli/command-banner.d.ts +15 -0
- package/dist/cli/command-banner.js +42 -0
- package/dist/cli/detect-changes-format.js +21 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.js +14 -0
- package/dist/cli/group.js +7 -1
- package/dist/cli/help-i18n.js +4 -0
- package/dist/cli/i18n/en.d.ts +18 -3
- package/dist/cli/i18n/en.js +18 -3
- package/dist/cli/i18n/resources.d.ts +33 -3
- package/dist/cli/i18n/zh-CN.d.ts +15 -0
- package/dist/cli/i18n/zh-CN.js +18 -3
- package/dist/cli/index.js +34 -7
- package/dist/cli/mcp.d.ts +15 -0
- package/dist/cli/mcp.js +44 -0
- package/dist/cli/optional-grammars.d.ts +3 -2
- package/dist/cli/optional-grammars.js +19 -3
- package/dist/cli/setup.js +41 -15
- package/dist/cli/update-notice.d.ts +34 -0
- package/dist/cli/update-notice.js +91 -0
- package/dist/cli/update.d.ts +21 -0
- package/dist/cli/update.js +93 -0
- package/dist/cli/watch.d.ts +1 -20
- package/dist/cli/watch.js +5 -371
- package/dist/core/analysis-feature-registry.d.ts +2 -0
- package/dist/core/analysis-feature-registry.js +15 -0
- package/dist/core/analyzer-identity.js +21 -3
- package/dist/core/auto-sync/analysis-worker-launch.d.ts +30 -0
- package/dist/core/auto-sync/analysis-worker-launch.js +166 -0
- package/dist/core/auto-sync/config.d.ts +33 -0
- package/dist/core/auto-sync/config.js +320 -0
- package/dist/core/auto-sync/index.d.ts +6 -0
- package/dist/core/auto-sync/index.js +6 -0
- package/dist/core/auto-sync/path-security.d.ts +9 -0
- package/dist/core/auto-sync/path-security.js +251 -0
- package/dist/core/auto-sync/repo.d.ts +1 -0
- package/dist/core/auto-sync/repo.js +6 -0
- package/dist/core/auto-sync/runner.d.ts +44 -0
- package/dist/core/auto-sync/runner.js +428 -0
- package/dist/core/auto-sync/starter.d.ts +50 -0
- package/dist/core/auto-sync/starter.js +497 -0
- package/dist/core/auto-sync/state.d.ts +37 -0
- package/dist/core/auto-sync/state.js +119 -0
- package/dist/core/group/config-parser.js +8 -1
- package/dist/core/group/cross-impact.d.ts +3 -0
- package/dist/core/group/cross-impact.js +36 -4
- package/dist/core/group/extractors/http-patterns/java.js +22 -8
- package/dist/core/group/extractors/http-patterns/kotlin.js +86 -31
- package/dist/core/group/extractors/http-patterns/node.js +145 -8
- package/dist/core/group/extractors/http-patterns/python.js +11 -7
- package/dist/core/group/extractors/http-route-extractor.js +63 -17
- package/dist/core/group/extractors/java-workspace-extractor.js +244 -31
- package/dist/core/group/group-lock.js +5 -6
- package/dist/core/group/normalization.d.ts +38 -1
- package/dist/core/group/normalization.js +59 -3
- package/dist/core/group/service.d.ts +11 -0
- package/dist/core/group/service.js +13 -1
- package/dist/core/group/storage.js +2 -2
- package/dist/core/group/sync.d.ts +24 -1
- package/dist/core/group/sync.js +46 -8
- package/dist/core/group/types.d.ts +13 -0
- package/dist/core/incremental/derived-writeback.d.ts +36 -0
- package/dist/core/incremental/derived-writeback.js +68 -0
- package/dist/core/incremental/spring-config-drift.d.ts +12 -0
- package/dist/core/incremental/spring-config-drift.js +46 -0
- package/dist/core/incremental/subgraph-extract.d.ts +7 -4
- package/dist/core/incremental/subgraph-extract.js +30 -5
- package/dist/core/ingestion/asyncapi/document.d.ts +226 -0
- package/dist/core/ingestion/asyncapi/document.js +758 -0
- package/dist/core/ingestion/asyncapi/protocol.d.ts +79 -0
- package/dist/core/ingestion/asyncapi/protocol.js +203 -0
- package/dist/core/ingestion/call-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/zig.js +4 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.d.ts +100 -0
- package/dist/core/ingestion/call-extractors/zig-static-gating.js +319 -0
- package/dist/core/ingestion/call-processor.js +3 -1
- package/dist/core/ingestion/class-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/zig.js +32 -0
- package/dist/core/ingestion/class-extractors/generic.js +4 -1
- package/dist/core/ingestion/class-types.d.ts +6 -2
- package/dist/core/ingestion/destination-key.d.ts +59 -0
- package/dist/core/ingestion/destination-key.js +61 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +6 -2
- package/dist/core/ingestion/entry-point-scoring.js +8 -44
- package/dist/core/ingestion/export-detection.d.ts +37 -0
- package/dist/core/ingestion/export-detection.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/zig.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/zig.js +49 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +1 -1
- package/dist/core/ingestion/field-extractors/generic.js +12 -1
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.d.ts +26 -0
- package/dist/core/ingestion/frameworks/spring/actuator-runtime.js +843 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.d.ts +5 -0
- package/dist/core/ingestion/frameworks/spring/analysis-features.js +9 -0
- package/dist/core/ingestion/frameworks/spring/annotation-arguments.js +8 -1
- package/dist/core/ingestion/frameworks/spring/argument-facts.d.ts +80 -0
- package/dist/core/ingestion/frameworks/spring/argument-facts.js +85 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.d.ts +1 -0
- package/dist/core/ingestion/frameworks/spring/config-bindings.js +2 -1
- package/dist/core/ingestion/frameworks/spring/destinations.d.ts +539 -0
- package/dist/core/ingestion/frameworks/spring/destinations.js +840 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.d.ts +22 -0
- package/dist/core/ingestion/frameworks/spring/dynamic-lookups.js +124 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.d.ts +78 -0
- package/dist/core/ingestion/frameworks/spring/message-producers.js +90 -0
- package/dist/core/ingestion/frameworks/spring/non-http-handlers.d.ts +29 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.d.ts +7 -0
- package/dist/core/ingestion/frameworks/spring/vendor-prefixes.js +22 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/zig.js +26 -0
- package/dist/core/ingestion/import-resolvers/zig.d.ts +34 -0
- package/dist/core/ingestion/import-resolvers/zig.js +193 -0
- package/dist/core/ingestion/language-config.d.ts +177 -0
- package/dist/core/ingestion/language-config.js +719 -0
- package/dist/core/ingestion/language-provider.d.ts +178 -1
- package/dist/core/ingestion/language-provider.js +22 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.d.ts +62 -0
- package/dist/core/ingestion/languages/csharp/razor-view-components.js +954 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.d.ts +3 -0
- package/dist/core/ingestion/languages/csharp/resolution-config.js +6 -1
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -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 +1 -1
- package/dist/core/ingestion/languages/java/analysis-features.js +14 -6
- package/dist/core/ingestion/languages/java/capture-side-channel.d.ts +8 -0
- package/dist/core/ingestion/languages/java/capture-side-channel.js +34 -0
- package/dist/core/ingestion/languages/java/captures.js +22 -1
- package/dist/core/ingestion/languages/java/lombok-synthesizer.d.ts +42 -0
- package/dist/core/ingestion/languages/java/lombok-synthesizer.js +439 -0
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.d.ts +2 -0
- package/dist/core/ingestion/languages/java/spring-actuator.js +62 -0
- package/dist/core/ingestion/languages/java/spring-di.d.ts +17 -1
- package/dist/core/ingestion/languages/java/spring-di.js +44 -2
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/java/spring-dynamic-lookup.js +62 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.d.ts +20 -0
- package/dist/core/ingestion/languages/java/spring-message-producers.js +83 -0
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.d.ts +11 -1
- package/dist/core/ingestion/languages/java/spring-non-http-handlers.js +13 -3
- package/dist/core/ingestion/languages/java.js +18 -8
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.d.ts +99 -0
- package/dist/core/ingestion/languages/jvm/accessor-synthesis.js +173 -0
- package/dist/core/ingestion/languages/jvm/beanspec.d.ts +17 -0
- package/dist/core/ingestion/languages/jvm/beanspec.js +42 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +15 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +50 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +24 -1
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.d.ts +26 -0
- package/dist/core/ingestion/languages/kotlin/lombok-synthesizer.js +417 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.d.ts +4 -0
- package/dist/core/ingestion/languages/kotlin/spring-actuator.js +172 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.d.ts +18 -0
- package/dist/core/ingestion/languages/kotlin/spring-config-bindings.js +411 -0
- package/dist/core/ingestion/languages/kotlin/spring-di.d.ts +51 -1
- package/dist/core/ingestion/languages/kotlin/spring-di.js +86 -6
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.d.ts +8 -0
- package/dist/core/ingestion/languages/kotlin/spring-dynamic-lookup.js +77 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.d.ts +17 -0
- package/dist/core/ingestion/languages/kotlin/spring-message-producers.js +119 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.d.ts +16 -0
- package/dist/core/ingestion/languages/kotlin/spring-non-http-handlers.js +77 -2
- package/dist/core/ingestion/languages/kotlin.js +24 -0
- package/dist/core/ingestion/languages/python.js +2 -0
- package/dist/core/ingestion/languages/rust/query.js +8 -8
- package/dist/core/ingestion/languages/zig/captures.d.ts +260 -0
- package/dist/core/ingestion/languages/zig/captures.js +2070 -0
- package/dist/core/ingestion/languages/zig/index.d.ts +4 -0
- package/dist/core/ingestion/languages/zig/index.js +4 -0
- package/dist/core/ingestion/languages/zig/interpret.d.ts +36 -0
- package/dist/core/ingestion/languages/zig/interpret.js +176 -0
- package/dist/core/ingestion/languages/zig/query.d.ts +3 -0
- package/dist/core/ingestion/languages/zig/query.js +426 -0
- package/dist/core/ingestion/languages/zig/range-binding.d.ts +37 -0
- package/dist/core/ingestion/languages/zig/range-binding.js +373 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.d.ts +12 -0
- package/dist/core/ingestion/languages/zig/scope-resolver.js +58 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.d.ts +25 -0
- package/dist/core/ingestion/languages/zig/simple-hooks.js +143 -0
- package/dist/core/ingestion/languages/zig.d.ts +32 -0
- package/dist/core/ingestion/languages/zig.js +130 -0
- package/dist/core/ingestion/method-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/zig.js +120 -0
- package/dist/core/ingestion/method-extractors/generic.js +16 -4
- package/dist/core/ingestion/method-types.d.ts +10 -4
- package/dist/core/ingestion/model/field-registry.d.ts +3 -3
- package/dist/core/ingestion/model/field-registry.js +11 -7
- package/dist/core/ingestion/model/method-registry.d.ts +3 -3
- package/dist/core/ingestion/model/method-registry.js +13 -8
- package/dist/core/ingestion/model/registration-table.js +3 -0
- package/dist/core/ingestion/model/type-registry.js +8 -4
- package/dist/core/ingestion/pipeline-phases/di.js +47 -14
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +7 -1
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +79 -91
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +2 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +39 -4
- package/dist/core/ingestion/pipeline-phases/routes.js +27 -18
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +4 -1
- package/dist/core/ingestion/pipeline-phases/runner.js +34 -14
- package/dist/core/ingestion/pipeline-phases/scan.js +82 -1
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.d.ts +2 -0
- package/dist/core/ingestion/pipeline-phases/spring-auto-configuration.js +8 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.d.ts +123 -0
- package/dist/core/ingestion/pipeline-phases/spring-destinations.js +688 -0
- package/dist/core/ingestion/pipeline.d.ts +30 -1
- package/dist/core/ingestion/pipeline.js +52 -14
- package/dist/core/ingestion/resolve-references.js +5 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.d.ts +16 -0
- package/dist/core/ingestion/route-extractors/constant-resolver.js +10 -0
- package/dist/core/ingestion/route-extractors/java-const-resolver.d.ts +27 -1
- package/dist/core/ingestion/route-extractors/java-const-resolver.js +161 -13
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.d.ts +12 -18
- package/dist/core/ingestion/route-extractors/kotlin-const-resolver.js +214 -33
- package/dist/core/ingestion/route-extractors/kotlin-spring.d.ts +13 -0
- package/dist/core/ingestion/route-extractors/kotlin-spring.js +259 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.d.ts +6 -0
- package/dist/core/ingestion/route-extractors/python-decorator-handler.js +16 -0
- package/dist/core/ingestion/route-extractors/spring-shared.d.ts +30 -1
- package/dist/core/ingestion/route-extractors/spring-shared.js +77 -9
- package/dist/core/ingestion/route-extractors/spring.js +9 -5
- package/dist/core/ingestion/scope-extractor.js +8 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +62 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +4 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +2 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +28 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +11 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +23 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +24 -3
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.d.ts +11 -1
- package/dist/core/ingestion/scope-resolution/passes/callable-value-flow.js +26 -6
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +11 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +29 -3
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +8 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +35 -9
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +1 -4
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +277 -9
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +2 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +7 -3
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +43 -9
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +71 -10
- package/dist/core/ingestion/tree-sitter-queries.d.ts +1 -0
- package/dist/core/ingestion/tree-sitter-queries.js +161 -0
- package/dist/core/ingestion/type-extractors/zig.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/zig.js +17 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +40 -1
- package/dist/core/ingestion/utils/ast-helpers.js +124 -6
- package/dist/core/ingestion/utils/callable-flow-captures.d.ts +9 -0
- package/dist/core/ingestion/utils/callable-flow-captures.js +75 -14
- package/dist/core/ingestion/utils/test-file-path.d.ts +28 -0
- package/dist/core/ingestion/utils/test-file-path.js +87 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/zig.js +71 -0
- package/dist/core/ingestion/workers/parse-worker.js +85 -14
- package/dist/core/install-context.d.ts +4 -0
- package/dist/core/install-context.js +152 -0
- package/dist/core/lbug/csv-generator.d.ts +10 -1
- package/dist/core/lbug/csv-generator.js +92 -22
- package/dist/core/lbug/graph-emit-sink.d.ts +3 -2
- package/dist/core/lbug/graph-emit-sink.js +4 -2
- package/dist/core/lbug/lbug-adapter.d.ts +100 -5
- package/dist/core/lbug/lbug-adapter.js +236 -24
- package/dist/core/lbug/schema.d.ts +6 -5
- package/dist/core/lbug/schema.js +84 -22
- package/dist/core/net/url-guard.d.ts +6 -0
- package/dist/core/net/url-guard.js +147 -0
- package/dist/core/package-version.d.ts +5 -0
- package/dist/core/package-version.js +10 -0
- package/dist/core/run-analyze.d.ts +21 -4
- package/dist/core/run-analyze.js +426 -117
- package/dist/core/search/fts-indexes.d.ts +19 -1
- package/dist/core/search/fts-indexes.js +28 -1
- package/dist/core/tree-sitter/parser-loader.js +16 -0
- package/dist/core/update-cache.d.ts +39 -0
- package/dist/core/update-cache.js +141 -0
- package/dist/core/update-check.d.ts +31 -0
- package/dist/core/update-check.js +274 -0
- package/dist/mcp/local/local-backend.d.ts +27 -13
- package/dist/mcp/local/local-backend.js +148 -60
- package/dist/mcp/repository-policy.d.ts +5 -1
- package/dist/mcp/repository-policy.js +48 -4
- package/dist/mcp/resources.js +10 -1
- package/dist/mcp/server.js +8 -9
- package/dist/mcp/tools.js +32 -22
- package/dist/server/analyze-launch.d.ts +2 -0
- package/dist/server/analyze-launch.js +2 -0
- package/dist/server/analyze-worker-protocol.d.ts +6 -1
- package/dist/server/analyze-worker.d.ts +1 -0
- package/dist/server/analyze-worker.js +38 -20
- package/dist/server/api.d.ts +5 -1
- package/dist/server/api.js +105 -88
- package/dist/server/git-clone.d.ts +40 -16
- package/dist/server/git-clone.js +253 -199
- package/dist/server/grep-params.d.ts +18 -0
- package/dist/server/grep-params.js +83 -0
- package/dist/server/grep-scan.d.ts +23 -0
- package/dist/server/grep-scan.js +107 -0
- package/dist/server/grep-worker.d.ts +1 -0
- package/dist/server/grep-worker.js +12 -0
- package/dist/server/mcp-http.d.ts +8 -0
- package/dist/server/mcp-http.js +16 -1
- package/dist/server/update-controller.d.ts +29 -0
- package/dist/server/update-controller.js +82 -0
- package/dist/storage/file-lock.d.ts +15 -0
- package/dist/storage/file-lock.js +155 -0
- package/dist/storage/fs-atomic.d.ts +24 -0
- package/dist/storage/fs-atomic.js +86 -2
- package/dist/storage/global-dir.d.ts +2 -0
- package/dist/storage/global-dir.js +6 -0
- package/dist/storage/parse-cache.d.ts +45 -7
- package/dist/storage/parse-cache.js +189 -42
- package/dist/storage/parsedfile-store.d.ts +41 -60
- package/dist/storage/parsedfile-store.js +247 -171
- package/dist/storage/repo-manager.d.ts +10 -4
- package/dist/storage/repo-manager.js +35 -25
- package/dist/storage/repo-meta.d.ts +34 -0
- package/dist/storage/v8-sidecar.d.ts +48 -0
- package/dist/storage/v8-sidecar.js +347 -0
- package/dist/types/pipeline.d.ts +14 -0
- package/dist/utils/process-identity.d.ts +2 -0
- package/dist/utils/process-identity.js +35 -0
- package/package.json +10 -4
- package/scripts/assert-web-assets.mjs +35 -0
- package/scripts/build-web.js +72 -0
- package/scripts/build.js +31 -28
- package/scripts/cross-platform-tests.ts +5 -0
- package/skills/gitnexus-cli.md +5 -1
- package/web/assets/ProcessFlowModal-DAeX2BHW.js +24 -0
- package/web/assets/{abnfDiagram-QNN2D4NM-Cq2djWWe.js → abnfDiagram-PAR5IXJI-J3OdeHLl.js} +1 -1
- package/web/assets/{agent-BWAXPjC5.js → agent-BMRqXorA.js} +6 -4
- package/web/assets/architecture-7GRP2DOG-M7G3SWCO-G3sWyX6M.js +1 -0
- package/web/assets/architectureDiagram-2PNWDENW-ysKcRlGT.js +36 -0
- package/web/assets/blockDiagram-PUWGUBOA-oLXTa1lY.js +129 -0
- package/web/assets/c4Diagram-3NLNHZP5-D3iu4eC0.js +38 -0
- package/web/assets/{chunk-2SREHG4O-Dip42xOq.js → chunk-2NMSUPJH-B24w-wng.js} +1 -1
- package/web/assets/{chunk-VJFVEZTB-CX66F2ep.js → chunk-32MCUW2P-ByUyt0Sa.js} +3 -3
- package/web/assets/{chunk-4RFN2BYJ-DHHWuC-n.js → chunk-3NPNU5GP-DocZ07Sg.js} +1 -1
- package/web/assets/{chunk-XNMVGMAZ-Cg_LnPtj.js → chunk-3SMGFRGC-CAu4JRLv.js} +1 -1
- package/web/assets/{chunk-W44A43WB-BN8EQc_u.js → chunk-4CAJECRU-DRYMwG9z.js} +1 -1
- package/web/assets/chunk-4OADUZ5Q-CxrSvOwZ.js +10 -0
- package/web/assets/{chunk-DMV4VAQV-Bn6WXDSX.js → chunk-5IQCK5RY-CCMhl4so.js} +2 -2
- package/web/assets/{chunk-RRFMTAIC-CMN0wcYA.js → chunk-5MVFYWFU-Db9KvrYO.js} +1 -1
- package/web/assets/chunk-CLS4B6BI-Uvx5QNsu.js +168 -0
- package/web/assets/chunk-DZP67EKU-B3Mt380j.js +70 -0
- package/web/assets/{chunk-6L755F7B-CMhLBxi2.js → chunk-EICP7K5X-CqwE9hui.js} +1 -1
- package/web/assets/{chunk-BI6VK774-D0oaWk8V.js → chunk-GDY2UAB4-CtQQR0a8.js} +1 -1
- package/web/assets/chunk-H7VHZCWX-CE1nAmt6.js +1 -0
- package/web/assets/chunk-IJBDOHL6-BUKtY6oF.js +1 -0
- package/web/assets/{chunk-OIYT25JQ-CQ6KOZGX.js → chunk-JFFVMJIA-0fJenqia.js} +1 -1
- package/web/assets/{chunk-HNC4WDU7-DoU3KnA7.js → chunk-JZGDI5JK-BeTMSSkJ.js} +1 -1
- package/web/assets/{chunk-EQFTRU2I-1ix7TzW9.js → chunk-KD6SPIPN-Qp1Pflah.js} +1 -1
- package/web/assets/chunk-NF366YI6-CpSpya3n.js +231 -0
- package/web/assets/chunk-NUDPKBEF-CU1-BQIW.js +34 -0
- package/web/assets/{chunk-SATU7PGQ-B1zhgOvc.js → chunk-OJINMHTS-zOCQe4eI.js} +1 -1
- package/web/assets/{chunk-E5QJAATJ-dh-5CtIV.js → chunk-Q6NGPIAH-yyBomb63.js} +1 -1
- package/web/assets/chunk-QJSWEUOL-D_rf9gPD.js +128 -0
- package/web/assets/chunk-R7JDMUKV-CRoqKpD6.js +1 -0
- package/web/assets/{chunk-VE5CLXGZ-C1vB7wpY.js → chunk-RCXAM2GK-CUqrWQDV.js} +1 -1
- package/web/assets/{chunk-66DQ2XMT-CM0xjFAN.js → chunk-RT4MAWR3-zXy9-Lvt.js} +1 -1
- package/web/assets/{chunk-TZUXEDM2-B7p9AcTw.js → chunk-SFMINX4W-J2UrvMpD.js} +1 -1
- package/web/assets/{chunk-LORZLZWG-B57uGw2N.js → chunk-SLDQ463B-CHY6e_bQ.js} +2 -2
- package/web/assets/{chunk-FWYVLQTC-BgDItRzJ.js → chunk-TCEHX7R3-CXPDEVbm.js} +1 -1
- package/web/assets/{chunk-224SPVON-B8gxtXpy.js → chunk-VQC2EELJ-Dc8fIy4R.js} +1 -1
- package/web/assets/chunk-VRZKL3EH-DB3KixTQ.js +1 -0
- package/web/assets/{chunk-A7VWPJGB-B4O3oQdQ.js → chunk-VTHDQ7BV-b7FsPQZO.js} +1 -1
- package/web/assets/chunk-VY2OSTJR-Dkgc3Brg.js +2 -0
- package/web/assets/chunk-WUBWJARI-7FwILJ3k.js +2 -0
- package/web/assets/{chunk-D6VWDJW2-BxcBdZ9c.js → chunk-YBMQ5JGJ-BSnyWZmd.js} +1 -1
- package/web/assets/chunk-YDMLL4PJ-IHhMngTz.js +2 -0
- package/web/assets/chunk-Z6V44ARX-BjCEsF0Q.js +62 -0
- package/web/assets/chunk-ZJJ7VQJP-Dz089b-K.js +321 -0
- package/web/assets/chunk-ZNLK7HRR-B0iFpmW4.js +1 -0
- package/web/assets/chunk-ZQN7UHIL-Cy7KAjQt.js +1 -0
- package/web/assets/{chunk-L5GCOVLC-CE2w8Nm_.js → chunk-ZS6VBONO-DBjJO0w9.js} +2 -2
- package/web/assets/{chunk-NV3KIAZN-5yvcpMiu.js → chunk-ZUNWM646-DNRJyNPe.js} +1 -1
- package/web/assets/classDiagram-FGAMPOII-C5Ibyode.js +1 -0
- package/web/assets/classDiagram-v2-AI5RJEK4-C5Ibyode.js +1 -0
- package/web/assets/{cose-bilkent-RZA4XIPR-BHpK4Crp.js → cose-bilkent-Q72C2OJ3-DMeFXnK8.js} +1 -1
- package/web/assets/cynefin-OW5HDTMX-6OCTWOGG-vlqakYcO.js +1 -0
- package/web/assets/{cynefinDiagram-TR7LZUCG-C3Iar9lZ.js → cynefinDiagram-2OOWUY4M-BY6DZkTt.js} +1 -1
- package/web/assets/dagre-MPVFI544-DWO70fy_.js +4 -0
- package/web/assets/diagram-AE4NWXFW-f7JRVRUL.js +24 -0
- package/web/assets/{diagram-L7DVE3PN-GIRyVUtt.js → diagram-BUJID5UG-BXZv1rCS.js} +2 -2
- package/web/assets/{diagram-JCD7PQ7C-DC5-9FRr.js → diagram-C44CZ5NI-CRNfvjCq.js} +1 -1
- package/web/assets/diagram-EYOLEXXS-DZOjKQVE.js +30 -0
- package/web/assets/diagram-P7B6PWOJ-D3SQmw3_.js +3 -0
- package/web/assets/{ebnfDiagram-DRHRQJWO-D8_CI4ZF.js → ebnfDiagram-FTPZ3PV6-jKWpIDN2.js} +1 -1
- package/web/assets/erDiagram-H3ERR26V-BqJntEuJ.js +99 -0
- package/web/assets/eventmodeling-NTZA5JFV-WKSWQHFS-Bq4FqtBL.js +1 -0
- package/web/assets/flowDiagram-YHGXBVSY-Dnlk2bEu.js +1 -0
- package/web/assets/ganttDiagram-RWFTB7ED-Bl6Y1K5T.js +292 -0
- package/web/assets/gitGraph-4MIJSDKK-JH2HKYUO-B3yc4GkH.js +1 -0
- package/web/assets/gitGraphDiagram-MAR6GKOP-CkNvsrdw.js +106 -0
- package/web/assets/{index-CJDpyH-n.css → index-C2_aej58.css} +1 -1
- package/web/assets/{index-DDRie6_8.js → index-Dj3vQOHK.js} +51 -51
- package/web/assets/info-A6RAGUB7-3TX3OFWW-BM3N5_Dv.js +1 -0
- package/web/assets/infoDiagram-LV547AFH-COkFutAf.js +2 -0
- package/web/assets/{ishikawaDiagram-4JDSWWDM-DmqWtjkl.js → ishikawaDiagram-PUJQGNDS-Bb8FylSR.js} +2 -2
- package/web/assets/{journeyDiagram-QUS3FAKT-XAzVzrQW.js → journeyDiagram-EW5QJT4W-BzoHUBhM.js} +4 -4
- package/web/assets/{kanban-definition-D4L7SQKK-YurRnmYn.js → kanban-definition-JSQERAZB-Uy2Pi0yQ.js} +4 -4
- package/web/assets/katex-CZ4GXH2S-C0Fcou7U.js +257 -0
- package/web/assets/{mindmap-definition-66QP5TD6-ChrWWnil.js → mindmap-definition-VBJCLQLM-B-CnOnt_.js} +3 -3
- package/web/assets/packet-AYTQ26CC-MKII6P3Y-Bd52ZE3V.js +1 -0
- package/web/assets/{pegDiagram-YKIO5C6U-QGeQLEq2.js → pegDiagram-7WILOQTJ-D9sneKXg.js} +1 -1
- package/web/assets/pie-WAS4IAKB-6B4OPMJ5-DW5Xy69Z.js +1 -0
- package/web/assets/pieDiagram-EFA7CBSB-Dx2NQofL.js +39 -0
- package/web/assets/{quadrantDiagram-VO5QLCXA-B7098wSc.js → quadrantDiagram-WARVYA7P-DPKL9_0A.js} +3 -3
- package/web/assets/radar-RG4KPBEZ-UPTR3XUL-CkzibT2h.js +1 -0
- package/web/assets/railroad-74A4TZTK-MEFUPFMS-D9zF-mDN.js +1 -0
- package/web/assets/railroad-abnf-HS5TGJTU-R5YG2S5D-ruacjUbX.js +1 -0
- package/web/assets/railroad-ebnf-LZEXJU2U-G5QEX2L6-S1zc5OiO.js +1 -0
- package/web/assets/railroad-peg-WCYAUIDC-H5I2ZRY2-Cbcr0XzY.js +1 -0
- package/web/assets/{railroadDiagram-M77LTMSB-AXu4vxk_.js → railroadDiagram-5NIQVNLQ-DsweTo14.js} +1 -1
- package/web/assets/{requirementDiagram-RASO5HTO-B-l8InpK.js → requirementDiagram-SXREGOKZ-CXwdNSVR.js} +4 -4
- package/web/assets/{sankeyDiagram-F32LOJ6L-Kd7zjJgX.js → sankeyDiagram-VV74M2VP-CA6jtP9P.js} +3 -3
- package/web/assets/{sequenceDiagram-URATNSBD-BlcdY9DS.js → sequenceDiagram-52ZFIFDL-k_5rEbzm.js} +15 -15
- package/web/assets/src-Df5C1Nz4.js +1 -0
- package/web/assets/stateDiagram-3QAKPIVI-BejHTf31.js +1 -0
- package/web/assets/stateDiagram-v2-HN2P4RDZ-BrfoRuOc.js +1 -0
- package/web/assets/swimlanes-QLVP42QD-CQSVO5D6.js +1 -0
- package/web/assets/swimlanesDiagram-JKPDBFCN-DrWB9kcD.js +8 -0
- package/web/assets/{timeline-definition-WJXWRH4I-DUfp1R3E.js → timeline-definition-GS45XAXW-C0Ks8rPP.js} +4 -4
- package/web/assets/treeView-Q6P3EWNA-ZRJGANNQ-DmKOCo6L.js +1 -0
- package/web/assets/treemap-WGGIJYW6-K64VN5AS-DO3xY92U.js +1 -0
- package/web/assets/{vennDiagram-K3VCMQLI-Bj-FN-XS.js → vennDiagram-QIQU2ZRJ-rgPiS837.js} +3 -3
- package/web/assets/wardley-WFR3VGLG-D67OWCCH-DiDPBNft.js +1 -0
- package/web/assets/wardleyDiagram-U6YNM66N-DRVr7SPi.js +78 -0
- package/web/assets/{xychartDiagram-5VRUVLCW-CK_rbSWE.js → xychartDiagram-XJAZEDNM-COtlZzYb.js} +3 -3
- package/web/index.html +19 -17
- package/web/assets/ProcessFlowModal-Badh2Pbg.js +0 -24
- package/web/assets/architecture-TIHT7OUA-V6N4J3SY-fTePvLoe.js +0 -1
- package/web/assets/architectureDiagram-OT7VKSJ7-mKEXxkeF.js +0 -36
- package/web/assets/blockDiagram-54WLDVWM-Dg_hrRWE.js +0 -132
- package/web/assets/c4Diagram-X2LASM7V-CnhoT4aV.js +0 -10
- package/web/assets/chunk-2AEHWXPW-CV4r6-1I.js +0 -127
- package/web/assets/chunk-5VCL7Z4A-CQ-2dYWj.js +0 -1
- package/web/assets/chunk-6BELYETK-ChsYtfHW.js +0 -1
- package/web/assets/chunk-7CWYLC5S-DRgGkkpF.js +0 -2
- package/web/assets/chunk-7FYTHRHK-CsmYIswB.js +0 -32
- package/web/assets/chunk-KRXBNO2N-C-UNuKKf.js +0 -1
- package/web/assets/chunk-LAHSG3N2-Bz4hcn0N.js +0 -321
- package/web/assets/chunk-LIEV3EAG-pyKGssV3.js +0 -1
- package/web/assets/chunk-NLANEA3F-XpH_NPA5.js +0 -62
- package/web/assets/chunk-PE7DX7ZZ-CCvRVj43.js +0 -10
- package/web/assets/chunk-Q67WD55A-BWCH2SVz.js +0 -156
- package/web/assets/chunk-SZD42YQK-ijyKKVr1.js +0 -70
- package/web/assets/chunk-TFPGFQPA-Dj6a-0pC.js +0 -231
- package/web/assets/chunk-TGVD4F4B-BMc31Gj2.js +0 -2
- package/web/assets/chunk-UAT7B5JY-DW-A_fpI.js +0 -1
- package/web/assets/chunk-VY5UBI4V-yxPQAWxw.js +0 -1
- package/web/assets/chunk-WJBAP47W-BckNkuEN.js +0 -1
- package/web/assets/classDiagram-VPOSVPXH-BjOiXA_C.js +0 -1
- package/web/assets/classDiagram-v2-5VFNUXQA-BjOiXA_C.js +0 -1
- package/web/assets/cynefin-VYW2F7L2-2VAHYKR6-DAsF6GZv.js +0 -1
- package/web/assets/dagre-K64A6Z3X-CUwi79mA.js +0 -4
- package/web/assets/diagram-2TLGJV2N-C2F5Nfym.js +0 -30
- package/web/assets/diagram-KFBZAVDW-Dfmf_4ti.js +0 -3
- package/web/assets/diagram-YP3FGXHI-CyNFYtkd.js +0 -24
- package/web/assets/erDiagram-SZLJLQMB-CohQjznC.js +0 -85
- package/web/assets/eventmodeling-45OFAUF4-AOUJWSLX-BvTc6iQi.js +0 -1
- package/web/assets/flowDiagram-BWE6NHOH-B6RnEvD9.js +0 -1
- package/web/assets/ganttDiagram-2QTCJSNI-Cks_mEcF.js +0 -292
- package/web/assets/gitGraph-TEB2WS4Q-U5VWYIBC-Dy7CCSZ5.js +0 -1
- package/web/assets/gitGraphDiagram-VVZAVV5G-CG41cIVc.js +0 -106
- package/web/assets/info-DKCQHKI2-DX6KST54-BLJg1ikX.js +0 -1
- package/web/assets/infoDiagram-FY4PZKRE-BJ3vPVwW.js +0 -2
- package/web/assets/katex-C5OPUE3Q-Bnbavtmu.js +0 -257
- package/web/assets/packet-7NZHBO7P-5WG45QPS-KUxcuvaA.js +0 -1
- package/web/assets/pie-RZYD4A2V-2OCZ2VTD-DPs08kJY.js +0 -1
- package/web/assets/pieDiagram-YPY3TKG5-BuT3MYzm.js +0 -39
- package/web/assets/radar-I7S5WNFK-EPLSA35B-w5F0K3a7.js +0 -1
- package/web/assets/railroad-3IZDKUUU-PWFQV6Y6-Bu668yqY.js +0 -1
- package/web/assets/railroad-abnf-AHOZXSZD-JYYJX3BS-B6ghpETS.js +0 -1
- package/web/assets/railroad-ebnf-EBAXGLYW-RBZ4ONAP-D-XmHh3M.js +0 -1
- package/web/assets/railroad-peg-LSFZ7HO6-KHNPXGPG-mhkrhzEn.js +0 -1
- package/web/assets/src-C5sx_gMp.js +0 -1
- package/web/assets/stateDiagram-DODFXNG5-DTdHc-fF.js +0 -1
- package/web/assets/stateDiagram-v2-JNMM5JRA-DioNLDDo.js +0 -1
- package/web/assets/swimlanes-OSWOYLSK-CA0ofdwY.js +0 -2
- package/web/assets/swimlanesDiagram-RHGX2RDE-PkwUdckC.js +0 -8
- package/web/assets/treeView-QDETBFTQ-EHYTSQNO-C5lpBgPm.js +0 -1
- package/web/assets/treemap-6X3UGDF4-CCWCF7EK-BB0ZyO-B.js +0 -1
- package/web/assets/wardley-OPB4EBWU-6OWERDVT-CEA3Nq0j.js +0 -1
- package/web/assets/wardleyDiagram-XK6FUAWV-CVV0dHFr.js +0 -78
- /package/web/assets/{sizeCapture-5GORAGP4-BEqQzsxs.js → sizeCapture-FGA5AGYP-BEqQzsxs.js} +0 -0
|
@@ -73,6 +73,17 @@ interface ResolveCompoundReceiverOptions {
|
|
|
73
73
|
readonly constructionSyntax?: ScopeResolver['constructionSyntax'];
|
|
74
74
|
/** Verified namespace handles visible in the current file. */
|
|
75
75
|
readonly namespaceTargets?: ReadonlyMap<string, readonly string[]>;
|
|
76
|
+
/** A namespace member may be a name the target module imported and
|
|
77
|
+
* publishes (hub modules). See `ScopeResolver.namespaceExportsIncludeImportedNames`. */
|
|
78
|
+
readonly namespaceExportsIncludeImportedNames?: boolean;
|
|
79
|
+
/** Resolve a qualified CLASS name (`opmod.Op`, `hub.sub.Thing`,
|
|
80
|
+
* `mod.Outer.Inner`) through the language's namespace chain walk
|
|
81
|
+
* (`ScopeResolver.resolveNamespaceChains`). Seeds the dotted-chain walk
|
|
82
|
+
* when its head is a namespace rather than a value: `opmod.Op.lookup` is
|
|
83
|
+
* the enum `Op` reached through the module `opmod`, then its variant
|
|
84
|
+
* `lookup` — a value of `Op` — and only then a method (PR #1432 review,
|
|
85
|
+
* 8.10). Absent ⇒ the head must bind in scope, exactly as before. */
|
|
86
|
+
readonly resolveQualifiedClass?: (qualifiedName: string, inScope: ScopeId) => SymbolDefinition | undefined;
|
|
76
87
|
/** Compact receiver chain for THIS site (`ReferenceSite.receiverChain`), when
|
|
77
88
|
* the language's capture emitter produced one. Present ⇒ the structural fold
|
|
78
89
|
* is tried before the text cascade; absent ⇒ behaviour is exactly as before.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { erasedTypeApplication, matchingOpenParen, stripTemplateArguments, } from '../../utils/template-arguments.js';
|
|
23
23
|
import { decodeReceiverChain } from '../../utils/receiver-chain-codec.js';
|
|
24
|
-
import { findClassBindingInScope, resolveClassBindingForName, findEnclosingClassDef, findExportedDef, findExportedDefByName, findReceiverTypeBinding, isClassLike, isNamespaceNameShadowed, } from '../scope/walkers.js';
|
|
24
|
+
import { findClassBindingInScope, resolveClassBindingForName, findEnclosingClassDef, findExportedDef, findExportedDefByName, findExportedDefIncludingImportedNames, findReceiverTypeBinding, isClassLike, isNamespaceNameShadowed, } from '../scope/walkers.js';
|
|
25
25
|
/** Max depth for compound-receiver chain resolution (`a().b().c().d()`).
|
|
26
26
|
* Practical code rarely exceeds 3-4 _syntactic_ hops, but languages
|
|
27
27
|
* with type-binding-mediated chains (Ruby's `x = obj.method()` binds
|
|
@@ -126,7 +126,9 @@ function resolveConstructionExpressionClass(fnExpr, inScope, scopes, index, opti
|
|
|
126
126
|
if (isNamespaceNameShadowed(namespaceName, inScope, scopes))
|
|
127
127
|
return undefined;
|
|
128
128
|
const namespaceMatches = namespaceFiles
|
|
129
|
-
.map((targetFile) =>
|
|
129
|
+
.map((targetFile) => options.namespaceExportsIncludeImportedNames === true
|
|
130
|
+
? findExportedDefIncludingImportedNames(targetFile, exportedName, index, scopes)
|
|
131
|
+
: findExportedDef(targetFile, exportedName, index))
|
|
130
132
|
.filter((def) => def !== undefined && isClassLike(def.type));
|
|
131
133
|
return namespaceMatches.length === 1 ? namespaceMatches[0] : undefined;
|
|
132
134
|
}
|
|
@@ -893,7 +895,31 @@ export function resolveCompoundReceiverClass(receiverText, inScope, scopes, inde
|
|
|
893
895
|
if (currentClass === undefined) {
|
|
894
896
|
currentClass = resolveConstructionExpressionClass(headMemberName, inScope, scopes, index, options);
|
|
895
897
|
}
|
|
896
|
-
|
|
898
|
+
// Namespace-qualified chain head — `opmod.Op.lookup` / `hub.sub.Thing.x`:
|
|
899
|
+
// no binding and no class named `opmod`, but the LONGEST prefix the
|
|
900
|
+
// language's chain walk accepts as a class seeds the walk (the class
|
|
901
|
+
// itself, so a variant / static member hop is read off the class scope),
|
|
902
|
+
// and the remaining segments are walked as members. Longest first: the
|
|
903
|
+
// prefix is a class, not a value, and `a.B.C` must seed at `C`, not stop
|
|
904
|
+
// at `B` and read `C` as a member of it. The whole receiver may be the
|
|
905
|
+
// class (`opmod.Op` — no member segment left), exactly as a bare class
|
|
906
|
+
// name head resolves to the class constant above.
|
|
907
|
+
let firstHop = 1;
|
|
908
|
+
if (currentClass === undefined && headType === undefined && options.resolveQualifiedClass) {
|
|
909
|
+
for (let k = parts.length; k >= 2; k--) {
|
|
910
|
+
const prefix = parts.slice(0, k).join('.');
|
|
911
|
+
if (prefix.includes('('))
|
|
912
|
+
continue;
|
|
913
|
+
const seeded = options.resolveQualifiedClass(prefix, inScope);
|
|
914
|
+
if (seeded === undefined)
|
|
915
|
+
continue;
|
|
916
|
+
currentClass = seeded;
|
|
917
|
+
currentIsClassConstant = true;
|
|
918
|
+
firstHop = k;
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
for (let i = firstHop; i < parts.length && currentClass !== undefined; i++) {
|
|
897
923
|
const segment = parts[i];
|
|
898
924
|
if (segment === undefined)
|
|
899
925
|
break;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* Generic; promoted from `languages/python/scope-resolver.ts` per the scope-resolution
|
|
17
17
|
* generalization plan.
|
|
18
18
|
*/
|
|
19
|
-
import type { ParameterTypeClass, ParsedFile, Reference, ScopeId, SymbolDefinition } from '../../../../_shared/index.js';
|
|
19
|
+
import type { ParameterTypeClass, ParsedFile, Reference, ReferenceSite, ScopeId, SymbolDefinition } from '../../../../_shared/index.js';
|
|
20
20
|
import type { KnowledgeGraph } from '../../../graph/types.js';
|
|
21
21
|
import type { ScopeResolutionIndexes } from '../../model/scope-resolution-indexes.js';
|
|
22
22
|
import type { SemanticModel } from '../../model/semantic-model.js';
|
|
@@ -33,6 +33,9 @@ export declare function emitFreeCallFallback(graph: KnowledgeGraph, scopes: Scop
|
|
|
33
33
|
/** When true, `Type(...)` constructor calls link to the Class def
|
|
34
34
|
* itself rather than its explicit Constructor. Swift opts in. */
|
|
35
35
|
readonly constructorCallTargetsClass?: boolean;
|
|
36
|
+
/** When true, a constructor-form site's edge gets ` (constructor)`
|
|
37
|
+
* appended to its reason. See `ScopeResolver.markConstructionSites`. */
|
|
38
|
+
readonly markConstructionSites?: boolean;
|
|
36
39
|
readonly isFileLocalDef?: (def: SymbolDefinition) => boolean;
|
|
37
40
|
readonly isCallableVisibleFromCaller?: (ctx: {
|
|
38
41
|
readonly callerParsed: ParsedFile;
|
|
@@ -79,6 +82,10 @@ export declare function emitFreeCallFallback(graph: KnowledgeGraph, scopes: Scop
|
|
|
79
82
|
* multi-line calls are still recorded per site. */
|
|
80
83
|
readonly calleeIdSink?: CalleeIdSink;
|
|
81
84
|
}): number;
|
|
85
|
+
/** `reason` of a free-call edge: the legacy string, plus ` (constructor)` for
|
|
86
|
+
* a construction site when the provider opted in
|
|
87
|
+
* (`ScopeResolver.markConstructionSites`). */
|
|
88
|
+
export declare function constructionSiteReason(base: string, site: Pick<ReferenceSite, 'callForm'>, markConstructionSites: boolean | undefined): string;
|
|
82
89
|
/**
|
|
83
90
|
* Build a `simpleName -> callable defs` index from `scopes.defs` once per
|
|
84
91
|
* pass. Mirrors the filter the old per-site scan applied: Function /
|
|
@@ -79,6 +79,7 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
79
79
|
return owners.has(instanceOwnerKey(ownerId));
|
|
80
80
|
};
|
|
81
81
|
for (const parsed of parsedFiles) {
|
|
82
|
+
const pending = new Map();
|
|
82
83
|
const bindingCandidatesByScope = options.freeCallsRequireInstanceOwnership === true
|
|
83
84
|
? new Map()
|
|
84
85
|
: undefined;
|
|
@@ -462,24 +463,49 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
462
463
|
// SiteRecord.at: 1-based line / 0-based col).
|
|
463
464
|
options.calleeIdSink?.add(parsed.filePath, site.atRange.startLine, site.atRange.startCol, tgtGraphId);
|
|
464
465
|
const relId = `rel:CALLS:${callerGraphId}->${tgtGraphId}`;
|
|
466
|
+
// One edge per (caller, callee): `staticGated` is the AND over every site
|
|
467
|
+
// that collapses into it, so a callee reached from one live site and one
|
|
468
|
+
// dead site stays live whichever site the walk meets first. Emission is
|
|
469
|
+
// deferred to the end of this file's sites for that reason.
|
|
470
|
+
const pendingRel = pending.get(relId);
|
|
471
|
+
if (pendingRel !== undefined) {
|
|
472
|
+
if (site.staticGated !== true)
|
|
473
|
+
pendingRel.gatedAll = false;
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
465
476
|
if (seen.has(relId))
|
|
466
477
|
continue;
|
|
467
478
|
seen.add(relId);
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
479
|
+
pending.set(relId, {
|
|
480
|
+
gatedAll: site.staticGated === true,
|
|
481
|
+
rel: {
|
|
482
|
+
id: relId,
|
|
483
|
+
sourceId: callerGraphId,
|
|
484
|
+
targetId: tgtGraphId,
|
|
485
|
+
type: 'CALLS',
|
|
486
|
+
confidence: 0.85,
|
|
487
|
+
// Match legacy DAG's reason convention so consumers that
|
|
488
|
+
// assert `reason === 'import-resolved'` keep working. The
|
|
489
|
+
// construction-site marker is opt-in for the same reason.
|
|
490
|
+
reason: constructionSiteReason(fnDef.filePath !== parsed.filePath ? 'import-resolved' : 'local-call', site, options.markConstructionSites),
|
|
491
|
+
},
|
|
477
492
|
});
|
|
478
493
|
emitted++;
|
|
479
494
|
}
|
|
495
|
+
for (const { rel, gatedAll } of pending.values()) {
|
|
496
|
+
graph.addRelationship(gatedAll ? { ...rel, staticGated: true } : rel);
|
|
497
|
+
}
|
|
480
498
|
}
|
|
481
499
|
return emitted;
|
|
482
500
|
}
|
|
501
|
+
/** `reason` of a free-call edge: the legacy string, plus ` (constructor)` for
|
|
502
|
+
* a construction site when the provider opted in
|
|
503
|
+
* (`ScopeResolver.markConstructionSites`). */
|
|
504
|
+
export function constructionSiteReason(base, site, markConstructionSites) {
|
|
505
|
+
return markConstructionSites === true && site.callForm === 'constructor'
|
|
506
|
+
? `${base} (constructor)`
|
|
507
|
+
: base;
|
|
508
|
+
}
|
|
483
509
|
function siteKey(filePath, site) {
|
|
484
510
|
return `${filePath}:${site.atRange.startLine}:${site.atRange.startCol}`;
|
|
485
511
|
}
|
|
@@ -71,10 +71,7 @@ import { type HeritageTypeArguments } from '../utils/generic-instantiation.js';
|
|
|
71
71
|
import type { ResolutionOutcomeRecorder } from '../resolution-outcome.js';
|
|
72
72
|
import type { ReceiverOrigin } from '../resolution-outcome.js';
|
|
73
73
|
import type { DecodedReceiverChain } from '../../utils/receiver-chain-codec.js';
|
|
74
|
-
|
|
75
|
-
* subset rather than the full provider keeps tests and partial
|
|
76
|
-
* refactors lighter — callers only need to populate what we read. */
|
|
77
|
-
type ReceiverBoundProviderSubset = Pick<ScopeResolver, 'isSuperReceiver' | 'isSuperReceiverInContext' | 'fieldFallbackOnMethodLookup' | 'collapseMemberCallsByCallerTarget' | 'elementTypeOf' | 'hoistTypeBindingsToModule' | 'stripReceiverCastExpressions' | 'constructionSyntax' | 'stripTypePreservingDecoration' | 'resolveQualifiedReceiverMember' | 'namespaceReceiverPaths' | 'resolveReceiverMember' | 'resolveThisViaEnclosingClass' | 'conversionRankFn' | 'conversionOnlyArgTypePrefixes' | 'constraintCompatibility' | 'isStaticOnly' | 'normalizeTypeArgument'>;
|
|
74
|
+
type ReceiverBoundProviderSubset = Pick<ScopeResolver, 'isSuperReceiver' | 'isSuperReceiverInContext' | 'fieldFallbackOnMethodLookup' | 'collapseMemberCallsByCallerTarget' | 'elementTypeOf' | 'hoistTypeBindingsToModule' | 'stripReceiverCastExpressions' | 'constructionSyntax' | 'stripTypePreservingDecoration' | 'resolveQualifiedReceiverMember' | 'namespaceReceiverPaths' | 'resolveReceiverMember' | 'resolveThisViaEnclosingClass' | 'conversionRankFn' | 'conversionOnlyArgTypePrefixes' | 'constraintCompatibility' | 'isStaticOnly' | 'normalizeTypeArgument' | 'markConstructionSites' | 'namespaceExportsIncludeImportedNames' | 'resolveNamespaceChains'>;
|
|
78
75
|
/**
|
|
79
76
|
* Is this dropped receiver rooted inside the analyzed program?
|
|
80
77
|
*
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
* resolved to a wrong target.
|
|
60
60
|
*/
|
|
61
61
|
import { collectNamespaceTargets } from '../scope/namespace-targets.js';
|
|
62
|
-
import { bindsTypeParameter, findClassBindingInScope, findEnclosingClassDef, isReceiverOwnedButUnbound, findExportedDef, findOwnedMember, findReceiverTypeBinding, findValueBindingInScope, isClassLike, isNamespaceNameShadowed, resolveClassBindingForName, } from '../scope/walkers.js';
|
|
62
|
+
import { bindsTypeParameter, findClassBindingInScope, findEnclosingClassDef, isReceiverOwnedButUnbound, findExportedDef, findExportedDefIncludingImportedNames, findOwnedMember, findReceiverTypeBinding, findValueBindingInScope, isClassLike, isNamespaceNameShadowed, resolveClassBindingForName, } from '../scope/walkers.js';
|
|
63
63
|
import { tryEmitEdge, tryEmitEdgeWithExplicitTargetId, } from '../graph-bridge/edges.js';
|
|
64
|
+
import { constructionSiteReason } from './free-call-fallback.js';
|
|
64
65
|
import { resolveCompoundReceiverClass, resolveCompoundReceiverTyped, } from '../passes/compound-receiver.js';
|
|
65
66
|
import { erasedTypeApplication, typeApplicationArguments } from '../../utils/template-arguments.js';
|
|
66
67
|
import { heritageTypeArgumentsKey, stepHeritageInstantiation, } from '../utils/generic-instantiation.js';
|
|
@@ -68,6 +69,65 @@ import { resolveDefGraphId } from '../graph-bridge/ids.js';
|
|
|
68
69
|
import { narrowOverloadCandidates, isOverloadAmbiguousAfterNormalization, } from './overload-narrowing.js';
|
|
69
70
|
import { classifyReceiverShape } from '../resolution-outcome.js';
|
|
70
71
|
import { decodeReceiverChain } from '../../utils/receiver-chain-codec.js';
|
|
72
|
+
/** Subset of `ScopeResolver` consumed by this pass. Accepting the
|
|
73
|
+
* subset rather than the full provider keeps tests and partial
|
|
74
|
+
* refactors lighter — callers only need to populate what we read. */
|
|
75
|
+
/** Split `text` at the dots that sit at nesting depth 0 and outside string
|
|
76
|
+
* literals — `@import("a.zig").Outer.Inner` → three segments, not four;
|
|
77
|
+
* `List(u8).Node` → two. The chain walk's segmenter. */
|
|
78
|
+
function splitTopLevelDots(text) {
|
|
79
|
+
const out = [];
|
|
80
|
+
let depth = 0;
|
|
81
|
+
let inString = false;
|
|
82
|
+
let start = 0;
|
|
83
|
+
for (let i = 0; i < text.length; i++) {
|
|
84
|
+
const ch = text[i];
|
|
85
|
+
if (inString) {
|
|
86
|
+
if (ch === '\\')
|
|
87
|
+
i++;
|
|
88
|
+
else if (ch === '"')
|
|
89
|
+
inString = false;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (ch === '"')
|
|
93
|
+
inString = true;
|
|
94
|
+
else if (ch === '(' || ch === '[' || ch === '<')
|
|
95
|
+
depth++;
|
|
96
|
+
else if (ch === ')' || ch === ']' || ch === '>')
|
|
97
|
+
depth--;
|
|
98
|
+
else if (ch === '.' && depth === 0) {
|
|
99
|
+
out.push(text.slice(start, i));
|
|
100
|
+
start = i + 1;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
out.push(text.slice(start));
|
|
104
|
+
return out.filter((s) => s.length > 0);
|
|
105
|
+
}
|
|
106
|
+
/** Index of the last depth-0, outside-string dot of `text`, or -1. */
|
|
107
|
+
function lastTopLevelDot(text) {
|
|
108
|
+
let depth = 0;
|
|
109
|
+
let inString = false;
|
|
110
|
+
let last = -1;
|
|
111
|
+
for (let i = 0; i < text.length; i++) {
|
|
112
|
+
const ch = text[i];
|
|
113
|
+
if (inString) {
|
|
114
|
+
if (ch === '\\')
|
|
115
|
+
i++;
|
|
116
|
+
else if (ch === '"')
|
|
117
|
+
inString = false;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (ch === '"')
|
|
121
|
+
inString = true;
|
|
122
|
+
else if (ch === '(' || ch === '[' || ch === '<')
|
|
123
|
+
depth++;
|
|
124
|
+
else if (ch === ')' || ch === ']' || ch === '>')
|
|
125
|
+
depth--;
|
|
126
|
+
else if (ch === '.' && depth === 0)
|
|
127
|
+
last = i;
|
|
128
|
+
}
|
|
129
|
+
return last;
|
|
130
|
+
}
|
|
71
131
|
/** A bare, undecorated identifier and nothing else — see {@link isBareTypeName}. */
|
|
72
132
|
const BARE_TYPE_NAME_RE = /^[A-Za-z_$][\w$]*$/;
|
|
73
133
|
/**
|
|
@@ -194,9 +254,153 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
194
254
|
const fieldFallback = provider.fieldFallbackOnMethodLookup ?? true;
|
|
195
255
|
const collapse = provider.collapseMemberCallsByCallerTarget === true;
|
|
196
256
|
const hoistTypeBindingsToModule = provider.hoistTypeBindingsToModule === true;
|
|
257
|
+
// Namespace-member lookup for Case 1 / Case 3: local exports only, unless
|
|
258
|
+
// the provider publishes imported names too (hub modules — see
|
|
259
|
+
// `ScopeResolver.namespaceExportsIncludeImportedNames`).
|
|
260
|
+
const lookupNamespaceMember = (targetFile, name) => provider.namespaceExportsIncludeImportedNames === true
|
|
261
|
+
? findExportedDefIncludingImportedNames(targetFile, name, index, scopes)
|
|
262
|
+
: findExportedDef(targetFile, name, index);
|
|
263
|
+
// A class-like member `name` unique across `files`, or nothing — two
|
|
264
|
+
// same-named classes behind one handle would mint a confident wrong edge.
|
|
265
|
+
const uniqueClassAcross = (files, name) => {
|
|
266
|
+
let picked;
|
|
267
|
+
for (const file of files) {
|
|
268
|
+
const def = lookupNamespaceMember(file, name);
|
|
269
|
+
if (def === undefined || !isClassLike(def.type))
|
|
270
|
+
continue;
|
|
271
|
+
if (picked !== undefined && picked.nodeId !== def.nodeId)
|
|
272
|
+
return undefined;
|
|
273
|
+
picked = def;
|
|
274
|
+
}
|
|
275
|
+
return picked;
|
|
276
|
+
};
|
|
277
|
+
// A class-like def NESTED in `owner` (`A.Item` inside `A`): its qualified
|
|
278
|
+
// name is the owner's plus the segment — the identity the structure phase
|
|
279
|
+
// and `populateClassOwnedMembers` agree on — so the qualified-name index
|
|
280
|
+
// answers directly; same file as the owner, unique or nothing. Only the
|
|
281
|
+
// chain walk reads this: `findOwnedMember` knows methods and fields, and a
|
|
282
|
+
// nested type is neither.
|
|
283
|
+
const findNestedClass = (owner, name) => {
|
|
284
|
+
if (owner.qualifiedName === undefined || owner.qualifiedName.length === 0)
|
|
285
|
+
return undefined;
|
|
286
|
+
let picked;
|
|
287
|
+
for (const id of scopes.qualifiedNames.get(`${owner.qualifiedName}.${name}`)) {
|
|
288
|
+
const def = scopes.defs.get(id);
|
|
289
|
+
if (def === undefined || !isClassLike(def.type) || def.filePath !== owner.filePath)
|
|
290
|
+
continue;
|
|
291
|
+
if (picked !== undefined && picked.nodeId !== def.nodeId)
|
|
292
|
+
return undefined;
|
|
293
|
+
picked = def;
|
|
294
|
+
}
|
|
295
|
+
return picked;
|
|
296
|
+
};
|
|
297
|
+
// Namespace CHAIN walk (`ScopeResolver.resolveNamespaceChains`): resolve
|
|
298
|
+
// every segment of a qualified prefix from its verified namespace root —
|
|
299
|
+
// or, failing a namespace, from a class binding in scope (`Outer.Inner`).
|
|
300
|
+
// The cursor is either "these module files" or "this class"; a hop from a
|
|
301
|
+
// module is a class-like member of it (→ class) or a namespace-import edge
|
|
302
|
+
// its module scope binds under the segment — a republished module,
|
|
303
|
+
// `pub const sub = @import("sub.zig");` (→ files); a hop from a class is a
|
|
304
|
+
// nested class-like. Anything ambiguous resolves nothing.
|
|
305
|
+
const walkChains = provider.resolveNamespaceChains === true;
|
|
306
|
+
const namespaceImportTargetsOf = (file, name) => {
|
|
307
|
+
const moduleScope = index.moduleScopeByFile.get(file);
|
|
308
|
+
if (moduleScope === undefined)
|
|
309
|
+
return [];
|
|
310
|
+
const out = [];
|
|
311
|
+
for (const edge of scopes.imports.get(moduleScope.id) ?? []) {
|
|
312
|
+
if (edge.kind !== 'namespace' || edge.localName !== name || edge.targetFile === null)
|
|
313
|
+
continue;
|
|
314
|
+
if (!out.includes(edge.targetFile))
|
|
315
|
+
out.push(edge.targetFile);
|
|
316
|
+
}
|
|
317
|
+
return out;
|
|
318
|
+
};
|
|
319
|
+
const resolveNamespaceChain = (prefix, inScope, namespaceTargets) => {
|
|
320
|
+
const segments = splitTopLevelDots(prefix);
|
|
321
|
+
if (segments.length === 0)
|
|
322
|
+
return undefined;
|
|
323
|
+
let cursor;
|
|
324
|
+
let rest = [];
|
|
325
|
+
// The LONGEST namespace key wins: a provider may bind dotted handles
|
|
326
|
+
// (`namespaceReceiverPaths`) and an inline `@import("x.zig")` handle
|
|
327
|
+
// carries a dot of its own inside the quotes.
|
|
328
|
+
for (let k = segments.length; k >= 1; k--) {
|
|
329
|
+
const key = segments.slice(0, k).join('.');
|
|
330
|
+
const files = namespaceTargets.get(key);
|
|
331
|
+
if (files === undefined)
|
|
332
|
+
continue;
|
|
333
|
+
if (isNamespaceNameShadowed(key, inScope, scopes))
|
|
334
|
+
return undefined;
|
|
335
|
+
cursor = { files };
|
|
336
|
+
rest = segments.slice(k);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
if (cursor === undefined) {
|
|
340
|
+
const head = findClassBindingInScope(inScope, segments[0], scopes);
|
|
341
|
+
if (head === undefined || !isClassLike(head.type))
|
|
342
|
+
return undefined;
|
|
343
|
+
cursor = { classDef: head };
|
|
344
|
+
rest = segments.slice(1);
|
|
345
|
+
}
|
|
346
|
+
for (const segment of rest) {
|
|
347
|
+
if (segment.includes('(') || segment.includes('['))
|
|
348
|
+
return undefined;
|
|
349
|
+
if ('files' in cursor) {
|
|
350
|
+
const asClass = uniqueClassAcross(cursor.files, segment);
|
|
351
|
+
const asModule = [];
|
|
352
|
+
for (const file of cursor.files) {
|
|
353
|
+
for (const target of namespaceImportTargetsOf(file, segment)) {
|
|
354
|
+
if (!asModule.includes(target))
|
|
355
|
+
asModule.push(target);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (asClass !== undefined && asModule.length > 0)
|
|
359
|
+
return undefined; // both — refuse
|
|
360
|
+
if (asClass !== undefined)
|
|
361
|
+
cursor = { classDef: asClass };
|
|
362
|
+
else if (asModule.length > 0)
|
|
363
|
+
cursor = { files: asModule };
|
|
364
|
+
else
|
|
365
|
+
return undefined;
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
const nested = findNestedClass(cursor.classDef, segment);
|
|
369
|
+
if (nested === undefined)
|
|
370
|
+
return undefined;
|
|
371
|
+
cursor = { classDef: nested };
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return cursor;
|
|
375
|
+
};
|
|
376
|
+
// `ns.Type` as a receiver, where `ns` is a verified namespace of the current
|
|
377
|
+
// file and `Type` a class-like member of it — or, with the chain walk, any
|
|
378
|
+
// `a.b.c.Type` whose prefix resolves. Unique or nothing.
|
|
379
|
+
const resolveNamespaceQualifiedClass = (receiverName, inScope, namespaceTargets) => {
|
|
380
|
+
const dot = walkChains ? lastTopLevelDot(receiverName) : receiverName.lastIndexOf('.');
|
|
381
|
+
if (dot <= 0 || dot === receiverName.length - 1)
|
|
382
|
+
return undefined;
|
|
383
|
+
const head = receiverName.slice(0, dot);
|
|
384
|
+
const tail = receiverName.slice(dot + 1);
|
|
385
|
+
if (tail.includes('(') || tail.includes('['))
|
|
386
|
+
return undefined;
|
|
387
|
+
if (walkChains) {
|
|
388
|
+
const cursor = resolveNamespaceChain(head, inScope, namespaceTargets);
|
|
389
|
+
if (cursor === undefined)
|
|
390
|
+
return undefined;
|
|
391
|
+
return 'classDef' in cursor
|
|
392
|
+
? findNestedClass(cursor.classDef, tail)
|
|
393
|
+
: uniqueClassAcross(cursor.files, tail);
|
|
394
|
+
}
|
|
395
|
+
const files = namespaceTargets.get(head);
|
|
396
|
+
if (files === undefined || isNamespaceNameShadowed(head, inScope, scopes))
|
|
397
|
+
return undefined;
|
|
398
|
+
return uniqueClassAcross(files, tail);
|
|
399
|
+
};
|
|
197
400
|
const compoundOpts = {
|
|
198
401
|
fieldFallback,
|
|
199
402
|
elementTypeOf: provider.elementTypeOf,
|
|
403
|
+
namespaceExportsIncludeImportedNames: provider.namespaceExportsIncludeImportedNames === true,
|
|
200
404
|
hoistTypeBindingsToModule,
|
|
201
405
|
stripReceiverCastExpressions: provider.stripReceiverCastExpressions === true,
|
|
202
406
|
constructionSyntax: provider.constructionSyntax,
|
|
@@ -583,7 +787,15 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
583
787
|
receiverPaths: provider.namespaceReceiverPaths,
|
|
584
788
|
moduleFileExists: (filePath) => index.moduleScopeByFile.has(filePath),
|
|
585
789
|
});
|
|
586
|
-
const fileCompoundOpts = {
|
|
790
|
+
const fileCompoundOpts = {
|
|
791
|
+
...compoundOpts,
|
|
792
|
+
namespaceTargets,
|
|
793
|
+
...(walkChains
|
|
794
|
+
? {
|
|
795
|
+
resolveQualifiedClass: (qualifiedName, inScope) => resolveNamespaceQualifiedClass(qualifiedName, inScope, namespaceTargets),
|
|
796
|
+
}
|
|
797
|
+
: {}),
|
|
798
|
+
};
|
|
587
799
|
// Per-file resolved-callee-id capture context (#2227 U2). Built once per
|
|
588
800
|
// file; `undefined` when the sink is absent (pdg off) so the `tryEmitEdge`
|
|
589
801
|
// capture is a no-op and emission stays byte-identical (R4).
|
|
@@ -946,21 +1158,34 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
946
1158
|
// that is usually empty. Mirrors the order the compound-receiver
|
|
947
1159
|
// construction path already uses.
|
|
948
1160
|
const namespaceCandidates = namespaceTargets.get(receiverName);
|
|
949
|
-
|
|
1161
|
+
let targetFiles = namespaceCandidates !== undefined &&
|
|
950
1162
|
!isNamespaceNameShadowed(receiverName, site.inScope, scopes)
|
|
951
1163
|
? namespaceCandidates
|
|
952
1164
|
: undefined;
|
|
1165
|
+
// Chain walk: `hub.sub.helper()` / `hub.sub.Thing{}` — the receiver is
|
|
1166
|
+
// no handle of this file, but its segments reach a module (see
|
|
1167
|
+
// `resolveNamespaceChain`). A prefix that ends in a CLASS is Case 2's.
|
|
1168
|
+
if (targetFiles === undefined && walkChains && lastTopLevelDot(receiverName) > 0) {
|
|
1169
|
+
const cursor = resolveNamespaceChain(receiverName, site.inScope, namespaceTargets);
|
|
1170
|
+
if (cursor !== undefined && 'files' in cursor)
|
|
1171
|
+
targetFiles = cursor.files;
|
|
1172
|
+
}
|
|
953
1173
|
if (targetFiles !== undefined && provider.resolveQualifiedReceiverMember === undefined) {
|
|
954
1174
|
let found = false;
|
|
955
1175
|
for (const targetFile of targetFiles) {
|
|
956
|
-
const memberDef =
|
|
1176
|
+
const memberDef = lookupNamespaceMember(targetFile, memberName);
|
|
957
1177
|
if (memberDef !== undefined) {
|
|
958
1178
|
if (suppressDeletedCallTarget(options.recordResolutionOutcome, parsed.filePath, site, memberDef)) {
|
|
959
1179
|
handledSites.add(siteKey);
|
|
960
1180
|
found = true;
|
|
961
1181
|
break;
|
|
962
1182
|
}
|
|
963
|
-
const ok = tryEmitEdge(graph, scopes, nodeLookup, site, memberDef,
|
|
1183
|
+
const ok = tryEmitEdge(graph, scopes, nodeLookup, site, memberDef,
|
|
1184
|
+
// A namespace-qualified construction site (`mod.T{…}`) resolves
|
|
1185
|
+
// here like `mod.fn()` does; the provider's opt-in marker keeps
|
|
1186
|
+
// it distinguishable from an invocation (see
|
|
1187
|
+
// `ScopeResolver.markConstructionSites`).
|
|
1188
|
+
constructionSiteReason(memberDef.filePath !== parsed.filePath ? 'import-resolved' : 'global', site, provider.markConstructionSites), seen, 0.85, collapse, calleeCapture);
|
|
964
1189
|
if (ok)
|
|
965
1190
|
emitted++;
|
|
966
1191
|
handledSites.add(siteKey);
|
|
@@ -1007,7 +1232,15 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
1007
1232
|
}
|
|
1008
1233
|
}
|
|
1009
1234
|
// ── Case 2: class-name receiver ──────────────────────────────
|
|
1010
|
-
|
|
1235
|
+
// A namespace-qualified class (`stdx.PRNG.from_seed()`, `terminal
|
|
1236
|
+
// .Terminal.init()`) binds nothing in the caller's scope chain; when the
|
|
1237
|
+
// head names a verified namespace, the tail is looked up as that
|
|
1238
|
+
// module's member — through the same lookup Case 1 / Case 3 use, so a
|
|
1239
|
+
// hub module (a file made only of re-exports) answers when the provider
|
|
1240
|
+
// opted in. Only a bare tail is walked here; `ns.Type.field.m()` is the
|
|
1241
|
+
// compound resolver's shape.
|
|
1242
|
+
const classDef = findClassBindingInScope(site.inScope, receiverName, scopes) ??
|
|
1243
|
+
resolveNamespaceQualifiedClass(receiverName, site.inScope, namespaceTargets);
|
|
1011
1244
|
if (classDef !== undefined) {
|
|
1012
1245
|
const chain = [classDef.nodeId, ...scopes.methodDispatch.mroFor(classDef.nodeId)];
|
|
1013
1246
|
let memberDef;
|
|
@@ -1040,6 +1273,24 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
1040
1273
|
handledSites.add(siteKey);
|
|
1041
1274
|
continue;
|
|
1042
1275
|
}
|
|
1276
|
+
// `A.Item{}` / `mod.Outer.Inner{}` — a construction whose member is a
|
|
1277
|
+
// type NESTED in the class the receiver names. Neither a method nor a
|
|
1278
|
+
// field, so the owner walk above cannot see it; the chain walk's
|
|
1279
|
+
// nested-class lookup can (`resolveNamespaceChains`).
|
|
1280
|
+
if (memberDef === undefined && walkChains && site.callForm === 'constructor') {
|
|
1281
|
+
const nested = findNestedClass(classDef, memberName);
|
|
1282
|
+
if (nested !== undefined) {
|
|
1283
|
+
if (suppressDeletedCallTarget(options.recordResolutionOutcome, parsed.filePath, site, nested)) {
|
|
1284
|
+
handledSites.add(siteKey);
|
|
1285
|
+
continue;
|
|
1286
|
+
}
|
|
1287
|
+
const ok = tryEmitEdge(graph, scopes, nodeLookup, site, nested, constructionSiteReason(nested.filePath !== parsed.filePath ? 'import-resolved' : 'global', site, provider.markConstructionSites), seen, 0.85, collapse, calleeCapture);
|
|
1288
|
+
if (ok)
|
|
1289
|
+
emitted++;
|
|
1290
|
+
handledSites.add(siteKey);
|
|
1291
|
+
continue;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1043
1294
|
if (memberDef !== undefined) {
|
|
1044
1295
|
if (suppressDeletedCallTarget(options.recordResolutionOutcome, parsed.filePath, site, memberDef)) {
|
|
1045
1296
|
handledSites.add(siteKey);
|
|
@@ -1063,11 +1314,23 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
1063
1314
|
if (typeRef !== undefined && typeRef.rawName.includes('.')) {
|
|
1064
1315
|
const [nsName, ...classNameParts] = typeRef.rawName.split('.');
|
|
1065
1316
|
const className = classNameParts.join('.');
|
|
1066
|
-
|
|
1317
|
+
// With the chain walk the dotted type is resolved as a whole
|
|
1318
|
+
// (`x: mod.Outer.Inner`, `t: hub.sub.Thing`); the candidate list then
|
|
1319
|
+
// has one entry or none. Without it: the historical one-hop split.
|
|
1320
|
+
const chainDef3 = walkChains
|
|
1321
|
+
? resolveNamespaceQualifiedClass(typeRef.rawName, site.inScope, namespaceTargets)
|
|
1322
|
+
: undefined;
|
|
1323
|
+
const targetFiles3 = walkChains
|
|
1324
|
+
? chainDef3 === undefined
|
|
1325
|
+
? undefined
|
|
1326
|
+
: [chainDef3.filePath]
|
|
1327
|
+
: namespaceTargets.get(nsName);
|
|
1067
1328
|
if (targetFiles3 !== undefined && className.length > 0) {
|
|
1068
1329
|
let found3 = false;
|
|
1069
1330
|
for (const targetFile3 of targetFiles3) {
|
|
1070
|
-
const classDef3 =
|
|
1331
|
+
const classDef3 = walkChains
|
|
1332
|
+
? chainDef3
|
|
1333
|
+
: lookupNamespaceMember(targetFile3, className);
|
|
1071
1334
|
if (classDef3 !== undefined) {
|
|
1072
1335
|
const picked = site.kind === 'call'
|
|
1073
1336
|
? pickOverload(classDef3.nodeId, memberName, site, model, provider)
|
|
@@ -1085,7 +1348,12 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
1085
1348
|
found3 = true;
|
|
1086
1349
|
break;
|
|
1087
1350
|
}
|
|
1088
|
-
const ok = tryEmitEdge(graph, scopes, nodeLookup, site, memberDef,
|
|
1351
|
+
const ok = tryEmitEdge(graph, scopes, nodeLookup, site, memberDef,
|
|
1352
|
+
// Same marker rule as Case 1 / Case 2: a constructor-form site
|
|
1353
|
+
// reached through a dotted type binding keeps its
|
|
1354
|
+
// ` (constructor)` suffix when the provider opted in; for
|
|
1355
|
+
// every other provider the string is unchanged.
|
|
1356
|
+
constructionSiteReason(memberDef.filePath !== parsed.filePath ? 'import-resolved' : 'global', site, provider.markConstructionSites), seen,
|
|
1089
1357
|
// Explicit defaults so the trailing capture ctx (#2227 U2) can
|
|
1090
1358
|
// be threaded without changing dedup/confidence behavior.
|
|
1091
1359
|
0.85, false, calleeCapture);
|
|
@@ -25,6 +25,7 @@ import { cobolScopeResolver } from '../../languages/cobol/scope-resolver.js';
|
|
|
25
25
|
import { swiftScopeResolver } from '../../languages/swift/scope-resolver.js';
|
|
26
26
|
import { dartScopeResolver } from '../../languages/dart/scope-resolver.js';
|
|
27
27
|
import { vueScopeResolver } from '../../languages/vue/scope-resolver.js';
|
|
28
|
+
import { zigScopeResolver } from '../../languages/zig/scope-resolver.js';
|
|
28
29
|
/** Map of `SupportedLanguages` → `ScopeResolver`. The scope-resolution phase
|
|
29
30
|
* iterates this map directly — every registered resolver runs. This is the
|
|
30
31
|
* single source of truth for which languages resolve via scope-resolution. */
|
|
@@ -45,4 +46,5 @@ export const SCOPE_RESOLVERS = new Map([
|
|
|
45
46
|
[SupportedLanguages.Swift, swiftScopeResolver],
|
|
46
47
|
[SupportedLanguages.Dart, dartScopeResolver],
|
|
47
48
|
[SupportedLanguages.Vue, vueScopeResolver],
|
|
49
|
+
[SupportedLanguages.Zig, zigScopeResolver],
|
|
48
50
|
]);
|
|
@@ -49,7 +49,7 @@ import { emitReturnShapeMemberAccesses } from '../passes/return-shape-members.js
|
|
|
49
49
|
import { emitImportedValueReferences } from '../passes/imported-value-refs.js';
|
|
50
50
|
import { createCalleeIdAccumulator, } from '../graph-bridge/callee-id-sink.js';
|
|
51
51
|
import { emitImportEdges } from '../graph-bridge/imports-to-edges.js';
|
|
52
|
-
import { callableFlowSiteKey,
|
|
52
|
+
import { callableFlowSiteKey, collectDeferredIndirectCollection, emitCallableValueFlow, } from '../passes/callable-value-flow.js';
|
|
53
53
|
import { findEnclosingClassDef, resolveInheritanceBaseInScope } from '../scope/walkers.js';
|
|
54
54
|
import { heritageTypeArgumentsKey, } from '../utils/generic-instantiation.js';
|
|
55
55
|
import { buildWorkspaceResolutionIndex } from '../workspace-index.js';
|
|
@@ -614,7 +614,8 @@ export function runScopeResolution(input, provider) {
|
|
|
614
614
|
// ── Phase 4: emit graph edges (LOAD-BEARING ORDER — see I1) ────────────
|
|
615
615
|
input.onProgress?.('linking symbols', files.length, files.length);
|
|
616
616
|
const handledSites = new Set(preEmittedInheritanceSites);
|
|
617
|
-
const
|
|
617
|
+
const deferredIndirectCollection = collectDeferredIndirectCollection(emitParsedFiles, indexes);
|
|
618
|
+
const deferredIndirectSites = deferredIndirectCollection.sites;
|
|
618
619
|
const callableArgumentSites = new Set();
|
|
619
620
|
if (input.pdg !== true && deferredIndirectSites.size > 0) {
|
|
620
621
|
for (const parsed of emitParsedFiles) {
|
|
@@ -673,6 +674,7 @@ export function runScopeResolution(input, provider) {
|
|
|
673
674
|
: emitFreeCallFallback(graph, indexes, emitParsedFiles, postHeritageNodeLookup, referenceIndex, handledSites, readonlyModel, workspaceIndex, {
|
|
674
675
|
allowGlobalFallback: provider.allowGlobalFreeCallFallback === true,
|
|
675
676
|
constructorCallTargetsClass: provider.constructorCallTargetsClass === true,
|
|
677
|
+
markConstructionSites: provider.markConstructionSites === true,
|
|
676
678
|
isFileLocalDef: provider.isFileLocalDef,
|
|
677
679
|
isBuiltInName: provider.languageProvider.isBuiltInName,
|
|
678
680
|
freeCallsRequireInstanceOwnership: provider.freeCallsRequireInstanceOwnership === true,
|
|
@@ -696,7 +698,7 @@ export function runScopeResolution(input, provider) {
|
|
|
696
698
|
// function-local", which is also what an uninspected repo means, and
|
|
697
699
|
// both correctly emit. See the build site above for why the earlier
|
|
698
700
|
// allowlist could not be made safe this way.
|
|
699
|
-
functionLocalValueDefIds);
|
|
701
|
+
functionLocalValueDefIds, { markConstructionSites: provider.markConstructionSites === true });
|
|
700
702
|
// Last-resort property resolution by workspace-unique name (A1/A5). Runs
|
|
701
703
|
// after every precise pass and only sees what they left behind, so a
|
|
702
704
|
// scope-resolved target always wins. Sites the generic bridge already
|
|
@@ -788,6 +790,8 @@ export function runScopeResolution(input, provider) {
|
|
|
788
790
|
collapseByCallerTarget: provider.collapseMemberCallsByCallerTarget === true,
|
|
789
791
|
isCallableValueTarget: provider.isCallableValueTarget,
|
|
790
792
|
hasFileLocalCallableLinkage: provider.hasFileLocalCallableLinkage,
|
|
793
|
+
deferredIndirectSites,
|
|
794
|
+
callSignaturesBySite: deferredIndirectCollection.callSignaturesBySite,
|
|
791
795
|
onWarn: (warning) => logger.warn(warning, 'callable-value-flow: candidate set exceeded the cap; no partial CALLS emitted'),
|
|
792
796
|
});
|
|
793
797
|
const importsEmitted = callableFlowOnly
|