gitnexus 1.6.6-rc.98 → 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 +247 -26
- 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
|
@@ -18,11 +18,20 @@
|
|
|
18
18
|
* The orchestrator hands us its `treeCache` so files already parsed
|
|
19
19
|
* by `extractParsedFile` are re-used instead of re-parsed —
|
|
20
20
|
* `ParsedFile`'s underlying tree is the single source of truth.
|
|
21
|
-
* Group classes by namespace,
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
21
|
+
* Group classes by namespace, then route cross-file sibling classes
|
|
22
|
+
* (and method return-type bindings) through SHARED, per-namespace
|
|
23
|
+
* channels — `namespaceFqnBindings` / `namespaceTypeBindings`, keyed by
|
|
24
|
+
* namespace name — populated ONCE per bucket with `origin: 'namespace'`,
|
|
25
|
+
* rather than copied into every sibling's per-scope `bindingAugmentations`
|
|
26
|
+
* / `Scope.typeBindings`. That per-file copy was O(files²) for a
|
|
27
|
+
* concentrated namespace and OOM'd large solutions (#1871; the global
|
|
28
|
+
* twin was fixed in #1905/#1954). The walkers consult these channels
|
|
29
|
+
* gated by `accessibleNamespacesByScope` (a file's own namespace +
|
|
30
|
+
* `using` targets), so visibility is unchanged — only the storage is
|
|
31
|
+
* shared. Finalized bindings remain first in `lookupBindingsAt`, and
|
|
32
|
+
* local lexical `Scope.bindings` remains the first-tier shadowing
|
|
33
|
+
* channel. (`using static` member exposure still uses the per-scope
|
|
34
|
+
* augmentation channel — it is per-import and not part of the blow-up.)
|
|
26
35
|
*
|
|
27
36
|
* The tree-sitter walk is authoritative: it sees `global using static`,
|
|
28
37
|
* aliased `using static X = Y.Z;`, attributed namespace declarations,
|
|
@@ -378,39 +387,87 @@ export function populateCsharpNamespaceSiblings(parsedFiles, indexes, inputs) {
|
|
|
378
387
|
// via `lookupBindingsAt`; we never need to consult or mutate
|
|
379
388
|
// `indexes.bindings`.
|
|
380
389
|
const augmentations = indexes.bindingAugmentations;
|
|
381
|
-
//
|
|
382
|
-
//
|
|
383
|
-
// from
|
|
384
|
-
//
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
//
|
|
388
|
-
//
|
|
390
|
+
// Global ('') namespace type-binding propagation (#1871). Types in the C#
|
|
391
|
+
// unnamed/global namespace form a single declaration space that is
|
|
392
|
+
// type-visible from EVERY file — including files inside named namespaces
|
|
393
|
+
// (C# spec: "any identifier in the global namespace is available for use in
|
|
394
|
+
// a named namespace"). Route their module-scope return-type bindings through
|
|
395
|
+
// the scope-independent `workspaceTypeBindings` channel ONCE, rather than
|
|
396
|
+
// copying every global file's bindings into every other file's
|
|
397
|
+
// `Scope.typeBindings`. That per-file copy was O(files × distinct-names) in
|
|
398
|
+
// both time and memory and OOM'd large no-namespace solutions (tens of
|
|
399
|
+
// thousands of files in the global bucket → billions of Map entries). This
|
|
400
|
+
// mirrors how Roslyn resolves against a single `Compilation.GlobalNamespace`
|
|
401
|
+
// symbol instead of per-file copies, and is the typeBindings analogue of the
|
|
402
|
+
// `workspaceFqnBindings` fast-path (#1905). `findReceiverTypeBinding` /
|
|
403
|
+
// `followChainPostFinalize` consult this channel as a final fallback.
|
|
404
|
+
const workspaceTypeBindings = indexes.workspaceTypeBindings;
|
|
405
|
+
const globalBucket = buckets.get('');
|
|
406
|
+
if (globalBucket !== undefined) {
|
|
407
|
+
for (const scopeInfo of globalBucket.scopes) {
|
|
408
|
+
if (scopeInfo.scope.kind !== 'Module')
|
|
409
|
+
continue;
|
|
410
|
+
for (const [boundName, typeRef] of scopeInfo.scope.typeBindings) {
|
|
411
|
+
// First-wins, matching the old per-importer `has(boundName)` skip:
|
|
412
|
+
// same-name collisions across global files are inherently ambiguous.
|
|
413
|
+
if (!workspaceTypeBindings.has(boundName)) {
|
|
414
|
+
workspaceTypeBindings.set(boundName, typeRef);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// Named-namespace type-binding propagation (#1871). Method return-type
|
|
420
|
+
// bindings are routed through the per-namespace `namespaceTypeBindings`
|
|
421
|
+
// channel — populated ONCE per named bucket — instead of copied into every
|
|
422
|
+
// sibling/importer file's Module `Scope.typeBindings`. That per-file copy was
|
|
423
|
+
// O(files²) for a concentrated named namespace (the global twin of which #1954
|
|
424
|
+
// already moved to `workspaceTypeBindings`); a solution with all files under
|
|
425
|
+
// one `namespace App;` reproduced the same OOM. The chain-walkers
|
|
426
|
+
// (`findReceiverTypeBinding`, `followChainPostFinalize`) consult this channel
|
|
427
|
+
// gated by `accessibleNamespacesByScope`, so a file sees exactly the
|
|
428
|
+
// namespaces it could before (its own + `using`d), just shared not copied.
|
|
429
|
+
const namespaceTypeBindings = indexes.namespaceTypeBindings;
|
|
430
|
+
for (const [nsName, bucket] of buckets) {
|
|
431
|
+
if (nsName === '')
|
|
432
|
+
continue; // global → workspaceTypeBindings (above)
|
|
433
|
+
let nsMap = namespaceTypeBindings.get(nsName);
|
|
434
|
+
for (const scopeInfo of bucket.scopes) {
|
|
435
|
+
if (scopeInfo.scope.kind !== 'Module')
|
|
436
|
+
continue;
|
|
437
|
+
for (const [boundName, typeRef] of scopeInfo.scope.typeBindings) {
|
|
438
|
+
if (nsMap === undefined) {
|
|
439
|
+
nsMap = new Map();
|
|
440
|
+
namespaceTypeBindings.set(nsName, nsMap);
|
|
441
|
+
}
|
|
442
|
+
// First-wins, matching the old per-importer `has(boundName)` skip.
|
|
443
|
+
if (!nsMap.has(boundName))
|
|
444
|
+
nsMap.set(boundName, typeRef);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
// Materialize each file's accessible namespaces (its own declared namespaces +
|
|
449
|
+
// every `using namespace X;` target, plus dotted-path prefixes), keyed by the
|
|
450
|
+
// file's Module scope id. This is the SAME accessibility set the per-file copy
|
|
451
|
+
// above used to derive — now stored so the language-neutral walkers can gate
|
|
452
|
+
// their `namespaceFqnBindings` / `namespaceTypeBindings` lookups to exactly the
|
|
453
|
+
// namespaces a file can see. The global ('') namespace is excluded: it is
|
|
454
|
+
// type-visible everywhere and handled by the flat workspace channels.
|
|
455
|
+
const accessibleNamespacesByScope = indexes.accessibleNamespacesByScope;
|
|
389
456
|
for (const parsed of parsedFiles) {
|
|
390
457
|
const moduleScope = parsed.scopes.find((s) => s.kind === 'Module');
|
|
391
458
|
if (moduleScope === undefined)
|
|
392
459
|
continue;
|
|
393
|
-
const moduleTypeBindings = moduleScope.typeBindings;
|
|
394
|
-
// Accessible namespaces = this file's own namespaces + every
|
|
395
|
-
// `using namespace X;` target. Source of truth is the cached AST
|
|
396
|
-
// structure captured above.
|
|
397
460
|
const accessibleNamespaces = new Set();
|
|
398
461
|
const struct = structureByFile.get(parsed.filePath);
|
|
399
462
|
if (struct !== undefined) {
|
|
400
463
|
for (const n of struct.namespaces)
|
|
401
464
|
accessibleNamespaces.add(n);
|
|
402
465
|
}
|
|
403
|
-
if (accessibleNamespaces.size === 0)
|
|
404
|
-
accessibleNamespaces.add('');
|
|
405
466
|
for (const imp of parsed.parsedImports) {
|
|
406
467
|
if (imp.kind === 'namespace' && imp.targetRaw !== null) {
|
|
407
468
|
accessibleNamespaces.add(imp.targetRaw);
|
|
408
469
|
}
|
|
409
470
|
}
|
|
410
|
-
// For each accessible namespace, also walk up the dotted path —
|
|
411
|
-
// `using static X.Y.Z;` targets a type, so the real namespace is
|
|
412
|
-
// `X.Y`. Both parse into `accessibleNamespaces` as-is; we probe
|
|
413
|
-
// the bucket map with every prefix.
|
|
414
471
|
const expandedNamespaces = new Set(accessibleNamespaces);
|
|
415
472
|
for (const ns of accessibleNamespaces) {
|
|
416
473
|
const segments = ns.split('.');
|
|
@@ -418,21 +475,9 @@ export function populateCsharpNamespaceSiblings(parsedFiles, indexes, inputs) {
|
|
|
418
475
|
expandedNamespaces.add(segments.slice(0, i).join('.'));
|
|
419
476
|
}
|
|
420
477
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
continue;
|
|
425
|
-
for (const scopeInfo of bucket.scopes) {
|
|
426
|
-
if (scopeInfo.filePath === parsed.filePath)
|
|
427
|
-
continue;
|
|
428
|
-
if (scopeInfo.scope.kind !== 'Module')
|
|
429
|
-
continue;
|
|
430
|
-
for (const [boundName, typeRef] of scopeInfo.scope.typeBindings) {
|
|
431
|
-
if (moduleTypeBindings.has(boundName))
|
|
432
|
-
continue;
|
|
433
|
-
moduleTypeBindings.set(boundName, typeRef);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
478
|
+
expandedNamespaces.delete(''); // global handled by the flat workspace channels
|
|
479
|
+
if (expandedNamespaces.size > 0) {
|
|
480
|
+
accessibleNamespacesByScope.set(moduleScope.id, [...expandedNamespaces]);
|
|
436
481
|
}
|
|
437
482
|
}
|
|
438
483
|
// `using static X.Y.Z;` — expose every public static method of
|
|
@@ -504,51 +549,14 @@ export function populateCsharpNamespaceSiblings(parsedFiles, indexes, inputs) {
|
|
|
504
549
|
}
|
|
505
550
|
}
|
|
506
551
|
}
|
|
507
|
-
// Cross-namespace
|
|
508
|
-
//
|
|
509
|
-
//
|
|
510
|
-
// `
|
|
511
|
-
//
|
|
512
|
-
//
|
|
513
|
-
//
|
|
514
|
-
|
|
515
|
-
const moduleScope = parsed.scopes.find((s) => s.kind === 'Module');
|
|
516
|
-
if (moduleScope === undefined)
|
|
517
|
-
continue;
|
|
518
|
-
// Per-file de-dup sets keyed by simple name, seeded lazily from the
|
|
519
|
-
// augmentation bucket — replaces the per-def O(A) `.some` scan below.
|
|
520
|
-
const seenByName = new Map();
|
|
521
|
-
for (const imp of parsed.parsedImports) {
|
|
522
|
-
if (imp.kind !== 'namespace')
|
|
523
|
-
continue;
|
|
524
|
-
const targetNs = imp.targetRaw;
|
|
525
|
-
if (targetNs === null || targetNs === '')
|
|
526
|
-
continue;
|
|
527
|
-
const bucket = buckets.get(targetNs);
|
|
528
|
-
if (bucket === undefined)
|
|
529
|
-
continue;
|
|
530
|
-
for (const def of bucket.classDefs) {
|
|
531
|
-
if (def.filePath === parsed.filePath)
|
|
532
|
-
continue;
|
|
533
|
-
const q = def.qualifiedName ?? '';
|
|
534
|
-
const simpleName = q.includes('.') ? q.slice(q.lastIndexOf('.') + 1) : q;
|
|
535
|
-
if (simpleName === '')
|
|
536
|
-
continue;
|
|
537
|
-
const bucketArr = getAugmentationBucket(augmentations, moduleScope.id, simpleName);
|
|
538
|
-
let seen = seenByName.get(simpleName);
|
|
539
|
-
if (seen === undefined) {
|
|
540
|
-
seen = new Set();
|
|
541
|
-
for (const b of bucketArr)
|
|
542
|
-
seen.add(b.def.nodeId);
|
|
543
|
-
seenByName.set(simpleName, seen);
|
|
544
|
-
}
|
|
545
|
-
if (seen.has(def.nodeId))
|
|
546
|
-
continue;
|
|
547
|
-
seen.add(def.nodeId);
|
|
548
|
-
bucketArr.push({ def, origin: 'namespace' });
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
+
// Cross-namespace `using X;` class visibility is no longer injected per-file
|
|
553
|
+
// here (#1871). It is now subsumed by the per-namespace `namespaceFqnBindings`
|
|
554
|
+
// channel populated below: a file's `using` targets are already in its
|
|
555
|
+
// `accessibleNamespacesByScope` entry (materialized above), so `lookupBindingsAt`
|
|
556
|
+
// consults `namespaceFqnBindings[targetNs]` for it. Routing through the shared
|
|
557
|
+
// channel instead of copying each target bucket's classes into every importer's
|
|
558
|
+
// augmentation removes an O(importers × bucket-size) fanout on popular
|
|
559
|
+
// namespaces — the cross-namespace twin of the same-namespace blow-up.
|
|
552
560
|
// Workspace-level binding channel for global-namespace types (see the
|
|
553
561
|
// global fast-path below). `lookupBindingsAt` consults this as a third
|
|
554
562
|
// source after finalized + per-scope augmented bindings. Its inner arrays
|
|
@@ -557,6 +565,13 @@ export function populateCsharpNamespaceSiblings(parsedFiles, indexes, inputs) {
|
|
|
557
565
|
// ReadonlyMap→Map cast is localized to this one line and all writes go
|
|
558
566
|
// through `getWorkspaceBucket`.
|
|
559
567
|
const workspace = indexes.workspaceFqnBindings;
|
|
568
|
+
// Per-namespace binding channel for NAMED-namespace class visibility — the
|
|
569
|
+
// namespace-scoped analogue of `workspace`, populated once per named bucket
|
|
570
|
+
// (#1871). Replaces the per-scope `bindingAugmentations` fanout (O(scopes ×
|
|
571
|
+
// defs)) for same-namespace siblings AND the per-file cross-namespace-`using`
|
|
572
|
+
// injection above. `lookupBindingsAt` consults it gated by
|
|
573
|
+
// `accessibleNamespacesByScope`.
|
|
574
|
+
const namespaceFqn = indexes.namespaceFqnBindings;
|
|
560
575
|
for (const [nsName, bucket] of buckets) {
|
|
561
576
|
// Group sibling defs by simple name. Append in place — the previous
|
|
562
577
|
// `[...prev, def]` copy made this O(D²) per bucket, which on the
|
|
@@ -604,49 +619,39 @@ export function populateCsharpNamespaceSiblings(parsedFiles, indexes, inputs) {
|
|
|
604
619
|
}
|
|
605
620
|
continue;
|
|
606
621
|
}
|
|
607
|
-
//
|
|
608
|
-
//
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
//
|
|
612
|
-
//
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
// Bind the augmentation bucket and its seeded de-dup set together
|
|
628
|
-
// under one nullable lifecycle, so neither needs a non-null
|
|
629
|
-
// assertion (they are always set or unset as a pair). Stays lazy:
|
|
630
|
-
// nothing is allocated for a name with no cross-file defs.
|
|
631
|
-
let inject = null;
|
|
632
|
-
for (const def of defs) {
|
|
633
|
-
if (def.filePath === filePath)
|
|
634
|
-
continue; // don't self-reference
|
|
635
|
-
if (inject === null) {
|
|
636
|
-
const bucket = getAugmentationBucket(augmentations, scopeId, name);
|
|
637
|
-
// Seed the de-dup set from any entries an earlier pass
|
|
638
|
-
// (using-static / cross-namespace imports) already added,
|
|
639
|
-
// replacing the per-def O(A) `.some` scan.
|
|
640
|
-
const seen = new Set();
|
|
641
|
-
for (const b of bucket)
|
|
642
|
-
seen.add(b.def.nodeId);
|
|
643
|
-
inject = { bucket, seen };
|
|
622
|
+
// Named-namespace fast path (#1871) — the namespace-scoped mirror of the
|
|
623
|
+
// global path above. One `namespaceFqnBindings[nsName]` entry per simple
|
|
624
|
+
// name, O(D) per bucket, instead of the prior O(scopes × defs) per-scope
|
|
625
|
+
// augmentation that materialized O(files²) BindingRefs for a concentrated
|
|
626
|
+
// named namespace. `lookupBindingsAt` consults this gated by
|
|
627
|
+
// `accessibleNamespacesByScope` and ranks finalized `scope.bindings`
|
|
628
|
+
// (local declarations) ABOVE it, so local types still shadow — exactly as
|
|
629
|
+
// `walkScopeChain` shadows the global workspace entries. Dedup by
|
|
630
|
+
// `def.nodeId` keeps partial-class / duplicate declarations from
|
|
631
|
+
// double-emitting. (The prior local-shadow and self-reference skips are now
|
|
632
|
+
// handled by lookup precedence, identical to the global path.)
|
|
633
|
+
let nsMap = namespaceFqn.get(nsName);
|
|
634
|
+
for (const [name, defs] of defsByName) {
|
|
635
|
+
let bucketArr = nsMap?.get(name);
|
|
636
|
+
let seen = null;
|
|
637
|
+
for (const def of defs) {
|
|
638
|
+
if (bucketArr === undefined) {
|
|
639
|
+
if (nsMap === undefined) {
|
|
640
|
+
nsMap = new Map();
|
|
641
|
+
namespaceFqn.set(nsName, nsMap);
|
|
644
642
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
inject.seen.add(def.nodeId);
|
|
648
|
-
inject.bucket.push({ def, origin: 'namespace' });
|
|
643
|
+
bucketArr = [];
|
|
644
|
+
nsMap.set(name, bucketArr);
|
|
649
645
|
}
|
|
646
|
+
if (seen === null) {
|
|
647
|
+
seen = new Set();
|
|
648
|
+
for (const b of bucketArr)
|
|
649
|
+
seen.add(b.def.nodeId);
|
|
650
|
+
}
|
|
651
|
+
if (seen.has(def.nodeId))
|
|
652
|
+
continue;
|
|
653
|
+
seen.add(def.nodeId);
|
|
654
|
+
bucketArr.push({ def, origin: 'namespace' });
|
|
650
655
|
}
|
|
651
656
|
}
|
|
652
657
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag C# file-level type defs with their enclosing-namespace path on the
|
|
3
|
+
* sidecar `namespacePrefix` field — WITHOUT touching `qualifiedName` (mutating
|
|
4
|
+
* it corrupts simple-name heritage / base resolution; #2046 regression).
|
|
5
|
+
*
|
|
6
|
+
* `tagNamespacePrefixes` (shared) only reaches defs whose scope chain includes
|
|
7
|
+
* a Namespace scope. C# file-scoped `namespace X;` gives the Namespace scope a
|
|
8
|
+
* 1-line range, so top-level types land under the Module scope and are missed.
|
|
9
|
+
* This pass covers both block- and file-scoped namespaces so the qualified
|
|
10
|
+
* constructor resolver can break a same-tail collision (`new B.Foo()` with both
|
|
11
|
+
* `A.Foo` and `B.Foo`) by matching the explicit qualifier against the sidecar.
|
|
12
|
+
*/
|
|
13
|
+
import type { ParsedFile } from '../../../../_shared/index.js';
|
|
14
|
+
export declare function populateCsharpNamespacePrefixes(parsed: ParsedFile): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isClassLike } from '../../scope-resolution/scope/walkers.js';
|
|
2
|
+
function isTypeDef(def) {
|
|
3
|
+
return isClassLike(def.type) || def.type === 'Enum';
|
|
4
|
+
}
|
|
5
|
+
export function populateCsharpNamespacePrefixes(parsed) {
|
|
6
|
+
const scopesById = new Map();
|
|
7
|
+
for (const scope of parsed.scopes)
|
|
8
|
+
scopesById.set(scope.id, scope);
|
|
9
|
+
// The file's declared namespace (file-scoped `namespace X;`). First Namespace
|
|
10
|
+
// scope's own def qualifiedName; undefined when the file is namespace-free.
|
|
11
|
+
const fileNamespace = (() => {
|
|
12
|
+
for (const scope of parsed.scopes) {
|
|
13
|
+
if (scope.kind !== 'Namespace')
|
|
14
|
+
continue;
|
|
15
|
+
const nsDef = scope.ownedDefs.find((d) => d.type === 'Namespace');
|
|
16
|
+
const q = nsDef?.qualifiedName;
|
|
17
|
+
if (q !== undefined && q.length > 0)
|
|
18
|
+
return q;
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
})();
|
|
22
|
+
// Enclosing namespace path for a scope: nearest ancestor Namespace scope's
|
|
23
|
+
// full qualifiedName, else the file-scoped namespace (Module-parented types).
|
|
24
|
+
const namespaceOf = (scope) => {
|
|
25
|
+
let parentId = scope.parent;
|
|
26
|
+
while (parentId !== null) {
|
|
27
|
+
const parent = scopesById.get(parentId);
|
|
28
|
+
if (parent === undefined)
|
|
29
|
+
break;
|
|
30
|
+
if (parent.kind === 'Namespace') {
|
|
31
|
+
const nsDef = parent.ownedDefs.find((d) => d.type === 'Namespace');
|
|
32
|
+
const q = nsDef?.qualifiedName;
|
|
33
|
+
if (q !== undefined && q.length > 0)
|
|
34
|
+
return q;
|
|
35
|
+
}
|
|
36
|
+
if (parent.kind === 'Module')
|
|
37
|
+
return fileNamespace;
|
|
38
|
+
parentId = parent.parent;
|
|
39
|
+
}
|
|
40
|
+
return fileNamespace;
|
|
41
|
+
};
|
|
42
|
+
for (const scope of parsed.scopes) {
|
|
43
|
+
if (scope.kind !== 'Class')
|
|
44
|
+
continue;
|
|
45
|
+
const prefix = namespaceOf(scope);
|
|
46
|
+
if (prefix === undefined || prefix.length === 0)
|
|
47
|
+
continue;
|
|
48
|
+
for (const def of scope.ownedDefs) {
|
|
49
|
+
if (!isTypeDef(def))
|
|
50
|
+
continue;
|
|
51
|
+
if (def.namespacePrefix !== undefined)
|
|
52
|
+
continue;
|
|
53
|
+
const q = def.qualifiedName;
|
|
54
|
+
if (q === prefix || (q !== undefined && q.startsWith(`${prefix}.`)))
|
|
55
|
+
continue;
|
|
56
|
+
def.namespacePrefix = prefix;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -39,6 +39,12 @@ const CSHARP_SCOPE_QUERY = `
|
|
|
39
39
|
(namespace_declaration) @scope.namespace
|
|
40
40
|
(file_scoped_namespace_declaration) @scope.namespace
|
|
41
41
|
|
|
42
|
+
(namespace_declaration
|
|
43
|
+
name: (_) @declaration.name) @declaration.namespace
|
|
44
|
+
|
|
45
|
+
(file_scoped_namespace_declaration
|
|
46
|
+
name: (_) @declaration.name) @declaration.namespace
|
|
47
|
+
|
|
42
48
|
(class_declaration) @scope.class
|
|
43
49
|
(interface_declaration) @scope.class
|
|
44
50
|
(struct_declaration) @scope.class
|
|
@@ -480,6 +486,13 @@ const CSHARP_SCOPE_QUERY = `
|
|
|
480
486
|
(object_creation_expression
|
|
481
487
|
type: (qualified_name) @reference.call.constructor.qualified) @reference.call.constructor
|
|
482
488
|
|
|
489
|
+
;; Alias-qualified constructor: \`new MyAlias::Foo()\`, \`new global::Foo()\`. The
|
|
490
|
+
;; top-level type is an alias_qualified_name (a \`global::Ns.Foo\` qualifier nests
|
|
491
|
+
;; under qualified_name instead, covered above). No @reference.name here —
|
|
492
|
+
;; captures.ts derives the simple-name tail via terminalTypeNameNode.
|
|
493
|
+
(object_creation_expression
|
|
494
|
+
type: (alias_qualified_name) @reference.call.constructor.qualified) @reference.call.constructor
|
|
495
|
+
|
|
483
496
|
;; References — field/property writes: \`obj.Name = "x"\` emits a write
|
|
484
497
|
;; ACCESSES edge from the enclosing method to the field/property on
|
|
485
498
|
;; obj's class.
|
|
@@ -43,11 +43,13 @@ function findEnclosingTypeDeclaration(node) {
|
|
|
43
43
|
function typeName(typeNode) {
|
|
44
44
|
return typeNode.childForFieldName('name')?.text ?? null;
|
|
45
45
|
}
|
|
46
|
-
/** First entry in the type's `base_list`, read as raw text. C#
|
|
47
|
-
* generic and qualified bases (`Foo<T>`, `N.M.Base`); we keep
|
|
48
|
-
* form so downstream
|
|
49
|
-
*
|
|
50
|
-
* type
|
|
46
|
+
/** First entry in the type's `base_list`, read as raw type text. C#
|
|
47
|
+
* allows generic and qualified bases (`Foo<T>`, `N.M.Base`); we keep
|
|
48
|
+
* that form so downstream interpretation can strip generics and
|
|
49
|
+
* qualifiers consistently. A record primary-constructor base wraps
|
|
50
|
+
* its type and constructor arguments in `primary_constructor_base_type`,
|
|
51
|
+
* so read its `type` field instead of leaking `(args)` into the binding.
|
|
52
|
+
* Returns null when the type has no base (or an empty base_list). */
|
|
51
53
|
function firstBaseText(typeNode) {
|
|
52
54
|
for (let i = 0; i < typeNode.namedChildCount; i++) {
|
|
53
55
|
const child = typeNode.namedChild(i);
|
|
@@ -56,7 +58,9 @@ function firstBaseText(typeNode) {
|
|
|
56
58
|
const firstBase = child.namedChild(0);
|
|
57
59
|
if (firstBase === null)
|
|
58
60
|
return null;
|
|
59
|
-
return firstBase.
|
|
61
|
+
return firstBase.type === 'primary_constructor_base_type'
|
|
62
|
+
? (firstBase.childForFieldName('type')?.text ?? firstBase.text)
|
|
63
|
+
: firstBase.text;
|
|
60
64
|
}
|
|
61
65
|
return null;
|
|
62
66
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
9
9
|
import { buildMro, defaultLinearize } from '../../scope-resolution/passes/mro.js';
|
|
10
10
|
import { populateClassOwnedMembers } from '../../scope-resolution/scope/walkers.js';
|
|
11
|
+
import { populateCsharpNamespacePrefixes } from './qualified-type-names.js';
|
|
11
12
|
import { csharpProvider } from '../csharp.js';
|
|
12
13
|
import { csharpArityCompatibility, csharpMergeBindings, resolveCsharpImportTarget, } from './index.js';
|
|
13
14
|
import { populateCsharpNamespaceSiblings } from './namespace-siblings.js';
|
|
@@ -38,7 +39,13 @@ const csharpScopeResolver = {
|
|
|
38
39
|
// contract is (callsite, def).
|
|
39
40
|
arityCompatibility: (callsite, def) => csharpArityCompatibility(def, callsite),
|
|
40
41
|
buildMro: (graph, parsedFiles, nodeLookup) => buildMro(graph, parsedFiles, nodeLookup, defaultLinearize),
|
|
41
|
-
populateOwners: (parsed) =>
|
|
42
|
+
populateOwners: (parsed) => {
|
|
43
|
+
populateClassOwnedMembers(parsed);
|
|
44
|
+
// Sidecar-only namespace tagging (does NOT touch qualifiedName) so the
|
|
45
|
+
// qualified constructor resolver can break same-tail collisions like
|
|
46
|
+
// `new B.Foo()` by matching the explicit qualifier (#2046).
|
|
47
|
+
populateCsharpNamespacePrefixes(parsed);
|
|
48
|
+
},
|
|
42
49
|
// C# uses `base` for super-class dispatch, not `super`. Match as a
|
|
43
50
|
// plain identifier (no `()` call like Python's `super(...)`) — `base`
|
|
44
51
|
// is a keyword-like receiver, not a callable.
|
|
@@ -13,7 +13,6 @@ import { typeConfig as csharpConfig } from '../type-extractors/csharp.js';
|
|
|
13
13
|
import { csharpExportChecker } from '../export-detection.js';
|
|
14
14
|
import { createImportResolver } from '../import-resolvers/resolver-factory.js';
|
|
15
15
|
import { csharpImportConfig } from '../import-resolvers/configs/csharp.js';
|
|
16
|
-
import { extractCSharpNamedBindings } from '../named-bindings/csharp.js';
|
|
17
16
|
import { CSHARP_QUERIES } from '../tree-sitter-queries.js';
|
|
18
17
|
import { createCallExtractor } from '../call-extractors/generic.js';
|
|
19
18
|
import { csharpCallConfig } from '../call-extractors/configs/csharp.js';
|
|
@@ -23,7 +22,6 @@ import { createMethodExtractor } from '../method-extractors/generic.js';
|
|
|
23
22
|
import { csharpMethodConfig } from '../method-extractors/configs/csharp.js';
|
|
24
23
|
import { createVariableExtractor } from '../variable-extractors/generic.js';
|
|
25
24
|
import { csharpVariableConfig } from '../variable-extractors/configs/csharp.js';
|
|
26
|
-
import { createHeritageExtractor } from '../heritage-extractors/generic.js';
|
|
27
25
|
import { emitCsharpScopeCaptures, interpretCsharpImport, interpretCsharpTypeBinding, csharpBindingScopeFor, csharpImportOwningScope, csharpMergeBindings, csharpReceiverBinding, csharpArityCompatibility, resolveCsharpImportTarget, } from './csharp/index.js';
|
|
28
26
|
const BUILT_INS = new Set([
|
|
29
27
|
'Console',
|
|
@@ -175,15 +173,12 @@ export const csharpProvider = defineLanguage({
|
|
|
175
173
|
typeConfig: csharpConfig,
|
|
176
174
|
exportChecker: csharpExportChecker,
|
|
177
175
|
importResolver: createImportResolver(csharpImportConfig),
|
|
178
|
-
namedBindingExtractor: extractCSharpNamedBindings,
|
|
179
|
-
interfaceNamePattern: /^I[A-Z]/,
|
|
180
176
|
mroStrategy: 'implements-split',
|
|
181
177
|
callExtractor: createCallExtractor(csharpCallConfig),
|
|
182
178
|
fieldExtractor: createFieldExtractor(csharpFieldConfig),
|
|
183
179
|
methodExtractor: createMethodExtractor(csharpMethodConfig),
|
|
184
180
|
variableExtractor: createVariableExtractor(csharpVariableConfig),
|
|
185
181
|
classExtractor: createClassExtractor(csharpClassConfig),
|
|
186
|
-
heritageExtractor: createHeritageExtractor(SupportedLanguages.CSharp),
|
|
187
182
|
builtInNames: BUILT_INS,
|
|
188
183
|
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
189
184
|
// C# is the second migration after Python. See ./csharp/index.ts for
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute arity metadata from a Dart function-like node, reusing
|
|
3
|
+
* `dartMethodConfig.extractParameters` so scope-extracted defs carry the
|
|
4
|
+
* same semantics as the legacy parse-worker path. Mirror of
|
|
5
|
+
* `languages/swift/arity-metadata.ts` (and C#'s `computeCsharpArityMetadata`).
|
|
6
|
+
*
|
|
7
|
+
* Dart has no variadic parameters, so `parameterCount` is always the param
|
|
8
|
+
* total and the required count falls out of the optional flag:
|
|
9
|
+
* `requiredParameterCount = total − optionalCount`, where a non-`required`
|
|
10
|
+
* named param or an optional positional (`[...]`) param is optional.
|
|
11
|
+
*/
|
|
12
|
+
import type { SyntaxNode } from '../../utils/ast-helpers.js';
|
|
13
|
+
interface DartArityMetadata {
|
|
14
|
+
parameterCount: number | undefined;
|
|
15
|
+
requiredParameterCount: number | undefined;
|
|
16
|
+
parameterTypes: readonly string[] | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `fnNode` is the declaration WRAPPER node (`method_signature` /
|
|
20
|
+
* `declaration` / a top-level `function_signature` / `constructor_signature`).
|
|
21
|
+
* `dartMethodConfig.extractParameters` descends to the inner signature
|
|
22
|
+
* internally, so the wrapper is the correct node to pass.
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeDartArityMetadata(fnNode: SyntaxNode): DartArityMetadata;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute arity metadata from a Dart function-like node, reusing
|
|
3
|
+
* `dartMethodConfig.extractParameters` so scope-extracted defs carry the
|
|
4
|
+
* same semantics as the legacy parse-worker path. Mirror of
|
|
5
|
+
* `languages/swift/arity-metadata.ts` (and C#'s `computeCsharpArityMetadata`).
|
|
6
|
+
*
|
|
7
|
+
* Dart has no variadic parameters, so `parameterCount` is always the param
|
|
8
|
+
* total and the required count falls out of the optional flag:
|
|
9
|
+
* `requiredParameterCount = total − optionalCount`, where a non-`required`
|
|
10
|
+
* named param or an optional positional (`[...]`) param is optional.
|
|
11
|
+
*/
|
|
12
|
+
import { dartMethodConfig } from '../../method-extractors/configs/dart.js';
|
|
13
|
+
/**
|
|
14
|
+
* `fnNode` is the declaration WRAPPER node (`method_signature` /
|
|
15
|
+
* `declaration` / a top-level `function_signature` / `constructor_signature`).
|
|
16
|
+
* `dartMethodConfig.extractParameters` descends to the inner signature
|
|
17
|
+
* internally, so the wrapper is the correct node to pass.
|
|
18
|
+
*/
|
|
19
|
+
export function computeDartArityMetadata(fnNode) {
|
|
20
|
+
const params = dartMethodConfig.extractParameters?.(fnNode) ?? [];
|
|
21
|
+
let optionalCount = 0;
|
|
22
|
+
const types = [];
|
|
23
|
+
for (const p of params) {
|
|
24
|
+
if (p.isOptional)
|
|
25
|
+
optionalCount++;
|
|
26
|
+
if (p.type !== null)
|
|
27
|
+
types.push(p.type);
|
|
28
|
+
}
|
|
29
|
+
const total = params.length;
|
|
30
|
+
return {
|
|
31
|
+
parameterCount: total,
|
|
32
|
+
requiredParameterCount: total - optionalCount,
|
|
33
|
+
parameterTypes: types.length > 0 ? types : undefined,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dart arity compatibility (count-primary, labels soft) — mirror of
|
|
3
|
+
* `languages/swift/arity.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Dart parameters come in four flavours: required positional, optional
|
|
6
|
+
* positional (`[...]`), named (`{...}`), and required-named
|
|
7
|
+
* (`{required ...}`). `dartMethodConfig.extractParameters` collapses these
|
|
8
|
+
* into `isOptional` (a non-`required` named/optional-positional param is
|
|
9
|
+
* optional), which `computeDartArityMetadata` turns into
|
|
10
|
+
* `requiredParameterCount = total − optionalCount`. Named arguments are
|
|
11
|
+
* unordered and matched on COUNT only here — label-precise dispatch is left
|
|
12
|
+
* to the type-binding layer (Swift's documented "labels soft" decision).
|
|
13
|
+
* Dart has no variadic parameters, so the max bound always applies.
|
|
14
|
+
*
|
|
15
|
+
* NOTE arg order: `(def, callsite)` — matches the `LanguageProvider` hook.
|
|
16
|
+
* The `ScopeResolver` wires an adapter that flips the order to `(callsite, def)`.
|
|
17
|
+
*/
|
|
18
|
+
import type { Callsite, SymbolDefinition } from '../../../../_shared/index.js';
|
|
19
|
+
export declare function dartArityCompatibility(def: SymbolDefinition, callsite: Callsite): 'compatible' | 'unknown' | 'incompatible';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dart arity compatibility (count-primary, labels soft) — mirror of
|
|
3
|
+
* `languages/swift/arity.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Dart parameters come in four flavours: required positional, optional
|
|
6
|
+
* positional (`[...]`), named (`{...}`), and required-named
|
|
7
|
+
* (`{required ...}`). `dartMethodConfig.extractParameters` collapses these
|
|
8
|
+
* into `isOptional` (a non-`required` named/optional-positional param is
|
|
9
|
+
* optional), which `computeDartArityMetadata` turns into
|
|
10
|
+
* `requiredParameterCount = total − optionalCount`. Named arguments are
|
|
11
|
+
* unordered and matched on COUNT only here — label-precise dispatch is left
|
|
12
|
+
* to the type-binding layer (Swift's documented "labels soft" decision).
|
|
13
|
+
* Dart has no variadic parameters, so the max bound always applies.
|
|
14
|
+
*
|
|
15
|
+
* NOTE arg order: `(def, callsite)` — matches the `LanguageProvider` hook.
|
|
16
|
+
* The `ScopeResolver` wires an adapter that flips the order to `(callsite, def)`.
|
|
17
|
+
*/
|
|
18
|
+
export function dartArityCompatibility(def, callsite) {
|
|
19
|
+
const max = def.parameterCount;
|
|
20
|
+
const min = def.requiredParameterCount;
|
|
21
|
+
if (max === undefined && min === undefined)
|
|
22
|
+
return 'unknown';
|
|
23
|
+
const argCount = callsite.arity;
|
|
24
|
+
if (argCount === undefined || !Number.isFinite(argCount) || argCount < 0)
|
|
25
|
+
return 'unknown';
|
|
26
|
+
if (min !== undefined && argCount < min)
|
|
27
|
+
return 'incompatible';
|
|
28
|
+
if (max !== undefined && argCount > max)
|
|
29
|
+
return 'incompatible';
|
|
30
|
+
return 'compatible';
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dart built-in / framework names whose calls the legacy DAG suppresses
|
|
3
|
+
* (Flutter / Dart-SDK members not part of the indexed workspace). The
|
|
4
|
+
* registry-primary capture walk skips emitting call references for these so
|
|
5
|
+
* its CALLS graph matches the legacy DAG — which suppresses built-in-named
|
|
6
|
+
* calls via `isBuiltInName` BEFORE resolution, for both free and member calls.
|
|
7
|
+
*
|
|
8
|
+
* Leaf module: shared by the provider (`builtInNames`) and `captures.ts`
|
|
9
|
+
* without an import cycle (`dart.ts` → `dart/index.ts` → `captures.ts`).
|
|
10
|
+
*/
|
|
11
|
+
export declare const DART_BUILT_INS: ReadonlySet<string>;
|