gitnexus 1.6.6-rc.99 → 1.6.6
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 +122 -68
- package/dist/_shared/graph/types.d.ts +17 -1
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +3 -5
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +2 -4
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +24 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +13 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js +6 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts +29 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +9 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +1 -1
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +35 -1
- package/dist/cli/ai-context.js +111 -12
- package/dist/cli/analyze-config.d.ts +92 -0
- package/dist/cli/analyze-config.js +364 -0
- package/dist/cli/analyze.d.ts +17 -1
- package/dist/cli/analyze.js +224 -71
- package/dist/cli/cli-message.d.ts +1 -1
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/i18n/en.d.ts +2 -2
- package/dist/cli/i18n/en.js +2 -2
- package/dist/cli/i18n/resources.d.ts +2 -2
- package/dist/cli/i18n/zh-CN.js +2 -2
- package/dist/cli/index.js +4 -2
- package/dist/cli/resolve-invocation.d.ts +21 -0
- package/dist/cli/resolve-invocation.js +68 -0
- package/dist/cli/setup.d.ts +33 -0
- package/dist/cli/setup.js +96 -35
- package/dist/cli/skill-gen.js +2 -2
- package/dist/cli/wiki.js +20 -4
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +14 -1
- package/dist/core/embeddings/runtime-support.d.ts +41 -0
- package/dist/core/embeddings/runtime-support.js +65 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +2 -1
- package/dist/core/group/extractors/http-patterns/java.js +15 -1
- package/dist/core/ingestion/call-processor.d.ts +57 -227
- package/dist/core/ingestion/call-processor.js +172 -2595
- package/dist/core/ingestion/call-routing.d.ts +6 -5
- package/dist/core/ingestion/call-routing.js +6 -6
- package/dist/core/ingestion/call-types.d.ts +0 -75
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +26 -1
- package/dist/core/ingestion/class-extractors/configs/ruby.js +3 -0
- package/dist/core/ingestion/class-extractors/generic.js +9 -11
- package/dist/core/ingestion/class-types.d.ts +23 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +11 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +227 -73
- package/dist/core/ingestion/cobol-processor.d.ts +1 -0
- package/dist/core/ingestion/cobol-processor.js +51 -2
- package/dist/core/ingestion/emit-references.js +8 -2
- package/dist/core/ingestion/export-detection.d.ts +2 -1
- package/dist/core/ingestion/export-detection.js +2 -6
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +0 -6
- package/dist/core/ingestion/field-extractors/configs/dart.js +62 -44
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +0 -9
- package/dist/core/ingestion/field-extractors/configs/go.js +40 -1
- package/dist/core/ingestion/field-extractors/configs/jvm.js +43 -4
- package/dist/core/ingestion/field-extractors/configs/php.js +1 -2
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +12 -1
- package/dist/core/ingestion/field-extractors/configs/swift.js +31 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +6 -0
- package/dist/core/ingestion/field-extractors/generic.js +5 -4
- package/dist/core/ingestion/field-extractors/typescript.js +0 -29
- package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
- package/dist/core/ingestion/filesystem-walker.js +0 -11
- package/dist/core/ingestion/finalize-orchestrator.js +14 -2
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +21 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +72 -11
- package/dist/core/ingestion/import-resolvers/python.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.d.ts +2 -2
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/utils.d.ts +2 -5
- package/dist/core/ingestion/import-resolvers/utils.js +1 -9
- package/dist/core/ingestion/language-provider.d.ts +39 -119
- package/dist/core/ingestion/language-provider.js +0 -2
- package/dist/core/ingestion/languages/c/capture-side-channel.d.ts +62 -0
- package/dist/core/ingestion/languages/c/capture-side-channel.js +65 -0
- package/dist/core/ingestion/languages/c/captures.js +41 -23
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +9 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +15 -0
- package/dist/core/ingestion/languages/c/import-target.js +52 -9
- package/dist/core/ingestion/languages/c/index.d.ts +2 -1
- package/dist/core/ingestion/languages/c/index.js +2 -1
- package/dist/core/ingestion/languages/c/query.js +15 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +47 -4
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +8 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +46 -1
- package/dist/core/ingestion/languages/c-cpp.js +16 -7
- package/dist/core/ingestion/languages/cobol/captures.js +25 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +88 -4
- package/dist/core/ingestion/languages/cpp/adl.js +380 -160
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +2 -8
- package/dist/core/ingestion/languages/cpp/capture-side-channel.d.ts +65 -0
- package/dist/core/ingestion/languages/cpp/capture-side-channel.js +78 -0
- package/dist/core/ingestion/languages/cpp/captures.js +162 -54
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +18 -52
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +49 -1
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +7 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +12 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +1 -0
- package/dist/core/ingestion/languages/cpp/index.js +1 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +21 -0
- package/dist/core/ingestion/languages/cpp/query.js +21 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +20 -5
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +52 -5
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +83 -3
- package/dist/core/ingestion/languages/csharp/captures.js +205 -41
- package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
- package/dist/core/ingestion/languages/csharp/index.js +3 -4
- package/dist/core/ingestion/languages/csharp/interpret.js +17 -3
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +17 -7
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +129 -124
- package/dist/core/ingestion/languages/csharp/qualified-type-names.d.ts +14 -0
- package/dist/core/ingestion/languages/csharp/qualified-type-names.js +59 -0
- package/dist/core/ingestion/languages/csharp/query.js +13 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +10 -6
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -1
- package/dist/core/ingestion/languages/csharp.js +0 -5
- package/dist/core/ingestion/languages/dart/arity-metadata.d.ts +25 -0
- package/dist/core/ingestion/languages/dart/arity-metadata.js +35 -0
- package/dist/core/ingestion/languages/dart/arity.d.ts +19 -0
- package/dist/core/ingestion/languages/dart/arity.js +31 -0
- package/dist/core/ingestion/languages/dart/built-ins.d.ts +11 -0
- package/dist/core/ingestion/languages/dart/built-ins.js +34 -0
- package/dist/core/ingestion/languages/dart/cache-stats.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/cache-stats.js +24 -0
- package/dist/core/ingestion/languages/dart/captures.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/captures.js +445 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.js +31 -0
- package/dist/core/ingestion/languages/dart/import-target.d.ts +15 -0
- package/dist/core/ingestion/languages/dart/import-target.js +65 -0
- package/dist/core/ingestion/languages/dart/index.d.ts +28 -0
- package/dist/core/ingestion/languages/dart/index.js +28 -0
- package/dist/core/ingestion/languages/dart/interpret.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/interpret.js +95 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.d.ts +10 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.js +39 -0
- package/dist/core/ingestion/languages/dart/query.d.ts +26 -0
- package/dist/core/ingestion/languages/dart/query.js +142 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.js +87 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.js +194 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.d.ts +23 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.js +51 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.d.ts +20 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.js +47 -0
- package/dist/core/ingestion/languages/dart.d.ts +0 -1
- package/dist/core/ingestion/languages/dart.js +15 -29
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +1 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +31 -1
- package/dist/core/ingestion/languages/go/captures.js +162 -3
- package/dist/core/ingestion/languages/go/interface-impls.js +476 -50
- package/dist/core/ingestion/languages/go/interpret.js +21 -11
- package/dist/core/ingestion/languages/go/method-owners.js +20 -8
- package/dist/core/ingestion/languages/go/query.js +15 -7
- package/dist/core/ingestion/languages/go/range-binding.js +24 -9
- package/dist/core/ingestion/languages/go/receiver-binding.js +1 -1
- package/dist/core/ingestion/languages/go/scope-resolver.js +2 -2
- package/dist/core/ingestion/languages/go/simple-hooks.js +10 -5
- package/dist/core/ingestion/languages/go/type-binding.d.ts +1 -0
- package/dist/core/ingestion/languages/go/type-binding.js +40 -2
- package/dist/core/ingestion/languages/go.d.ts +0 -1
- package/dist/core/ingestion/languages/go.js +0 -5
- package/dist/core/ingestion/languages/index.d.ts +0 -5
- package/dist/core/ingestion/languages/index.js +0 -3
- package/dist/core/ingestion/languages/java/captures.js +252 -23
- package/dist/core/ingestion/languages/java/interpret.js +12 -6
- package/dist/core/ingestion/languages/java/package-siblings.js +18 -5
- package/dist/core/ingestion/languages/java/query.js +16 -1
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +2 -8
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -8
- package/dist/core/ingestion/languages/java.js +0 -5
- package/dist/core/ingestion/languages/javascript/captures.js +185 -11
- package/dist/core/ingestion/languages/javascript/query.js +107 -1
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +57 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +60 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +213 -22
- package/dist/core/ingestion/languages/kotlin/companion-scopes.d.ts +7 -0
- package/dist/core/ingestion/languages/kotlin/companion-scopes.js +10 -0
- package/dist/core/ingestion/languages/kotlin/index.d.ts +1 -0
- package/dist/core/ingestion/languages/kotlin/index.js +1 -0
- package/dist/core/ingestion/languages/kotlin/query.js +30 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.d.ts +5 -7
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +22 -7
- package/dist/core/ingestion/languages/kotlin.js +8 -5
- package/dist/core/ingestion/languages/php/captures.js +135 -19
- package/dist/core/ingestion/languages/php/import-decomposer.js +21 -63
- package/dist/core/ingestion/languages/php/index.d.ts +3 -4
- package/dist/core/ingestion/languages/php/index.js +3 -4
- package/dist/core/ingestion/languages/php/query.js +5 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +8 -4
- package/dist/core/ingestion/languages/php.js +0 -4
- package/dist/core/ingestion/languages/python/captures.js +128 -13
- package/dist/core/ingestion/languages/python/depends-references.js +1 -1
- package/dist/core/ingestion/languages/python/import-target.d.ts +4 -5
- package/dist/core/ingestion/languages/python/import-target.js +108 -16
- package/dist/core/ingestion/languages/python/index-stats.d.ts +18 -0
- package/dist/core/ingestion/languages/python/index-stats.js +25 -0
- package/dist/core/ingestion/languages/python/index.d.ts +3 -4
- package/dist/core/ingestion/languages/python/index.js +3 -4
- package/dist/core/ingestion/languages/python/query.js +17 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +7 -6
- package/dist/core/ingestion/languages/python.d.ts +0 -2
- package/dist/core/ingestion/languages/python.js +0 -7
- package/dist/core/ingestion/languages/ruby/captures.js +174 -31
- package/dist/core/ingestion/languages/ruby/import-target.js +2 -1
- package/dist/core/ingestion/languages/ruby/interpret.js +2 -1
- package/dist/core/ingestion/languages/ruby/query.js +10 -0
- package/dist/core/ingestion/languages/ruby/scope-resolver.js +61 -11
- package/dist/core/ingestion/languages/ruby.js +4 -53
- package/dist/core/ingestion/languages/rust/captures.js +95 -13
- package/dist/core/ingestion/languages/rust/query.js +64 -1
- package/dist/core/ingestion/languages/rust/range-binding.js +40 -12
- package/dist/core/ingestion/languages/rust/receiver-binding.js +9 -0
- package/dist/core/ingestion/languages/rust/scope-resolver.js +75 -1
- package/dist/core/ingestion/languages/rust.d.ts +0 -2
- package/dist/core/ingestion/languages/rust.js +0 -6
- package/dist/core/ingestion/languages/swift/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/arity-metadata.js +41 -0
- package/dist/core/ingestion/languages/swift/arity.d.ts +29 -0
- package/dist/core/ingestion/languages/swift/arity.js +42 -0
- package/dist/core/ingestion/languages/swift/base-type.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/base-type.js +27 -0
- package/dist/core/ingestion/languages/swift/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/swift/captures.d.ts +35 -0
- package/dist/core/ingestion/languages/swift/captures.js +495 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.js +57 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.js +84 -0
- package/dist/core/ingestion/languages/swift/import-target.d.ts +33 -0
- package/dist/core/ingestion/languages/swift/import-target.js +81 -0
- package/dist/core/ingestion/languages/swift/index.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/index.js +37 -0
- package/dist/core/ingestion/languages/swift/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/interpret.js +89 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.js +48 -0
- package/dist/core/ingestion/languages/swift/query.d.ts +46 -0
- package/dist/core/ingestion/languages/swift/query.js +194 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.d.ts +40 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.js +161 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.js +189 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.js +65 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.d.ts +25 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.js +66 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.js +60 -0
- package/dist/core/ingestion/languages/swift/target-grouping.d.ts +51 -0
- package/dist/core/ingestion/languages/swift/target-grouping.js +93 -0
- package/dist/core/ingestion/languages/swift/target-siblings.d.ts +30 -0
- package/dist/core/ingestion/languages/swift/target-siblings.js +71 -0
- package/dist/core/ingestion/languages/swift.d.ts +0 -5
- package/dist/core/ingestion/languages/swift.js +11 -87
- package/dist/core/ingestion/languages/typescript/array-callback.d.ts +3 -29
- package/dist/core/ingestion/languages/typescript/array-callback.js +4 -43
- package/dist/core/ingestion/languages/typescript/captures.js +147 -17
- package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
- package/dist/core/ingestion/languages/typescript/index.js +3 -4
- package/dist/core/ingestion/languages/typescript/query.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript/query.js +125 -4
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +0 -1
- package/dist/core/ingestion/languages/typescript.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript.js +46 -23
- package/dist/core/ingestion/languages/vue/captures.d.ts +46 -0
- package/dist/core/ingestion/languages/vue/captures.js +67 -0
- package/dist/core/ingestion/languages/vue/import-target.d.ts +27 -0
- package/dist/core/ingestion/languages/vue/import-target.js +58 -0
- package/dist/core/ingestion/languages/vue/index.d.ts +49 -0
- package/dist/core/ingestion/languages/vue/index.js +49 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.d.ts +55 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.js +292 -0
- package/dist/core/ingestion/languages/vue.js +12 -4
- package/dist/core/ingestion/local-symbol-pruner.d.ts +11 -0
- package/dist/core/ingestion/local-symbol-pruner.js +63 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +14 -1
- package/dist/core/ingestion/method-extractors/configs/jvm.js +37 -20
- package/dist/core/ingestion/method-extractors/configs/php.js +0 -1
- package/dist/core/ingestion/method-extractors/configs/swift.js +11 -4
- package/dist/core/ingestion/method-types.d.ts +2 -2
- package/dist/core/ingestion/model/index.d.ts +0 -3
- package/dist/core/ingestion/model/index.js +0 -8
- package/dist/core/ingestion/model/resolve.d.ts +7 -43
- package/dist/core/ingestion/model/resolve.js +7 -226
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +46 -1
- package/dist/core/ingestion/model/semantic-model.d.ts +4 -6
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +3 -4
- package/dist/core/ingestion/model/symbol-table.js +3 -4
- package/dist/core/ingestion/parsing-processor.d.ts +30 -24
- package/dist/core/ingestion/parsing-processor.js +76 -640
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/communities.js +5 -2
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +9 -8
- package/dist/core/ingestion/pipeline-phases/cross-file.js +16 -12
- 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/mro.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/mro.js +2 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +44 -22
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +426 -565
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +13 -33
- package/dist/core/ingestion/pipeline-phases/parse.js +2 -2
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +5 -3
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.d.ts +14 -0
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.js +26 -0
- package/dist/core/ingestion/pipeline.d.ts +27 -19
- package/dist/core/ingestion/pipeline.js +4 -2
- package/dist/core/ingestion/resolve-references.js +15 -3
- package/dist/core/ingestion/route-extractors/laravel.d.ts +10 -0
- package/dist/core/ingestion/route-extractors/laravel.js +88 -9
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +2 -1
- package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
- package/dist/core/ingestion/scope-extractor.js +13 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +181 -15
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +21 -10
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +10 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +7 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +58 -6
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +24 -5
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +68 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +189 -29
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +21 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1 -1
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +8 -11
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +171 -50
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +3 -4
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +9 -4
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +28 -5
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +191 -24
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +31 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +72 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +440 -39
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +18 -2
- package/dist/core/ingestion/scope-resolution/workspace-index.js +94 -7
- package/dist/core/ingestion/tree-sitter-queries.d.ts +14 -14
- package/dist/core/ingestion/tree-sitter-queries.js +380 -158
- package/dist/core/ingestion/ts-js-hoc-utils.d.ts +12 -0
- package/dist/core/ingestion/ts-js-hoc-utils.js +105 -0
- package/dist/core/ingestion/type-env.d.ts +2 -1
- package/dist/core/ingestion/type-env.js +6 -8
- package/dist/core/ingestion/type-extractors/c-cpp.js +8 -10
- package/dist/core/ingestion/type-extractors/csharp.js +18 -34
- package/dist/core/ingestion/type-extractors/go.js +2 -10
- package/dist/core/ingestion/type-extractors/jvm.js +6 -5
- package/dist/core/ingestion/type-extractors/php.js +1 -1
- package/dist/core/ingestion/type-extractors/python.js +1 -1
- package/dist/core/ingestion/type-extractors/ruby.js +2 -2
- package/dist/core/ingestion/type-extractors/rust.js +0 -16
- package/dist/core/ingestion/type-extractors/shared.d.ts +2 -2
- package/dist/core/ingestion/type-extractors/shared.js +25 -11
- package/dist/core/ingestion/type-extractors/swift.js +5 -5
- package/dist/core/ingestion/type-extractors/types.d.ts +1 -1
- package/dist/core/ingestion/type-extractors/typescript.js +1 -1
- package/dist/core/ingestion/utils/ast-helpers.d.ts +119 -1
- package/dist/core/ingestion/utils/ast-helpers.js +260 -13
- package/dist/core/ingestion/utils/callable-labels.d.ts +13 -0
- package/dist/core/ingestion/utils/callable-labels.js +14 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.d.ts +10 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.js +30 -0
- package/dist/core/ingestion/utils/heap-probe.d.ts +20 -0
- package/dist/core/ingestion/utils/heap-probe.js +39 -0
- package/dist/core/ingestion/utils/heritage-marker.d.ts +33 -0
- package/dist/core/ingestion/utils/heritage-marker.js +41 -0
- package/dist/core/ingestion/utils/qualified-name.d.ts +37 -0
- package/dist/core/ingestion/utils/qualified-name.js +67 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +49 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +76 -62
- package/dist/core/ingestion/variable-extractors/configs/go.js +74 -7
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +35 -8
- package/dist/core/ingestion/variable-extractors/generic.js +40 -12
- package/dist/core/ingestion/variable-types.d.ts +9 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +97 -7
- package/dist/core/ingestion/vue-sfc-extractor.js +433 -11
- package/dist/core/ingestion/workers/parse-worker.d.ts +0 -11
- package/dist/core/ingestion/workers/parse-worker.js +358 -187
- package/dist/core/ingestion/workers/worker-pool.d.ts +78 -9
- package/dist/core/ingestion/workers/worker-pool.js +346 -49
- package/dist/core/lbug/csv-generator.js +20 -2
- package/dist/core/lbug/lbug-adapter.js +29 -10
- package/dist/core/lbug/native-check.js +17 -5
- package/dist/core/lbug/pool-adapter.d.ts +0 -19
- package/dist/core/lbug/pool-adapter.js +40 -77
- package/dist/core/lbug/query-result-utils.d.ts +19 -0
- package/dist/core/lbug/query-result-utils.js +28 -0
- package/dist/core/run-analyze.d.ts +9 -2
- package/dist/core/run-analyze.js +24 -3
- package/dist/core/tree-sitter/parser-loader.d.ts +13 -0
- package/dist/core/tree-sitter/parser-loader.js +4 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +70 -3
- package/dist/core/tree-sitter/safe-parse.js +214 -11
- package/dist/core/wiki/generator.js +13 -5
- package/dist/core/wiki/graph-queries.d.ts +3 -0
- package/dist/core/wiki/graph-queries.js +9 -1
- package/dist/core/wiki/llm-client.d.ts +1 -1
- package/dist/core/wiki/llm-client.js +7 -2
- package/dist/core/wiki/local-cli-client.d.ts +2 -1
- package/dist/core/wiki/local-cli-client.js +62 -4
- package/dist/mcp/compatible-stdio-transport.d.ts +3 -0
- package/dist/mcp/compatible-stdio-transport.js +22 -0
- package/dist/mcp/core/embedder.d.ts +1 -1
- package/dist/mcp/core/embedder.js +13 -1
- package/dist/mcp/local/local-backend.d.ts +37 -5
- package/dist/mcp/local/local-backend.js +227 -129
- package/dist/mcp/resources.js +3 -3
- package/dist/mcp/server.js +9 -1
- package/dist/storage/git.d.ts +11 -0
- package/dist/storage/git.js +30 -0
- package/dist/storage/parse-cache.d.ts +23 -1
- package/dist/storage/parse-cache.js +138 -32
- package/dist/storage/parsedfile-store.d.ts +142 -0
- package/dist/storage/parsedfile-store.js +367 -0
- package/dist/storage/repo-manager.d.ts +2 -1
- package/dist/storage/scope-index-store.d.ts +114 -0
- package/dist/storage/scope-index-store.js +236 -0
- package/dist/types/pipeline.d.ts +6 -3
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +2 -1
- package/hooks/claude/gitnexus-hook.cjs +2 -1
- package/hooks/claude/resolve-analyze-cmd.cjs +323 -0
- package/package.json +4 -5
- package/scripts/bench-scope-resolution.ts +1 -3
- package/scripts/cross-platform-tests.ts +4 -1
- package/skills/gitnexus-cli.md +8 -6
- package/skills/gitnexus-debugging.md +15 -15
- package/skills/gitnexus-exploring.md +11 -11
- package/skills/gitnexus-guide.md +1 -1
- package/skills/gitnexus-impact-analysis.md +10 -10
- package/skills/gitnexus-pr-review.md +19 -19
- package/skills/gitnexus-refactoring.md +25 -25
- package/web/assets/{agent-BRX-afm3.js → agent-EkX7webX.js} +156 -131
- package/web/assets/{architectureDiagram-UL44E2DR-B1oYB8-c.js → architectureDiagram-UL44E2DR-BoczH8cv.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-SPC6pgWI.js → chunk-LCXTWHL2-By5HB3b-.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-DZXr4Yv3.js → chunk-RG4AUYOV-BQE_DkpL.js} +1 -1
- package/web/assets/{classDiagram-KGZ6W3CR-BqpOj8L9.js → classDiagram-KGZ6W3CR-Dj_02GUH.js} +1 -1
- package/web/assets/{classDiagram-v2-72OJOZXJ-FmElywK2.js → classDiagram-v2-72OJOZXJ-D-NArMpf.js} +1 -1
- package/web/assets/{diagram-3NCE3AQN-BWtJXMDq.js → diagram-3NCE3AQN-VXtXDO95.js} +1 -1
- package/web/assets/{diagram-GF46GFSD-Hh-fChxU.js → diagram-GF46GFSD-B1qab2Ah.js} +1 -1
- package/web/assets/{diagram-QXG6HAR7-DYeQHxGU.js → diagram-QXG6HAR7-BSCHGzzT.js} +1 -1
- package/web/assets/{diagram-WEQXMOUZ-DYGU4T0y.js → diagram-WEQXMOUZ-DHtknmNT.js} +1 -1
- package/web/assets/{erDiagram-L5TCEMPS-bN3wlP2A.js → erDiagram-L5TCEMPS-Db-IYTmm.js} +1 -1
- package/web/assets/{flowDiagram-H6V6AXG4-YACVtF3-.js → flowDiagram-H6V6AXG4-BHDoyVoW.js} +1 -1
- package/web/assets/{index-BhnAdWTt.js → index-BR0IhgbR.js} +10 -10
- package/web/assets/{infoDiagram-3YFTVSEB-BWBzD28-.js → infoDiagram-3YFTVSEB-6h8wbWEe.js} +1 -1
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-B8qYT-j9.js → ishikawaDiagram-BNXS4ZKH-Dx2OkPk1.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-BeoPr5Tl.js → kanban-definition-75IXJCU3-CIIEZfqV.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CdLLN_so.js → mindmap-definition-2TDM6QVE-DUAqydRq.js} +1 -1
- package/web/assets/{pieDiagram-CU6KROY3-DEd2a_k_.js → pieDiagram-CU6KROY3-BntYuYZa.js} +1 -1
- package/web/assets/{requirementDiagram-JXO7QTGE-QNeTo5C_.js → requirementDiagram-JXO7QTGE-QCD6I29n.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-BHC7q7yJ.js → sequenceDiagram-VS2MUI6T-DScFwLz2.js} +1 -1
- package/web/assets/{stateDiagram-7D4R322I-KONnc2Px.js → stateDiagram-7D4R322I-AkRAm6Hl.js} +1 -1
- package/web/assets/{stateDiagram-v2-36443NZ5-C2QfuMlu.js → stateDiagram-v2-36443NZ5-BCK1vigR.js} +1 -1
- package/web/assets/{timeline-definition-O6YCAMPW-D4t4NJx1.js → timeline-definition-O6YCAMPW-BvpIVXjX.js} +1 -1
- package/web/assets/{vennDiagram-MWXL3ELB-6bctC9Yg.js → vennDiagram-MWXL3ELB-BYGWk6dK.js} +1 -1
- package/web/assets/{wardleyDiagram-CUQ6CDDI-BPZYNTvC.js → wardleyDiagram-CUQ6CDDI-Dk1z7H2T.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-lBI9O6DW.js → xychartDiagram-N2JHSOCM-2N6NCSWN.js} +1 -1
- package/web/index.html +1 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
- package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
- package/dist/core/ingestion/ast-cache.d.ts +0 -26
- package/dist/core/ingestion/ast-cache.js +0 -48
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +0 -13
- package/dist/core/ingestion/heritage-extractors/configs/go.js +0 -20
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +0 -18
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +0 -65
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +0 -23
- package/dist/core/ingestion/heritage-extractors/generic.js +0 -47
- package/dist/core/ingestion/heritage-processor.d.ts +0 -54
- package/dist/core/ingestion/heritage-processor.js +0 -367
- package/dist/core/ingestion/heritage-types.d.ts +0 -73
- package/dist/core/ingestion/heritage-types.js +0 -2
- package/dist/core/ingestion/import-processor.d.ts +0 -23
- package/dist/core/ingestion/import-processor.js +0 -377
- package/dist/core/ingestion/model/heritage-map.d.ts +0 -105
- package/dist/core/ingestion/model/heritage-map.js +0 -294
- package/dist/core/ingestion/model/resolution-context.d.ts +0 -93
- package/dist/core/ingestion/model/resolution-context.js +0 -337
- package/dist/core/ingestion/named-bindings/csharp.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/csharp.js +0 -37
- package/dist/core/ingestion/named-bindings/java.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/java.js +0 -29
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/kotlin.js +0 -36
- package/dist/core/ingestion/named-bindings/php.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/php.js +0 -61
- package/dist/core/ingestion/named-bindings/python.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/python.js +0 -49
- package/dist/core/ingestion/named-bindings/rust.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/rust.js +0 -66
- package/dist/core/ingestion/named-bindings/types.d.ts +0 -16
- package/dist/core/ingestion/named-bindings/types.js +0 -6
- package/dist/core/ingestion/named-bindings/typescript.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/typescript.js +0 -58
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +0 -17
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +0 -209
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +0 -70
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +0 -312
- package/dist/core/ingestion/registry-primary-flag.d.ts +0 -89
- package/dist/core/ingestion/registry-primary-flag.js +0 -122
- package/dist/core/ingestion/shadow-harness.d.ts +0 -113
- package/dist/core/ingestion/shadow-harness.js +0 -148
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +0 -52
- package/dist/core/ingestion/utils/ruby-self-call.js +0 -59
- package/scripts/ci-list-migrated-languages.ts +0 -24
- package/scripts/run-parity.ts +0 -128
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Plan: `docs/plans/2026-04-20-001-refactor-emit-pipeline-generalization-plan.md`.
|
|
24
24
|
*/
|
|
25
|
+
import { generateId } from '../../../../lib/utils.js';
|
|
25
26
|
import { lookupOwnedMembersByOwner } from '../../model/owned-members-lookup.js';
|
|
26
27
|
import { reconcileOwnership, validateOwnershipParity } from './reconcile-ownership.js';
|
|
27
28
|
import { validateBindingsImmutability } from './validate-bindings-immutability.js';
|
|
@@ -31,15 +32,47 @@ import { resolveReferenceSites } from '../../resolve-references.js';
|
|
|
31
32
|
import { buildGraphNodeLookup } from '../graph-bridge/node-lookup.js';
|
|
32
33
|
import { resolveDefGraphId } from '../graph-bridge/ids.js';
|
|
33
34
|
import { buildPopulatedMethodDispatch } from '../graph-bridge/method-dispatch.js';
|
|
34
|
-
import { tryEmitEdge } from '../graph-bridge/edges.js';
|
|
35
35
|
import { propagateImportedReturnTypes } from '../passes/imported-return-types.js';
|
|
36
36
|
import { emitReceiverBoundCalls } from '../passes/receiver-bound-calls.js';
|
|
37
37
|
import { emitFreeCallFallback } from '../passes/free-call-fallback.js';
|
|
38
38
|
import { emitReferencesViaLookup } from '../graph-bridge/references-to-edges.js';
|
|
39
39
|
import { emitImportEdges } from '../graph-bridge/imports-to-edges.js';
|
|
40
|
-
import {
|
|
40
|
+
import { findEnclosingClassDef, resolveInheritanceBaseInScope } from '../scope/walkers.js';
|
|
41
41
|
import { buildWorkspaceResolutionIndex } from '../workspace-index.js';
|
|
42
|
+
import { logHeapProbe } from '../../utils/heap-probe.js';
|
|
43
|
+
import { parseTruthyEnv } from '../../utils/env.js';
|
|
44
|
+
import { TransitionalScopeTree } from '../../../../storage/scope-index-store.js';
|
|
45
|
+
import { forceGc } from '../../../../storage/parsedfile-store.js';
|
|
42
46
|
import { logger } from '../../../logger.js';
|
|
47
|
+
/**
|
|
48
|
+
* Emit one class-owned inheritance edge directly (the inheritance pre-pass is
|
|
49
|
+
* the authoritative emitter — see `preEmitInheritanceEdges`). Encapsulates the
|
|
50
|
+
* dual dedup contract so the two sets' joint semantics live in one place:
|
|
51
|
+
* - `existing` — coarse per-`(caller, target, type)` gate, seeded from the
|
|
52
|
+
* graph (so this pass is a no-op when the legacy path already emitted it).
|
|
53
|
+
* - `seen` — per-site key shared with the generic edge bridge so the two
|
|
54
|
+
* passes never double-emit the same resolution.
|
|
55
|
+
* The `dedupKey` and `rel:` id shape match `tryEmitEdge` exactly, so graph
|
|
56
|
+
* output stays byte-identical. The caller is the enclosing class (NOT the
|
|
57
|
+
* method/constructor `resolveCallerGraphId` would prefer — that broke MRO for
|
|
58
|
+
* C# 12 primary constructors, #1951); the edge type is pre-discriminated.
|
|
59
|
+
*/
|
|
60
|
+
function emitInheritanceEdgeDirect(graph, seen, existing, callerGraphId, targetGraphId, edgeType, site) {
|
|
61
|
+
const edgeKey = `${edgeType}:${callerGraphId}->${targetGraphId}`;
|
|
62
|
+
const dedupKey = `${edgeKey}:${site.atRange.startLine}:${site.atRange.startCol}`;
|
|
63
|
+
if (existing.has(edgeKey) || seen.has(dedupKey))
|
|
64
|
+
return;
|
|
65
|
+
seen.add(dedupKey);
|
|
66
|
+
existing.add(edgeKey);
|
|
67
|
+
graph.addRelationship({
|
|
68
|
+
id: `rel:${dedupKey}`,
|
|
69
|
+
sourceId: callerGraphId,
|
|
70
|
+
targetId: targetGraphId,
|
|
71
|
+
type: edgeType,
|
|
72
|
+
confidence: 0.85,
|
|
73
|
+
reason: 'scope-resolution: inherits',
|
|
74
|
+
});
|
|
75
|
+
}
|
|
43
76
|
/**
|
|
44
77
|
* Resolve inheritance reference sites early and pre-emit their EXTENDS edges
|
|
45
78
|
* before MRO construction. This lets template-base captures contribute to the
|
|
@@ -51,10 +84,12 @@ import { logger } from '../../../logger.js';
|
|
|
51
84
|
function preEmitInheritanceEdges(graph, scopes, nodeLookup) {
|
|
52
85
|
const handledSites = new Set();
|
|
53
86
|
const seen = new Set();
|
|
87
|
+
// Tracks inheritance edges emitted during this pass so the structural
|
|
88
|
+
// interface-implementation pass (emitDetectedInterfaceImplementations) and
|
|
89
|
+
// repeated `inherits` sites don't double-emit. Starts empty: this pre-pass is
|
|
90
|
+
// the authoritative inheritance emitter — no EXTENDS/IMPLEMENTS edges exist in
|
|
91
|
+
// the graph before it runs (the legacy heritage path was removed in #942).
|
|
54
92
|
const existing = new Set();
|
|
55
|
-
for (const rel of graph.iterRelationshipsByType('EXTENDS')) {
|
|
56
|
-
existing.add(`${rel.sourceId}->${rel.targetId}`);
|
|
57
|
-
}
|
|
58
93
|
for (const site of scopes.referenceSites) {
|
|
59
94
|
if (site.kind !== 'inherits')
|
|
60
95
|
continue;
|
|
@@ -68,28 +103,90 @@ function preEmitInheritanceEdges(graph, scopes, nodeLookup) {
|
|
|
68
103
|
// edge. The shared bridge resolves the source via
|
|
69
104
|
// `resolveCallerGraphId`, which can degrade class-heritage sites into
|
|
70
105
|
// method-owned EXTENDS edges once methods exist on the class. This
|
|
71
|
-
// pre-pass is the authoritative inheritance emitter
|
|
106
|
+
// pre-pass is the authoritative inheritance emitter and pins the source
|
|
107
|
+
// to the enclosing class (via the `callerGraphId` override below), so
|
|
72
108
|
// suppression keeps `buildMro` and the final graph class-owned.
|
|
73
109
|
handledSites.add(siteKey);
|
|
74
110
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
111
|
+
// Resolve the deriving (caller) class first and reuse it as the enclosing
|
|
112
|
+
// context for qualified-base resolution — avoids a second findEnclosingClassDef
|
|
113
|
+
// walk per qualified site (#1982 perf). Both need the same enclosing class.
|
|
78
114
|
const callerClass = findEnclosingClassDef(site.inScope, scopes);
|
|
79
115
|
if (callerClass === undefined)
|
|
80
116
|
continue;
|
|
117
|
+
const targetDef = resolveInheritanceBaseInScope(site.inScope, site.name, scopes, site.rawQualifiedName, callerClass);
|
|
118
|
+
if (targetDef === undefined)
|
|
119
|
+
continue;
|
|
81
120
|
const callerGraphId = resolveDefGraphId(callerClass.filePath, callerClass, nodeLookup);
|
|
82
121
|
const targetGraphId = resolveDefGraphId(targetDef.filePath, targetDef, nodeLookup);
|
|
83
122
|
if (callerGraphId === undefined || targetGraphId === undefined)
|
|
84
123
|
continue;
|
|
85
|
-
|
|
86
|
-
|
|
124
|
+
// Discriminate EXTENDS vs IMPLEMENTS by the resolved target's symbol kind:
|
|
125
|
+
// conforming to an interface OR mixing in a trait/protocol is IMPLEMENTS,
|
|
126
|
+
// deriving from a class-like is EXTENDS. The discriminator is purely
|
|
127
|
+
// symbol-kind-driven (no language is named here, per AGENTS.md): a base that
|
|
128
|
+
// resolves to neither an Interface nor a Trait symbol always takes the
|
|
129
|
+
// EXTENDS branch, so such languages are unchanged.
|
|
130
|
+
const edgeType = targetDef.type === 'Interface' || targetDef.type === 'Trait' ? 'IMPLEMENTS' : 'EXTENDS';
|
|
131
|
+
emitInheritanceEdgeDirect(graph, seen, existing, callerGraphId, targetGraphId, edgeType, site);
|
|
132
|
+
}
|
|
133
|
+
return handledSites;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Emit language-inferred structural interface implementations before MRO and
|
|
137
|
+
* interface dispatch are built. Languages such as Go do not declare
|
|
138
|
+
* `implements` explicitly, so their resolver can infer defId-level interface
|
|
139
|
+
* satisfaction from parsed files and this bridge converts those defIds to
|
|
140
|
+
* graph node ids.
|
|
141
|
+
*
|
|
142
|
+
* Existing explicit IMPLEMENTS edges win: the local `existing` set prevents
|
|
143
|
+
* duplicate structural edges and keeps this hook language-neutral. The reason
|
|
144
|
+
* string carries the provider language (`go-structural-implements`) so callers
|
|
145
|
+
* can distinguish inferred edges from source-declared heritage.
|
|
146
|
+
*/
|
|
147
|
+
function emitDetectedInterfaceImplementations(graph, parsedFiles, nodeLookup, provider, indexes, model) {
|
|
148
|
+
if (provider.detectInterfaceImplementations === undefined)
|
|
149
|
+
return 0;
|
|
150
|
+
const graphIdByDefId = new Map();
|
|
151
|
+
for (const parsed of parsedFiles) {
|
|
152
|
+
for (const def of parsed.localDefs) {
|
|
153
|
+
if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
|
|
154
|
+
continue;
|
|
155
|
+
const graphId = resolveDefGraphId(parsed.filePath, def, nodeLookup);
|
|
156
|
+
if (graphId !== undefined)
|
|
157
|
+
graphIdByDefId.set(def.nodeId, graphId);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const existing = new Set();
|
|
161
|
+
for (const rel of graph.iterRelationshipsByType('IMPLEMENTS')) {
|
|
162
|
+
existing.add(`${rel.sourceId}->${rel.targetId}`);
|
|
163
|
+
}
|
|
164
|
+
let emitted = 0;
|
|
165
|
+
const detected = provider.detectInterfaceImplementations(parsedFiles, indexes, model);
|
|
166
|
+
for (const [interfaceDefId, implementorDefIds] of detected) {
|
|
167
|
+
const targetId = graphIdByDefId.get(interfaceDefId);
|
|
168
|
+
if (targetId === undefined)
|
|
87
169
|
continue;
|
|
88
|
-
|
|
170
|
+
for (const implementorDefId of implementorDefIds) {
|
|
171
|
+
const sourceId = graphIdByDefId.get(implementorDefId);
|
|
172
|
+
if (sourceId === undefined)
|
|
173
|
+
continue;
|
|
174
|
+
const edgeKey = `${sourceId}->${targetId}`;
|
|
175
|
+
if (existing.has(edgeKey))
|
|
176
|
+
continue;
|
|
89
177
|
existing.add(edgeKey);
|
|
178
|
+
graph.addRelationship({
|
|
179
|
+
id: generateId('IMPLEMENTS', edgeKey),
|
|
180
|
+
sourceId,
|
|
181
|
+
targetId,
|
|
182
|
+
type: 'IMPLEMENTS',
|
|
183
|
+
confidence: 0.85,
|
|
184
|
+
reason: `${provider.language}-structural-implements`,
|
|
185
|
+
});
|
|
186
|
+
emitted++;
|
|
90
187
|
}
|
|
91
188
|
}
|
|
92
|
-
return
|
|
189
|
+
return emitted;
|
|
93
190
|
}
|
|
94
191
|
export function runScopeResolution(input, provider) {
|
|
95
192
|
const { graph, files } = input;
|
|
@@ -118,16 +215,20 @@ export function runScopeResolution(input, provider) {
|
|
|
118
215
|
let preExtractedHits = 0;
|
|
119
216
|
const progressInterval = files.length > 0 ? Math.max(1, Math.floor(files.length / 50)) : 1;
|
|
120
217
|
input.onProgress?.('extracting', 0, files.length);
|
|
218
|
+
logHeapProbe('sr-extract-start', `lang=${provider.language} files=${files.length}`);
|
|
121
219
|
for (let fileIdx = 0; fileIdx < files.length; fileIdx++) {
|
|
122
220
|
const file = files[fileIdx];
|
|
123
221
|
let parsed;
|
|
124
222
|
// Fast path: a worker (during the parse phase) already produced a
|
|
125
223
|
// ParsedFile for this file via `extractParsedFile`. Reuse it
|
|
126
224
|
// directly — skips a tree-sitter re-parse on the main thread.
|
|
225
|
+
let reusedPreExtracted = false;
|
|
127
226
|
if (preExtracted !== undefined) {
|
|
128
227
|
parsed = preExtracted.get(file.path);
|
|
129
|
-
if (parsed !== undefined)
|
|
228
|
+
if (parsed !== undefined) {
|
|
130
229
|
preExtractedHits++;
|
|
230
|
+
reusedPreExtracted = true;
|
|
231
|
+
}
|
|
131
232
|
}
|
|
132
233
|
if (parsed === undefined) {
|
|
133
234
|
const cachedTree = treeCache?.get(file.path);
|
|
@@ -137,16 +238,31 @@ export function runScopeResolution(input, provider) {
|
|
|
137
238
|
continue;
|
|
138
239
|
}
|
|
139
240
|
}
|
|
241
|
+
// Worker-boundary restore: a pre-extracted ParsedFile was produced by
|
|
242
|
+
// `extractParsedFile` running INSIDE a worker, so any capture-time
|
|
243
|
+
// module-level side-channel state (`emitScopeCaptures` side effects that
|
|
244
|
+
// are NOT serialized onto the ParsedFile's scopes/defs — C++ ADL/namespace
|
|
245
|
+
// marks) was populated in the worker process and is missing here. The
|
|
246
|
+
// worker stashed a plain-data snapshot on `parsed.captureSideChannel` (via
|
|
247
|
+
// `collectCaptureSideChannel`); write it back into the module maps now,
|
|
248
|
+
// BEFORE populateOwners consumes the resolved ranges. NO re-parse — that is
|
|
249
|
+
// the #1983 fix. The fresh-extract leg above already populated those marks
|
|
250
|
+
// in this process, so it skips the restore. See
|
|
251
|
+
// `ScopeResolver.applyCaptureSideChannel`.
|
|
252
|
+
if (reusedPreExtracted && provider.applyCaptureSideChannel !== undefined) {
|
|
253
|
+
provider.applyCaptureSideChannel(parsed);
|
|
254
|
+
}
|
|
140
255
|
provider.populateOwners(parsed);
|
|
141
256
|
parsedFiles.push(parsed);
|
|
142
|
-
if (
|
|
143
|
-
(
|
|
144
|
-
|
|
257
|
+
if ((fileIdx + 1) % progressInterval === 0 || fileIdx === files.length - 1) {
|
|
258
|
+
input.onProgress?.('extracting', fileIdx + 1, files.length);
|
|
259
|
+
logHeapProbe('sr-extract-progress', `lang=${provider.language} idx=${fileIdx + 1}/${files.length} parsedFiles=${parsedFiles.length} preExtractedHits=${preExtractedHits}`);
|
|
145
260
|
}
|
|
146
261
|
}
|
|
147
262
|
if (PROF && preExtracted !== undefined) {
|
|
148
263
|
logger.warn(`[scope-resolution prof] pre-extracted hits: ${preExtractedHits}/${files.length}`);
|
|
149
264
|
}
|
|
265
|
+
logHeapProbe('sr-extract-end', `lang=${provider.language} parsedFiles=${parsedFiles.length} preExtractedHits=${preExtractedHits} skipped=${filesSkipped}`);
|
|
150
266
|
provider.populateWorkspaceOwners?.(parsedFiles, { fileContents: getFileContents() });
|
|
151
267
|
// Reconcile scope-resolution's ownership view into the SemanticModel.
|
|
152
268
|
// See `reconcile-ownership.ts` for the full rationale (Contract
|
|
@@ -176,7 +292,9 @@ export function runScopeResolution(input, provider) {
|
|
|
176
292
|
// ── Phase 2: finalize → ScopeResolutionIndexes ─────────────────────────
|
|
177
293
|
input.onProgress?.('analyzing types', files.length, files.length);
|
|
178
294
|
const allFilePaths = new Set(parsedFiles.map((f) => f.filePath));
|
|
179
|
-
|
|
295
|
+
logHeapProbe('sr-pre-nodeLookup', `lang=${provider.language}`);
|
|
296
|
+
const nodeLookup = input.prebuiltNodeLookup ?? buildGraphNodeLookup(graph);
|
|
297
|
+
logHeapProbe('sr-post-nodeLookup', `lang=${provider.language}`);
|
|
180
298
|
const resolutionConfig = input.resolutionConfig;
|
|
181
299
|
const finalized = finalizeScopeModel(parsedFiles, {
|
|
182
300
|
hooks: {
|
|
@@ -185,13 +303,19 @@ export function runScopeResolution(input, provider) {
|
|
|
185
303
|
mergeBindings: (existing, incoming, scopeId) => provider.mergeBindings(existing, incoming, scopeId),
|
|
186
304
|
},
|
|
187
305
|
});
|
|
306
|
+
logHeapProbe('sr-post-finalize', `lang=${provider.language}`);
|
|
188
307
|
const preEmittedInheritanceSites = preEmitInheritanceEdges(graph, finalized, nodeLookup);
|
|
189
308
|
// Call-based heritage hook (e.g., Ruby include/extend/prepend) — emits
|
|
190
309
|
// IMPLEMENTS edges that `preEmitInheritanceEdges` cannot produce because
|
|
191
310
|
// the heritage declarations are syntactic method calls, not grammar-level
|
|
192
311
|
// heritage clauses. Must run BEFORE `buildMro` so MRO construction sees
|
|
193
312
|
// the freshly-emitted IMPLEMENTS edges.
|
|
194
|
-
provider.emitHeritageEdges?.(graph, parsedFiles, nodeLookup);
|
|
313
|
+
provider.emitHeritageEdges?.(graph, parsedFiles, nodeLookup, finalized);
|
|
314
|
+
// Implicit IMPORTS-edge hook — for languages whose files have compiler-
|
|
315
|
+
// implicit cross-file visibility (no syntactic import statement). The
|
|
316
|
+
// finalized-ImportEdge pipeline (`emitImportEdges`) cannot produce these
|
|
317
|
+
// because there is no `ImportEdge` to materialize. Idempotent.
|
|
318
|
+
provider.emitImplicitImportEdges?.(graph, parsedFiles, nodeLookup, resolutionConfig);
|
|
195
319
|
// Rebuild the node lookup after heritage-edge emission. Languages like
|
|
196
320
|
// Ruby create Property graph nodes inside `emitHeritageEdges`; those
|
|
197
321
|
// nodes must be visible to downstream passes (`emitReceiverBoundCalls`
|
|
@@ -199,6 +323,7 @@ export function runScopeResolution(input, provider) {
|
|
|
199
323
|
// `nodeLookup`). Without this rebuild, Property nodes added by the
|
|
200
324
|
// heritage hook are invisible and ACCESSES edges silently fail to emit.
|
|
201
325
|
const postHeritageNodeLookup = provider.emitHeritageEdges !== undefined ? buildGraphNodeLookup(graph) : nodeLookup;
|
|
326
|
+
emitDetectedInterfaceImplementations(graph, parsedFiles, postHeritageNodeLookup, provider, finalized, readonlyModel);
|
|
202
327
|
const mroByClassDefId = provider.buildMro(graph, parsedFiles, postHeritageNodeLookup);
|
|
203
328
|
const extendsOnlyMroByClassDefId = provider.buildExtendsOnlyMro?.(graph, parsedFiles, postHeritageNodeLookup);
|
|
204
329
|
// Replace the empty MethodDispatchIndex that finalizeScopeModel
|
|
@@ -216,7 +341,12 @@ export function runScopeResolution(input, provider) {
|
|
|
216
341
|
// cannot carry. Must run AFTER `populateOwners` (so owned defs are
|
|
217
342
|
// attributed correctly) and AFTER finalize (so module-scope
|
|
218
343
|
// bindings are available).
|
|
219
|
-
|
|
344
|
+
// Pass the scopeTree so the index's class/module Scope lookups are id-backed
|
|
345
|
+
// views that delegate to it (out-of-core scope index) — the index pins no Scope objects, so the
|
|
346
|
+
// disk seal can reclaim them. Byte-identical: the view returns the same Scope
|
|
347
|
+
// the resident tree holds (or a value-identical revived one in disk mode).
|
|
348
|
+
const workspaceIndex = buildWorkspaceResolutionIndex(parsedFiles, indexes.scopeTree);
|
|
349
|
+
logHeapProbe('sr-post-workspaceIndex', `lang=${provider.language}`);
|
|
220
350
|
// Cross-file implicit-namespace visibility (C#). Must run before
|
|
221
351
|
// propagateImportedReturnTypes so the latter pass sees siblings'
|
|
222
352
|
// class bindings when chasing return-type chains across files.
|
|
@@ -226,6 +356,7 @@ export function runScopeResolution(input, provider) {
|
|
|
226
356
|
provider.populateNamespaceSiblings(parsedFiles, indexes, {
|
|
227
357
|
fileContents: getFileContents(),
|
|
228
358
|
treeCache,
|
|
359
|
+
resolutionConfig,
|
|
229
360
|
});
|
|
230
361
|
}
|
|
231
362
|
const tFinalize = PROF ? process.hrtime.bigint() : 0n;
|
|
@@ -233,7 +364,7 @@ export function runScopeResolution(input, provider) {
|
|
|
233
364
|
// propagateImportedReturnTypes so the SCC-ordered pass sees the
|
|
234
365
|
// mirrored bindings.
|
|
235
366
|
if (provider.mirrorNamespaceTypeBindings !== undefined) {
|
|
236
|
-
provider.mirrorNamespaceTypeBindings(parsedFiles, indexes, workspaceIndex);
|
|
367
|
+
provider.mirrorNamespaceTypeBindings(parsedFiles, indexes, workspaceIndex, resolutionConfig);
|
|
237
368
|
}
|
|
238
369
|
// Cross-file return-type propagation (Contract Invariant I3 timing:
|
|
239
370
|
// after finalize, before resolve). Split-timed separately so the
|
|
@@ -268,17 +399,43 @@ export function runScopeResolution(input, provider) {
|
|
|
268
399
|
ownedMembersByOwner: (ownerDefId, memberName) => lookupOwnedMembersByOwner(readonlyModel, ownerDefId, memberName),
|
|
269
400
|
});
|
|
270
401
|
const tResolve = PROF ? process.hrtime.bigint() : 0n;
|
|
402
|
+
logHeapProbe('sr-post-resolve', `lang=${provider.language}`);
|
|
403
|
+
// ── Out-of-core scope seal boundary ─────────────────────────────────────
|
|
404
|
+
// Pass-A (finalize + propagate + resolve) is done; all whole-language reads
|
|
405
|
+
// of `Scope.bindings` are behind us. Emit reaches scopes ONLY via
|
|
406
|
+
// `scopeTree.getScope` (a point lookup), so seal the TransitionalScopeTree to
|
|
407
|
+
// disk now and drop the resident scopes. The scopes are pinned from THREE
|
|
408
|
+
// sides: (1) the model's frozen `scopeTree` — released by `seal()` nulling its
|
|
409
|
+
// resident backing from the inside; (2) `input.preExtractedParsedFiles` (held
|
|
410
|
+
// by the caller for its own post-run release) — released here since run.ts is
|
|
411
|
+
// its last reader after extract; (3) this function's `parsedFiles` — replaced
|
|
412
|
+
// by a scope-stripped copy that keeps only what emit reads (referenceSites /
|
|
413
|
+
// filePath / localDefs). All three released → the heavy payload is collectible.
|
|
414
|
+
let emitParsedFiles = parsedFiles;
|
|
415
|
+
if (input.scopeIndexStorePath !== undefined &&
|
|
416
|
+
parseTruthyEnv(process.env.GITNEXUS_DISK_SCOPE_INDEX) &&
|
|
417
|
+
indexes.scopeTree instanceof TransitionalScopeTree) {
|
|
418
|
+
logHeapProbe('sr-seal-pre', `lang=${provider.language}`);
|
|
419
|
+
indexes.scopeTree.seal(input.scopeIndexStorePath);
|
|
420
|
+
emitParsedFiles = parsedFiles.map((p) => ({ ...p, scopes: [] }));
|
|
421
|
+
parsedFiles.length = 0;
|
|
422
|
+
if (preExtracted !== undefined)
|
|
423
|
+
preExtracted.clear();
|
|
424
|
+
forceGc();
|
|
425
|
+
logHeapProbe('sr-seal-post', `lang=${provider.language}`);
|
|
426
|
+
}
|
|
271
427
|
// ── Phase 4: emit graph edges (LOAD-BEARING ORDER — see I1) ────────────
|
|
272
428
|
input.onProgress?.('linking symbols', files.length, files.length);
|
|
273
429
|
const handledSites = new Set(preEmittedInheritanceSites);
|
|
274
|
-
const receiverExtras = emitReceiverBoundCalls(graph, indexes,
|
|
430
|
+
const receiverExtras = emitReceiverBoundCalls(graph, indexes, emitParsedFiles, postHeritageNodeLookup, handledSites, provider, workspaceIndex, readonlyModel, {
|
|
275
431
|
recordResolutionOutcome,
|
|
276
432
|
});
|
|
277
433
|
const unresolvedReceiverExtras = provider.emitUnresolvedReceiverEdges !== undefined
|
|
278
|
-
? provider.emitUnresolvedReceiverEdges(graph, indexes,
|
|
434
|
+
? provider.emitUnresolvedReceiverEdges(graph, indexes, emitParsedFiles, postHeritageNodeLookup, handledSites, readonlyModel)
|
|
279
435
|
: 0;
|
|
280
|
-
const freeCallExtras = emitFreeCallFallback(graph, indexes,
|
|
436
|
+
const freeCallExtras = emitFreeCallFallback(graph, indexes, emitParsedFiles, postHeritageNodeLookup, referenceIndex, handledSites, readonlyModel, workspaceIndex, {
|
|
281
437
|
allowGlobalFallback: provider.allowGlobalFreeCallFallback === true,
|
|
438
|
+
constructorCallTargetsClass: provider.constructorCallTargetsClass === true,
|
|
282
439
|
isFileLocalDef: provider.isFileLocalDef,
|
|
283
440
|
isCallableVisibleFromCaller: provider.isCallableVisibleFromCaller,
|
|
284
441
|
resolveAdlCandidates: provider.resolveAdlCandidates,
|
|
@@ -288,6 +445,15 @@ export function runScopeResolution(input, provider) {
|
|
|
288
445
|
});
|
|
289
446
|
const { emitted, skipped } = emitReferencesViaLookup(graph, indexes, referenceIndex, postHeritageNodeLookup, handledSites);
|
|
290
447
|
const importsEmitted = emitImportEdges(graph, indexes.imports, indexes.scopeTree, provider.importEdgeReason);
|
|
448
|
+
// Language-specific supplementary edges (e.g. Vue template-derived
|
|
449
|
+
// BINDS_EVENT_HANDLER / EMITS_EVENT / CALLS / ACCESSES edges).
|
|
450
|
+
// Runs last so the full graph — including import edges — is visible.
|
|
451
|
+
if (provider.emitPostResolutionEdges !== undefined) {
|
|
452
|
+
provider.emitPostResolutionEdges(graph, emitParsedFiles, postHeritageNodeLookup, indexes, {
|
|
453
|
+
fileContents: getFileContents(),
|
|
454
|
+
resolutionConfig,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
291
457
|
if (PROF) {
|
|
292
458
|
const tEnd = process.hrtime.bigint();
|
|
293
459
|
const ns = (a, b) => Number(b - a) / 1_000_000;
|
|
@@ -299,6 +465,7 @@ export function runScopeResolution(input, provider) {
|
|
|
299
465
|
` total=${ns(tStart, tEnd).toFixed(0)}ms` +
|
|
300
466
|
` (${parsedFiles.length} files)`);
|
|
301
467
|
}
|
|
468
|
+
logHeapProbe('sr-end', `lang=${provider.language} parsedFiles=${parsedFiles.length}`);
|
|
302
469
|
return {
|
|
303
470
|
filesProcessed: parsedFiles.length,
|
|
304
471
|
filesSkipped,
|
|
@@ -74,5 +74,36 @@ export function validateBindingsImmutability(indexes, onWarn) {
|
|
|
74
74
|
violations++;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
// Fourth channel: `workspaceTypeBindings` (scope-independent global typeBindings,
|
|
78
|
+
// #1954). TypeRef-valued (no inner arrays), populated once by the hook then read
|
|
79
|
+
// through the walker fallback — assert the map itself stays mutable so the hook
|
|
80
|
+
// can populate it, mirroring the other shared channels.
|
|
81
|
+
if (Object.isFrozen(indexes.workspaceTypeBindings)) {
|
|
82
|
+
onWarn(`binding-immutability: indexes.workspaceTypeBindings is FROZEN — ` +
|
|
83
|
+
`the workspace type channel is populated post-finalize and must stay mutable. ` +
|
|
84
|
+
`See ScopeResolver Invariant I8.`);
|
|
85
|
+
violations++;
|
|
86
|
+
}
|
|
87
|
+
// Fifth/sixth channels: the per-namespace shared maps (#1871 named-namespace
|
|
88
|
+
// generalization). `namespaceFqnBindings` carries mutable BindingRef[] buckets
|
|
89
|
+
// (hooks `push()`); `namespaceTypeBindings` carries TypeRef values. Both are
|
|
90
|
+
// populated post-finalize; freezing an inner bucket/map defeats that.
|
|
91
|
+
for (const [ns, inner] of indexes.namespaceFqnBindings) {
|
|
92
|
+
for (const [name, bucket] of inner) {
|
|
93
|
+
if (Object.isFrozen(bucket)) {
|
|
94
|
+
onWarn(`binding-immutability: indexes.namespaceFqnBindings[${ns}][${name}] is FROZEN — ` +
|
|
95
|
+
`per-namespace buckets are mutable by contract. See ScopeResolver Invariant I8.`);
|
|
96
|
+
violations++;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (const [ns, inner] of indexes.namespaceTypeBindings) {
|
|
101
|
+
if (Object.isFrozen(inner)) {
|
|
102
|
+
onWarn(`binding-immutability: indexes.namespaceTypeBindings[${ns}] is FROZEN — ` +
|
|
103
|
+
`per-namespace type maps are populated post-finalize and must stay mutable. ` +
|
|
104
|
+
`See ScopeResolver Invariant I8.`);
|
|
105
|
+
violations++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
77
108
|
return violations;
|
|
78
109
|
}
|
|
@@ -81,6 +81,21 @@ export declare function isClassLike(t: string): boolean;
|
|
|
81
81
|
* exists in the chain.
|
|
82
82
|
*/
|
|
83
83
|
export declare function findReceiverTypeBinding(startScope: ScopeId, receiverName: string, scopes: ScopeResolutionIndexes): TypeRef | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Resolve a typeBinding for `name` from the per-namespace channel
|
|
86
|
+
* (`namespaceTypeBindings`) across the namespaces accessible from `moduleScopeId`.
|
|
87
|
+
* First accessible-namespace hit wins. Returns `undefined` when the module has no
|
|
88
|
+
* accessibility entry (non-module scope id, or a bundle that didn't populate the
|
|
89
|
+
* channel — all non-C# today). Shared by the two typeBindings chain-walkers so
|
|
90
|
+
* the named-namespace fallback stays identical between them.
|
|
91
|
+
*/
|
|
92
|
+
export declare function namespaceTypeBindingFor(moduleScopeId: ScopeId | null, name: string, scopes: ScopeResolutionIndexes): TypeRef | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Walk the scope chain from `startScope` to its enclosing Module scope id, or
|
|
95
|
+
* `null` if none is found. Used by chain-followers that need the module scope to
|
|
96
|
+
* consult the accessibility-gated per-namespace channels.
|
|
97
|
+
*/
|
|
98
|
+
export declare function moduleScopeIdOf(startScope: ScopeId, scopes: ScopeResolutionIndexes): ScopeId | null;
|
|
84
99
|
/**
|
|
85
100
|
* Look up a class-like binding by name in the given scope's chain.
|
|
86
101
|
*
|
|
@@ -99,6 +114,42 @@ export declare function findReceiverTypeBinding(startScope: ScopeId, receiverNam
|
|
|
99
114
|
* Without (2) we'd miss every cross-file class-receiver call.
|
|
100
115
|
*/
|
|
101
116
|
export declare function findClassBindingInScope(startScope: ScopeId, receiverName: string, scopes: ScopeResolutionIndexes): SymbolDefinition | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Resolve a class-like inheritance target using the shared inheritance
|
|
119
|
+
* resolution chain. Keeps pre-emitted heritage edges and language-specific
|
|
120
|
+
* consumers of `inherits` sites aligned.
|
|
121
|
+
*/
|
|
122
|
+
export declare function resolveInheritanceBaseInScope(startScope: ScopeId, baseName: string, scopes: ScopeResolutionIndexes, rawQualifiedName?: string, enclosingClassDef?: SymbolDefinition): SymbolDefinition | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Import/include-aware disambiguation for an *ambiguous* class-like base
|
|
125
|
+
* name. Engages ONLY as a fallback after `findClassBindingInScope` has
|
|
126
|
+
* already returned `undefined` — i.e. the scope-chain walk and the
|
|
127
|
+
* single-match `qualifiedNames` fast paths could not pick a winner because
|
|
128
|
+
* several same-named class-like defs exist (e.g. two `class Handler`s in
|
|
129
|
+
* different headers/namespaces).
|
|
130
|
+
*
|
|
131
|
+
* Disambiguates by the referencing file's import graph: the enclosing
|
|
132
|
+
* module scope's finalized `ImportEdge[]` (C++ `#include`, C# `using`, etc.)
|
|
133
|
+
* each carry the exporting file in `targetFile`. A candidate whose defining
|
|
134
|
+
* file is brought in by one of those edges is preferred. Resolution is
|
|
135
|
+
* tiered, strictest first, and only commits when EXACTLY ONE candidate
|
|
136
|
+
* survives a tier — so a still-ambiguous name keeps the historical
|
|
137
|
+
* "return undefined" refusal:
|
|
138
|
+
*
|
|
139
|
+
* 1. Exact file match — candidate.filePath === an import's `targetFile`
|
|
140
|
+
* (covers C++ `#include "handler_a.h"` → that header's class).
|
|
141
|
+
* 2. Same-directory match — candidate.filePath sits in the same directory
|
|
142
|
+
* as some import target file (covers C# `using MyApp.Models;`, where the
|
|
143
|
+
* namespace import resolves to ONE representative file in the namespace's
|
|
144
|
+
* directory, not necessarily the file declaring the referenced type).
|
|
145
|
+
*
|
|
146
|
+
* Language-neutral: keyed only on the finalized import edges and the
|
|
147
|
+
* candidate defs' `filePath`. Returns `undefined` (preserving refusal) when
|
|
148
|
+
* the name is single-match-resolvable already (never reached — caller gates
|
|
149
|
+
* on `findClassBindingInScope` miss), when no import disambiguates, or when
|
|
150
|
+
* a tier leaves more than one survivor.
|
|
151
|
+
*/
|
|
152
|
+
export declare function resolveAmbiguousInheritanceBaseViaImports(startScope: ScopeId, baseName: string, scopes: ScopeResolutionIndexes): SymbolDefinition | undefined;
|
|
102
153
|
/**
|
|
103
154
|
* Predicate for value-receiver bridge: the labels for which
|
|
104
155
|
* `reconcileOwnership` registers methods/fields under the def's
|
|
@@ -183,6 +234,27 @@ export declare function findCallableBindingsAndAdlBlocker(startScope: ScopeId, n
|
|
|
183
234
|
* so this single mutation is visible from both sides.
|
|
184
235
|
*/
|
|
185
236
|
export declare function populateClassOwnedMembers(parsed: ParsedFile): void;
|
|
237
|
+
/**
|
|
238
|
+
* Tag every def declared inside one or more `Namespace` scopes with its
|
|
239
|
+
* enclosing-namespace path (`NS`, `Outer.Inner`) on a sidecar `namespacePrefix`
|
|
240
|
+
* field — WITHOUT touching `qualifiedName`.
|
|
241
|
+
*
|
|
242
|
+
* Some scope-extractors qualify a nested type by its enclosing CLASS chain
|
|
243
|
+
* (`A.Inner`) but drop the enclosing NAMESPACE, while the structure phase keys
|
|
244
|
+
* the graph node by the full path (`NS.A.Inner`). `resolveDefGraphId` reads this
|
|
245
|
+
* tag to retry the node lookup with the namespace-prefixed key before the
|
|
246
|
+
* simple-name fallback, so same-tail nested bases don't collapse across sibling
|
|
247
|
+
* namespace members (#1982). `qualifiedName` is deliberately left unchanged, so
|
|
248
|
+
* the `qualifiedName`-keyed resolution index and existing namespace resolution
|
|
249
|
+
* (brace-init, UDC ranking, two-phase lookup) are untouched.
|
|
250
|
+
*
|
|
251
|
+
* Language-agnostic: it acts only on `Namespace`-kind scopes (a namespace-free
|
|
252
|
+
* language is a no-op) and is opt-in per provider (call after `populateOwners`).
|
|
253
|
+
* Namespace segments are taken as each namespace def's own tail, so it composes
|
|
254
|
+
* for nested namespaces regardless of whether the inner namespace's name is
|
|
255
|
+
* stored simple or already dotted. Skips defs already carrying the prefix.
|
|
256
|
+
*/
|
|
257
|
+
export declare function tagNamespacePrefixes(parsed: ParsedFile): void;
|
|
186
258
|
/**
|
|
187
259
|
* Walk a scope chain upward looking for the innermost enclosing
|
|
188
260
|
* Class scope and return that class's def. Used by per-language
|