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
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* generalization plan.
|
|
18
18
|
*/
|
|
19
19
|
import { resolveCallerGraphId, resolveDefGraphId } from '../graph-bridge/ids.js';
|
|
20
|
-
import { findAllCallableBindingsInScope, findCallableBindingInScope, findCallableBindingsAndAdlBlocker,
|
|
20
|
+
import { findAllCallableBindingsInScope, findCallableBindingInScope, findCallableBindingsAndAdlBlocker, resolveInheritanceBaseInScope, } from '../scope/walkers.js';
|
|
21
21
|
import { isOverloadAmbiguousAfterNormalization, narrowOverloadCandidates, } from './overload-narrowing.js';
|
|
22
22
|
export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _referenceIndex, handledSites, model, workspaceIndex, options = {}) {
|
|
23
23
|
let emitted = 0;
|
|
@@ -27,6 +27,19 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
27
27
|
// per call site. Same name + callable-kind filter that the previous scan
|
|
28
28
|
// applied (see pickUniqueGlobalCallable JSDoc). Cost: O(|defs|) once.
|
|
29
29
|
const globalCallablesBySimpleName = buildGlobalCallableIndex(scopes);
|
|
30
|
+
// Sibling index for constructor-form class fallback. Built once here so
|
|
31
|
+
// pickUniqueGlobalClass is O(1)-per-site rather than re-scanning
|
|
32
|
+
// defs.byId.values() at every constructor call. Same simple-name keying
|
|
33
|
+
// and class-like kind filter the previous per-site scan applied.
|
|
34
|
+
const globalClassesBySimpleName = buildGlobalClassIndex(scopes);
|
|
35
|
+
// Per-pass memo of pickUniqueGlobalCallable's post-filter candidate list,
|
|
36
|
+
// keyed (simpleName, callerFilePath). Only created when no per-caller
|
|
37
|
+
// visibility filter applies (the list is then a pure function of name+file —
|
|
38
|
+
// see pickUniqueGlobalCallable). Lets repeated free calls of the same name
|
|
39
|
+
// from one file reuse the same-name-bucket scan instead of re-walking it.
|
|
40
|
+
const scopeDefsCache = options.isCallableVisibleFromCaller === undefined
|
|
41
|
+
? new Map()
|
|
42
|
+
: undefined;
|
|
30
43
|
for (const parsed of parsedFiles) {
|
|
31
44
|
for (const site of parsed.referenceSites) {
|
|
32
45
|
if (site.kind !== 'call')
|
|
@@ -39,9 +52,32 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
39
52
|
// the same two targets; see test expectations.
|
|
40
53
|
let fnDef;
|
|
41
54
|
if (site.callForm === 'constructor') {
|
|
42
|
-
const classDef =
|
|
43
|
-
if (classDef !== undefined) {
|
|
44
|
-
|
|
55
|
+
const classDef = resolveInheritanceBaseInScope(site.inScope, site.name, scopes, site.rawQualifiedName);
|
|
56
|
+
if (classDef !== undefined && classDef.type !== 'Interface') {
|
|
57
|
+
// Most languages link `Type(...)` to the explicit Constructor def
|
|
58
|
+
// when one exists (else the Class). Languages that model the call
|
|
59
|
+
// as a reference to the type itself opt into
|
|
60
|
+
// `constructorCallTargetsClass` and always link to the Class.
|
|
61
|
+
fnDef =
|
|
62
|
+
options.constructorCallTargetsClass === true
|
|
63
|
+
? classDef
|
|
64
|
+
: pickConstructorOrClass(classDef, workspaceIndex, scopes, site.arity);
|
|
65
|
+
}
|
|
66
|
+
else if (options.allowGlobalFallback === true) {
|
|
67
|
+
// The constructed type may live in a sibling/imported file that is
|
|
68
|
+
// not in the call-site's lexical scope-chain bindings. Fall back to
|
|
69
|
+
// a unique workspace-wide Class def by simple name (gated on the
|
|
70
|
+
// same global-fallback opt-in as free calls). Then target the
|
|
71
|
+
// Class or its Constructor per the language's preference.
|
|
72
|
+
const globalClass = pickUniqueGlobalClass(site.name, globalClassesBySimpleName);
|
|
73
|
+
if (globalClass !== undefined) {
|
|
74
|
+
fnDef =
|
|
75
|
+
globalClass.type === 'Interface'
|
|
76
|
+
? undefined
|
|
77
|
+
: options.constructorCallTargetsClass === true
|
|
78
|
+
? globalClass
|
|
79
|
+
: pickConstructorOrClass(globalClass, workspaceIndex, scopes, site.arity);
|
|
80
|
+
}
|
|
45
81
|
}
|
|
46
82
|
}
|
|
47
83
|
// Implicit-this overload narrowing: an unqualified call inside
|
|
@@ -49,11 +85,13 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
49
85
|
// enclosing class. When the workspace has multiple methods of
|
|
50
86
|
// the same name in a single class, choose the best match by
|
|
51
87
|
// arity + argument types.
|
|
88
|
+
let fnDefFromImplicitThis = false;
|
|
52
89
|
if (fnDef === undefined) {
|
|
53
90
|
fnDef = pickImplicitThisOverload(site, scopes, workspaceIndex, model, {
|
|
54
91
|
conversionRankFn: options.conversionRankFn,
|
|
55
92
|
constraintCompatibility: options.constraintCompatibility,
|
|
56
93
|
});
|
|
94
|
+
fnDefFromImplicitThis = fnDef !== undefined;
|
|
57
95
|
}
|
|
58
96
|
// Scope-chain callable lookup. First-match preserves scope-chain
|
|
59
97
|
// precedence (local shadows import). When a conversion-rank function
|
|
@@ -247,11 +285,22 @@ export function emitFreeCallFallback(graph, scopes, parsedFiles, nodeLookup, _re
|
|
|
247
285
|
callerScope: site.inScope,
|
|
248
286
|
scopes,
|
|
249
287
|
})
|
|
250
|
-
: undefined, site.argumentTypes, site.argumentTypeClasses, options.conversionRankFn);
|
|
288
|
+
: undefined, site.argumentTypes, site.argumentTypeClasses, options.conversionRankFn, scopeDefsCache);
|
|
251
289
|
}
|
|
252
290
|
if (fnDef === undefined)
|
|
253
291
|
continue;
|
|
254
|
-
|
|
292
|
+
if ((fnDefFromImplicitThis || fnDef.type === 'Method' || fnDef.type === 'Constructor') &&
|
|
293
|
+
options.isCallableVisibleFromCaller !== undefined &&
|
|
294
|
+
!options.isCallableVisibleFromCaller({
|
|
295
|
+
callerParsed: parsed,
|
|
296
|
+
candidate: fnDef,
|
|
297
|
+
callerScope: site.inScope,
|
|
298
|
+
scopes,
|
|
299
|
+
})) {
|
|
300
|
+
handledSites.add(siteKey(parsed.filePath, site));
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
const callerGraphId = resolveCallerGraphId(site.inScope, scopes, nodeLookup, site.atRange);
|
|
255
304
|
if (callerGraphId === undefined)
|
|
256
305
|
continue;
|
|
257
306
|
const tgtGraphId = resolveDefGraphId(fnDef.filePath, fnDef, nodeLookup);
|
|
@@ -312,8 +361,11 @@ function recordSuppressedOutcome(record, input) {
|
|
|
312
361
|
* (falling back to the qualifiedName itself when undotted). Used by
|
|
313
362
|
* `pickUniqueGlobalCallable` so every free-call fallback site is O(1)
|
|
314
363
|
* instead of O(|defs|).
|
|
364
|
+
*
|
|
365
|
+
* Exported for unit testing — language-agnostic logic, exercised via synthetic
|
|
366
|
+
* stubs in `pick-unique-global-callable.test.ts`.
|
|
315
367
|
*/
|
|
316
|
-
function buildGlobalCallableIndex(scopes) {
|
|
368
|
+
export function buildGlobalCallableIndex(scopes) {
|
|
317
369
|
const out = new Map();
|
|
318
370
|
for (const def of scopes.defs.byId.values()) {
|
|
319
371
|
if (def.type !== 'Function' && def.type !== 'Method' && def.type !== 'Constructor')
|
|
@@ -331,27 +383,95 @@ function buildGlobalCallableIndex(scopes) {
|
|
|
331
383
|
}
|
|
332
384
|
return out;
|
|
333
385
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Build a `simpleName -> class-like defs` index from `scopes.defs` once per
|
|
388
|
+
* pass — the structural sibling of `buildGlobalCallableIndex`, consumed by
|
|
389
|
+
* `pickUniqueGlobalClass` so constructor-form fallback is O(1)-per-site
|
|
390
|
+
* instead of O(|defs|).
|
|
391
|
+
*
|
|
392
|
+
* **Kind filter (KTD5 — KEEP `'Interface'`):** the set is
|
|
393
|
+
* `Class | Struct | Interface`, matching the idiomatic class-like set used
|
|
394
|
+
* elsewhere in the scope-resolution bridge (`graph-bridge/ids.ts`,
|
|
395
|
+
* `node-lookup.ts`). This is a behavior-PRESERVING perf refactor for all 8
|
|
396
|
+
* `allowGlobalFreeCallFallback` languages — the previous per-site scan used
|
|
397
|
+
* exactly this filter. Excluding Swift `protocol` (`Interface`) defs because
|
|
398
|
+
* protocols aren't instantiable is a *separate* Swift-semantics question with
|
|
399
|
+
* its own test; dropping `Interface` here would be a deliberate
|
|
400
|
+
* behavior-changing edit, not part of U5.
|
|
401
|
+
*
|
|
402
|
+
* Bucket insertion order follows `defs.byId.values()` iteration order, so the
|
|
403
|
+
* downstream "keep first" / ambiguity ordering in `pickUniqueGlobalClass` is
|
|
404
|
+
* byte-identical to the old linear scan (equivalence verified).
|
|
405
|
+
*
|
|
406
|
+
* Exported for unit testing — language-agnostic logic, exercised via synthetic
|
|
407
|
+
* stubs in `pick-unique-global-class.test.ts`.
|
|
408
|
+
*/
|
|
409
|
+
export function buildGlobalClassIndex(scopes) {
|
|
410
|
+
const out = new Map();
|
|
411
|
+
for (const def of scopes.defs.byId.values()) {
|
|
412
|
+
if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
|
|
341
413
|
continue;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
// import gating). When defined, blocks candidates the caller cannot
|
|
345
|
-
// legally reach. Languages without namespace-scoped function resolution
|
|
346
|
-
// leave this undefined → no filtering.
|
|
347
|
-
if (isCallerVisible !== undefined && !isCallerVisible(def)) {
|
|
414
|
+
const qualified = def.qualifiedName;
|
|
415
|
+
if (qualified === undefined || qualified.length === 0)
|
|
348
416
|
continue;
|
|
417
|
+
const dot = qualified.lastIndexOf('.');
|
|
418
|
+
const simple = dot === -1 ? qualified : qualified.slice(dot + 1);
|
|
419
|
+
const bucket = out.get(simple);
|
|
420
|
+
if (bucket)
|
|
421
|
+
bucket.push(def);
|
|
422
|
+
else
|
|
423
|
+
out.set(simple, [def]);
|
|
424
|
+
}
|
|
425
|
+
return out;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Resolve a free (unqualified, receiver-less) call to a globally-unique
|
|
429
|
+
* callable def by simple name. See the in-body comments for the narrowing
|
|
430
|
+
* order. Exported for unit testing — the `scopeDefsCache` equivalence is
|
|
431
|
+
* exercised via synthetic stubs in `pick-unique-global-callable.test.ts`.
|
|
432
|
+
*/
|
|
433
|
+
export function pickUniqueGlobalCallable(name, model, globalCallablesBySimpleName, callerFilePath, isFileLocalDef, callArity, isCallerVisible, callArgTypes, callArgTypeClasses, conversionRankFn, scopeDefsCache) {
|
|
434
|
+
// The scope-index candidate list is a pure function of (name, callerFilePath):
|
|
435
|
+
// the same-name bucket is fixed for the pass, the file-local filter depends
|
|
436
|
+
// only on the candidate + callerFilePath, and the logical-key dedup is
|
|
437
|
+
// deterministic. When no per-caller visibility filter applies, memoize it so
|
|
438
|
+
// repeated free calls of the same name from one file — the kernel's hot
|
|
439
|
+
// pattern (e.g. `kmalloc` across hundreds of `drivers/` sites, where the
|
|
440
|
+
// same-name bucket has thousands of defs) — reuse the bucket scan instead of
|
|
441
|
+
// re-walking it per site. The cached array is only ever READ by the arity /
|
|
442
|
+
// overload narrowers below (both `.filter()`-based — they never mutate it),
|
|
443
|
+
// so one shared instance across call sites is safe. The cache is bypassed
|
|
444
|
+
// when a visibility filter is present (`isCallerVisible !== undefined`),
|
|
445
|
+
// because the list would then depend on the caller's scope, not just its file.
|
|
446
|
+
const cacheKey = scopeDefsCache !== undefined && isCallerVisible === undefined
|
|
447
|
+
? `${name}${callerFilePath}`
|
|
448
|
+
: undefined;
|
|
449
|
+
let scopeDefs = cacheKey !== undefined ? scopeDefsCache.get(cacheKey) : undefined;
|
|
450
|
+
if (scopeDefs === undefined) {
|
|
451
|
+
const built = [];
|
|
452
|
+
const scopeSeen = new Set();
|
|
453
|
+
for (const def of globalCallablesBySimpleName.get(name) ?? []) {
|
|
454
|
+
// Skip file-local defs (e.g. C `static` functions) that live in a
|
|
455
|
+
// different file from the caller — they are logically invisible.
|
|
456
|
+
if (isFileLocalDef !== undefined && def.filePath !== callerFilePath && isFileLocalDef(def)) {
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
// Caller-side visibility filter (e.g., PHP namespace + use-function
|
|
460
|
+
// import gating). When defined, blocks candidates the caller cannot
|
|
461
|
+
// legally reach. Languages without namespace-scoped function resolution
|
|
462
|
+
// leave this undefined → no filtering.
|
|
463
|
+
if (isCallerVisible !== undefined && !isCallerVisible(def)) {
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
const key = logicalCallableKey(def);
|
|
467
|
+
if (scopeSeen.has(key))
|
|
468
|
+
continue;
|
|
469
|
+
scopeSeen.add(key);
|
|
470
|
+
built.push(def);
|
|
349
471
|
}
|
|
350
|
-
|
|
351
|
-
if (
|
|
352
|
-
|
|
353
|
-
scopeSeen.add(key);
|
|
354
|
-
scopeDefs.push(def);
|
|
472
|
+
scopeDefs = built;
|
|
473
|
+
if (cacheKey !== undefined)
|
|
474
|
+
scopeDefsCache.set(cacheKey, built);
|
|
355
475
|
}
|
|
356
476
|
if (scopeDefs.length === 1)
|
|
357
477
|
return scopeDefs[0];
|
|
@@ -449,13 +569,14 @@ function logicalCallableKey(def) {
|
|
|
449
569
|
* Class def itself when no explicit Constructor exists. Matches
|
|
450
570
|
* legacy behavior — tests assert targetLabel === 'Class' for implicit
|
|
451
571
|
* ctors and targetLabel === 'Constructor' for explicit ones. */
|
|
452
|
-
function pickConstructorOrClass(classDef, workspaceIndex, scopes) {
|
|
572
|
+
function pickConstructorOrClass(classDef, workspaceIndex, scopes, callArity) {
|
|
453
573
|
const classScope = workspaceIndex.classScopeByDefId.get(classDef.nodeId);
|
|
454
574
|
if (classScope === undefined)
|
|
455
575
|
return classDef;
|
|
576
|
+
const ctors = [];
|
|
456
577
|
for (const def of classScope.ownedDefs) {
|
|
457
578
|
if (def.type === 'Constructor')
|
|
458
|
-
|
|
579
|
+
ctors.push(def);
|
|
459
580
|
}
|
|
460
581
|
if (scopes !== undefined) {
|
|
461
582
|
for (const childId of scopes.scopeTree.getChildren(classScope.id)) {
|
|
@@ -464,11 +585,50 @@ function pickConstructorOrClass(classDef, workspaceIndex, scopes) {
|
|
|
464
585
|
continue;
|
|
465
586
|
for (const def of childScope.ownedDefs) {
|
|
466
587
|
if (def.type === 'Constructor')
|
|
467
|
-
|
|
588
|
+
ctors.push(def);
|
|
468
589
|
}
|
|
469
590
|
}
|
|
470
591
|
}
|
|
471
|
-
|
|
592
|
+
if (ctors.length === 0)
|
|
593
|
+
return classDef;
|
|
594
|
+
if (callArity !== undefined) {
|
|
595
|
+
const narrowed = narrowByArity(ctors, callArity);
|
|
596
|
+
if (narrowed !== undefined)
|
|
597
|
+
return narrowed;
|
|
598
|
+
}
|
|
599
|
+
return ctors[0];
|
|
600
|
+
}
|
|
601
|
+
/** Find a unique workspace-wide class-like def by simple name, for a
|
|
602
|
+
* constructor-form call `Type(...)` whose type lives outside the call
|
|
603
|
+
* site's lexical bindings (a sibling/imported file). Returns the def
|
|
604
|
+
* only when all matches share ONE qualified name — i.e. they are
|
|
605
|
+
* fragments of a single logical type (partial classes / extensions
|
|
606
|
+
* that re-key onto the same type), which resolve to the same graph
|
|
607
|
+
* node. Genuinely distinct types with the same simple name are
|
|
608
|
+
* ambiguous and leave the call unresolved rather than guessing. Gated
|
|
609
|
+
* by the caller on `allowGlobalFallback`, mirroring
|
|
610
|
+
* `pickUniqueGlobalCallable`.
|
|
611
|
+
*
|
|
612
|
+
* Consumes the once-built `buildGlobalClassIndex` (`simpleName ->
|
|
613
|
+
* class-like defs`) so each call site is O(1) rather than O(|defs|).
|
|
614
|
+
* The index's `Class | Struct | Interface` kind filter is intentionally
|
|
615
|
+
* KEPT (KTD5) — see `buildGlobalClassIndex` for why dropping `Interface`
|
|
616
|
+
* would be a separate, behavior-changing Swift-semantics edit.
|
|
617
|
+
*
|
|
618
|
+
* Exported for unit testing — language-agnostic logic, exercised via
|
|
619
|
+
* synthetic stubs in `pick-unique-global-class.test.ts`. The production
|
|
620
|
+
* call site is the constructor-form fallback in `emitFreeCallFallback`. */
|
|
621
|
+
export function pickUniqueGlobalClass(name, index) {
|
|
622
|
+
let found;
|
|
623
|
+
for (const def of index.get(name) ?? []) {
|
|
624
|
+
// Same qualified name = same logical type (extension / partial-class
|
|
625
|
+
// fragment); keep the first and don't treat it as ambiguous.
|
|
626
|
+
if (found !== undefined && found.qualifiedName !== def.qualifiedName)
|
|
627
|
+
return undefined;
|
|
628
|
+
if (found === undefined)
|
|
629
|
+
found = def;
|
|
630
|
+
}
|
|
631
|
+
return found;
|
|
472
632
|
}
|
|
473
633
|
/** Walk up from the call-site scope to the enclosing class scope,
|
|
474
634
|
* pick a method member by name with overload narrowing on arity +
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
* Generic; promoted from `languages/python/scope-resolver.ts` per the
|
|
39
39
|
* scope-resolution generalization plan.
|
|
40
40
|
*/
|
|
41
|
-
import { lookupBindingsAt, namesAtScope } from '../scope/walkers.js';
|
|
41
|
+
import { lookupBindingsAt, namesAtScope, moduleScopeIdOf, namespaceTypeBindingFor, } from '../scope/walkers.js';
|
|
42
42
|
/**
|
|
43
43
|
* Max chain depth for the post-finalize re-follow. Effective end-to-end
|
|
44
44
|
* depth is roughly 2× this number, because chain-following runs once
|
|
@@ -56,6 +56,9 @@ const RECHAIN_MAX_DEPTH = 8;
|
|
|
56
56
|
export function followChainPostFinalize(start, fromScopeId, scopes) {
|
|
57
57
|
let current = start;
|
|
58
58
|
const visited = new Set();
|
|
59
|
+
// The caller's module scope is fixed across the walk; resolve it once so the
|
|
60
|
+
// accessibility-gated per-namespace fallback below can be consulted cheaply.
|
|
61
|
+
const moduleScopeId = moduleScopeIdOf(fromScopeId, scopes);
|
|
59
62
|
for (let depth = 0; depth < RECHAIN_MAX_DEPTH; depth++) {
|
|
60
63
|
if (current.rawName.includes('.'))
|
|
61
64
|
return current;
|
|
@@ -71,6 +74,23 @@ export function followChainPostFinalize(start, fromScopeId, scopes) {
|
|
|
71
74
|
next = undefined;
|
|
72
75
|
scopeId = scope.parent;
|
|
73
76
|
}
|
|
77
|
+
// Scope-independent fallbacks (#1871), mirroring findReceiverTypeBinding's
|
|
78
|
+
// precedence: named namespaces accessible from this file
|
|
79
|
+
// (`namespaceTypeBindings`, gated by accessibility) first — they lived in the
|
|
80
|
+
// chain pre-#1871 and so must outrank the flat global channel — then the
|
|
81
|
+
// global/default namespace (`workspaceTypeBindings`, visible everywhere).
|
|
82
|
+
// Both live in shared channels rather than each Scope.typeBindings to avoid
|
|
83
|
+
// the O(files × names) blow-up.
|
|
84
|
+
if (next === undefined) {
|
|
85
|
+
const nsHit = namespaceTypeBindingFor(moduleScopeId, current.rawName, scopes);
|
|
86
|
+
if (nsHit !== undefined && nsHit !== current)
|
|
87
|
+
next = nsHit;
|
|
88
|
+
}
|
|
89
|
+
if (next === undefined) {
|
|
90
|
+
const ws = scopes.workspaceTypeBindings?.get(current.rawName);
|
|
91
|
+
if (ws !== undefined && ws !== current)
|
|
92
|
+
next = ws;
|
|
93
|
+
}
|
|
74
94
|
if (next === undefined)
|
|
75
95
|
return current;
|
|
76
96
|
if (visited.has(next.rawName))
|
|
@@ -106,7 +106,7 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
106
106
|
const graphIdToClassDef = new Map();
|
|
107
107
|
for (const parsed of parsedFiles) {
|
|
108
108
|
for (const def of parsed.localDefs) {
|
|
109
|
-
if (def.type !== 'Class' && def.type !== 'Interface')
|
|
109
|
+
if (def.type !== 'Class' && def.type !== 'Struct' && def.type !== 'Interface')
|
|
110
110
|
continue;
|
|
111
111
|
const graphId = resolveDefGraphId(parsed.filePath, def, nodeLookup);
|
|
112
112
|
if (graphId !== undefined)
|
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generic registry-primary resolution phase (RFC #909 Ring 3).
|
|
5
5
|
*
|
|
6
|
-
* For every language
|
|
7
|
-
* whose provider is registered in `SCOPE_RESOLVERS`:
|
|
6
|
+
* For every language whose provider is registered in `SCOPE_RESOLVERS`:
|
|
8
7
|
* 1. Filter scanned files by language extension.
|
|
9
8
|
* 2. Read file contents.
|
|
10
9
|
* 3. Drive the scope-based pipeline end-to-end via the generic
|
|
11
10
|
* `runScopeResolution(input, provider)` orchestrator.
|
|
12
11
|
* 4. Emit IMPORTS / CALLS / ACCESSES / INHERITS / USES edges.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* This is the sole resolution path — RING4-1 (#942) deleted the legacy
|
|
14
|
+
* call-resolution DAG, so there is no longer a per-language flag gating
|
|
15
|
+
* registry-vs-legacy.
|
|
17
16
|
*
|
|
18
|
-
* Adding a language is
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* - Add the language to `MIGRATED_LANGUAGES` in
|
|
22
|
-
* `registry-primary-flag.ts`.
|
|
17
|
+
* Adding a language is one change: implement `ScopeResolver` in
|
|
18
|
+
* `languages/<lang>/scope-resolver.ts` and register it in
|
|
19
|
+
* `scope-resolution/pipeline/registry.ts`.
|
|
23
20
|
*
|
|
24
21
|
* @deps parse (needs Symbol nodes already in the graph so emit-references
|
|
25
22
|
* can attach edges to existing Function/Method/Class nodes)
|
|
@@ -40,7 +37,7 @@ export interface ScopeResolutionOutput {
|
|
|
40
37
|
readonly referenceEdgesEmitted: number;
|
|
41
38
|
/** Additive stream of resolver diagnostics; does not affect graph edges. */
|
|
42
39
|
readonly resolutionOutcomes: readonly ResolutionOutcome[];
|
|
43
|
-
/** Per-language breakdown for telemetry
|
|
40
|
+
/** Per-language breakdown for telemetry. */
|
|
44
41
|
readonly perLanguage: ReadonlyMap<SupportedLanguages, {
|
|
45
42
|
readonly filesProcessed: number;
|
|
46
43
|
readonly importsEmitted: number;
|