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
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Pure given the input source text. No I/O, no globals consulted.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { nodeIfType, nodeToCapture, syntheticCapture, walkNamedTree, } from '../../utils/ast-helpers.js';
|
|
19
19
|
import { splitUsingDirective } from './import-decomposer.js';
|
|
20
20
|
import { computeCsharpArityMetadata } from './arity-metadata.js';
|
|
21
21
|
import { synthesizeCsharpReceiverBinding } from './receiver-binding.js';
|
|
@@ -70,10 +70,11 @@ function shouldEmitReadMember(memberNode) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
//
|
|
73
|
+
// Reuse a pre-parsed Tree when the caller passes one via `cachedTree`; a
|
|
74
|
+
// miss re-parses. (The cache is currently always empty — its only producer,
|
|
75
|
+
// the sequential parser, was removed — so this re-parses in practice.) The
|
|
76
|
+
// cachedTree parameter is typed `unknown` at the LanguageProvider contract
|
|
77
|
+
// layer; cast here at the use site.
|
|
77
78
|
let tree = cachedTree;
|
|
78
79
|
if (tree === undefined) {
|
|
79
80
|
tree = parseSourceSafe(getCsharpParser(), sourceText, undefined, {
|
|
@@ -91,9 +92,16 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
91
92
|
// `@`; we put it back so the central extractor's prefix lookups
|
|
92
93
|
// (`@scope.`, `@declaration.`, …) work.
|
|
93
94
|
const grouped = {};
|
|
95
|
+
// Parallel tag -> captured SyntaxNode map: the query hands us each matched
|
|
96
|
+
// node as c.node, so anchors resolve via a type-guarded lookup (nodeIfType)
|
|
97
|
+
// instead of re-deriving them with findNodeAtRange(tree.rootNode, ...) per
|
|
98
|
+
// match — the O(matches x rootChildren) root-walk fixed for go #1915 /
|
|
99
|
+
// python #1918, mirrored here.
|
|
100
|
+
const nodeMap = {};
|
|
94
101
|
for (const c of m.captures) {
|
|
95
102
|
const tag = '@' + c.name;
|
|
96
103
|
grouped[tag] = nodeToCapture(tag, c.node);
|
|
104
|
+
nodeMap[tag] = c.node;
|
|
97
105
|
}
|
|
98
106
|
if (Object.keys(grouped).length === 0)
|
|
99
107
|
continue;
|
|
@@ -101,8 +109,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
101
109
|
// the kind/source/name/alias markers it consumes. Raw query match
|
|
102
110
|
// only carries the @import.statement anchor.
|
|
103
111
|
if (grouped['@import.statement'] !== undefined) {
|
|
104
|
-
const
|
|
105
|
-
const stmtNode = findNodeAtRange(tree.rootNode, stmtCapture.range, 'using_directive');
|
|
112
|
+
const stmtNode = nodeIfType(nodeMap['@import.statement'], 'using_directive');
|
|
106
113
|
if (stmtNode !== null) {
|
|
107
114
|
const decomposed = splitUsingDirective(stmtNode);
|
|
108
115
|
if (decomposed !== null) {
|
|
@@ -116,8 +123,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
116
123
|
continue;
|
|
117
124
|
}
|
|
118
125
|
if (grouped['@reference.read.member'] !== undefined) {
|
|
119
|
-
const
|
|
120
|
-
const memberNode = findNodeAtRange(tree.rootNode, anchor.range, 'member_access_expression');
|
|
126
|
+
const memberNode = nodeIfType(nodeMap['@reference.read.member'], 'member_access_expression');
|
|
121
127
|
if (memberNode === null || !shouldEmitReadMember(memberNode)) {
|
|
122
128
|
continue;
|
|
123
129
|
}
|
|
@@ -130,8 +136,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
130
136
|
// `@scope.function` matches.
|
|
131
137
|
if (grouped['@scope.function'] !== undefined) {
|
|
132
138
|
out.push(grouped);
|
|
133
|
-
const
|
|
134
|
-
const fnNode = findFunctionNode(tree.rootNode, anchor.range);
|
|
139
|
+
const fnNode = nodeIfType(nodeMap['@scope.function'], ...FUNCTION_NODE_TYPES);
|
|
135
140
|
if (fnNode !== null) {
|
|
136
141
|
for (const synth of synthesizeCsharpReceiverBinding(fnNode)) {
|
|
137
142
|
out.push(synth);
|
|
@@ -145,8 +150,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
145
150
|
// the first tag that matches.
|
|
146
151
|
const declTag = FUNCTION_DECL_TAGS.find((t) => grouped[t] !== undefined);
|
|
147
152
|
if (declTag !== undefined) {
|
|
148
|
-
const
|
|
149
|
-
const fnNode = findFunctionNode(tree.rootNode, anchor.range);
|
|
153
|
+
const fnNode = nodeIfType(nodeMap[declTag], ...FUNCTION_NODE_TYPES);
|
|
150
154
|
if (fnNode !== null) {
|
|
151
155
|
const arity = computeCsharpArityMetadata(fnNode);
|
|
152
156
|
if (arity.parameterCount !== undefined) {
|
|
@@ -160,6 +164,26 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
}
|
|
167
|
+
// Qualified constructor calls — `new Ns.Foo()`, `new A.B.Foo()`,
|
|
168
|
+
// `new Ns.Box<int>()` — bind only `@reference.call.constructor.qualified`
|
|
169
|
+
// with NO `@reference.name`, so the central extractor falls back to the
|
|
170
|
+
// whole-expression anchor and the reference name becomes the raw
|
|
171
|
+
// `new Ns.Foo()` text (never resolves). Derive the bare simple-name tail via
|
|
172
|
+
// the same `terminalTypeNameNode` helper the inheritance synth uses — it
|
|
173
|
+
// handles qualified_name, a generic tail (`Ns.Box<int>` → `Box`), and
|
|
174
|
+
// alias_qualified_name (`global::Ns.Foo`). Mirrors Java F35 (#1928).
|
|
175
|
+
if (grouped['@reference.call.constructor.qualified'] !== undefined &&
|
|
176
|
+
grouped['@reference.name'] === undefined) {
|
|
177
|
+
const qNode = nodeMap['@reference.call.constructor.qualified'];
|
|
178
|
+
const nameNode = qNode === undefined ? null : terminalTypeNameNode(qNode);
|
|
179
|
+
if (nameNode !== null) {
|
|
180
|
+
grouped['@reference.name'] = nodeToCapture('@reference.name', nameNode);
|
|
181
|
+
const qText = qNode.text.trim();
|
|
182
|
+
if (qText.length > 0 && qText !== nameNode.text) {
|
|
183
|
+
grouped['@reference.qualified-name'] = syntheticCapture('@reference.qualified-name', qNode, qText);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
163
187
|
// Synthesize `@reference.arity` on every callsite so the
|
|
164
188
|
// registry's arity filter can narrow overloads. Count the
|
|
165
189
|
// `argument` named children of the backing `argument_list`.
|
|
@@ -168,9 +192,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
168
192
|
// resolution.
|
|
169
193
|
const callTag = ['@reference.call.free', '@reference.call.member', '@reference.call.constructor'].find((t) => grouped[t] !== undefined);
|
|
170
194
|
if (callTag !== undefined && grouped['@reference.arity'] === undefined) {
|
|
171
|
-
const
|
|
172
|
-
const callNode = findNodeAtRange(tree.rootNode, anchor.range, 'invocation_expression') ??
|
|
173
|
-
findNodeAtRange(tree.rootNode, anchor.range, 'object_creation_expression');
|
|
195
|
+
const callNode = nodeIfType(nodeMap[callTag], 'invocation_expression', 'object_creation_expression');
|
|
174
196
|
if (callNode !== null) {
|
|
175
197
|
const argList = callNode.childForFieldName('arguments');
|
|
176
198
|
const args = argList === null
|
|
@@ -195,9 +217,7 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
195
217
|
// `new User(...)` resolves to a Constructor def in memberByOwner.
|
|
196
218
|
if (grouped['@declaration.class'] !== undefined ||
|
|
197
219
|
grouped['@declaration.record'] !== undefined) {
|
|
198
|
-
const
|
|
199
|
-
const typeNode = findNodeAtRange(tree.rootNode, anchor.range, 'class_declaration') ??
|
|
200
|
-
findNodeAtRange(tree.rootNode, anchor.range, 'record_declaration');
|
|
220
|
+
const typeNode = nodeIfType(nodeMap['@declaration.class'] ?? nodeMap['@declaration.record'], 'class_declaration', 'record_declaration');
|
|
201
221
|
if (typeNode !== null) {
|
|
202
222
|
const synth = synthesizePrimaryConstructor(typeNode);
|
|
203
223
|
if (synth !== null)
|
|
@@ -206,13 +226,153 @@ export function emitCsharpScopeCaptures(sourceText, _filePath, cachedTree) {
|
|
|
206
226
|
}
|
|
207
227
|
}
|
|
208
228
|
out.push(...synthesizeGenericTypeArgumentReferences(tree.rootNode));
|
|
229
|
+
out.push(...synthesizeCsharpInheritanceReferences(tree.rootNode));
|
|
230
|
+
out.push(...synthesizeCsharpConstructorInitializerReferences(tree.rootNode));
|
|
231
|
+
return out;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Synthesize `@reference.call.constructor` captures for C# constructor
|
|
235
|
+
* initializers — `: base(...)` and `: this(...)` (F38 analog of Java #1928).
|
|
236
|
+
* tree-sitter-c-sharp models these as `constructor_initializer` nodes the scope
|
|
237
|
+
* query never matched, so the chained-constructor CALLS edges (derived ctor →
|
|
238
|
+
* base ctor; ctor → sibling overload) were silently dropped.
|
|
239
|
+
*
|
|
240
|
+
* The initializer carries no constructor name (the `base`/`this` child is a bare
|
|
241
|
+
* keyword token), so the target is resolved structurally:
|
|
242
|
+
* - `this(...)` → the enclosing type's own simple name.
|
|
243
|
+
* - `base(...)` → the enclosing class/record's base type, reduced to its bare
|
|
244
|
+
* simple name via `terminalTypeNameNode`. C# requires the base class first in
|
|
245
|
+
* a mixed list (`class C : Base, IFoo`); interface-only lists (`class C : IFoo`)
|
|
246
|
+
* imply implicit `System.Object` — no `@reference` is emitted when the first
|
|
247
|
+
* non-builtin base would be an interface-only target (resolution also drops
|
|
248
|
+
* Interface-typed constructor targets in `free-call-fallback`).
|
|
249
|
+
* Arity is attached for overload disambiguation, mirroring `new X(...)`.
|
|
250
|
+
*/
|
|
251
|
+
function synthesizeCsharpConstructorInitializerReferences(root) {
|
|
252
|
+
const out = [];
|
|
253
|
+
walkNamedTree(root, (node) => {
|
|
254
|
+
if (node.type !== 'constructor_initializer')
|
|
255
|
+
return;
|
|
256
|
+
let kind = null;
|
|
257
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
258
|
+
const t = node.child(i)?.type;
|
|
259
|
+
if (t === 'base' || t === 'this') {
|
|
260
|
+
kind = t;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (kind === null)
|
|
265
|
+
return;
|
|
266
|
+
const enclosingType = findEnclosingTypeDeclaration(node);
|
|
267
|
+
if (enclosingType === null)
|
|
268
|
+
return;
|
|
269
|
+
let targetNameNode = null;
|
|
270
|
+
if (kind === 'this') {
|
|
271
|
+
targetNameNode = enclosingType.childForFieldName('name');
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
const baseList = findNamedChild(enclosingType, 'base_list');
|
|
275
|
+
if (baseList === null)
|
|
276
|
+
return;
|
|
277
|
+
// Prefer the first non-builtin entry (idiomatically the base class). When
|
|
278
|
+
// the list is interface-only (`class C : IFoo`), do not synthesize a
|
|
279
|
+
// `base(...)` ref — valid C# chains to implicit Object, not IFoo (#2046).
|
|
280
|
+
let sawNonBuiltin = false;
|
|
281
|
+
for (const base of baseList.namedChildren) {
|
|
282
|
+
if (base === null)
|
|
283
|
+
continue;
|
|
284
|
+
const n = terminalTypeNameNode(base);
|
|
285
|
+
if (n === null || BUILTIN_TYPE_NAMES.has(n.text))
|
|
286
|
+
continue;
|
|
287
|
+
sawNonBuiltin = true;
|
|
288
|
+
targetNameNode = n;
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
if (!sawNonBuiltin)
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (targetNameNode === null)
|
|
295
|
+
return;
|
|
296
|
+
const argList = findNamedChild(node, 'argument_list');
|
|
297
|
+
const arity = argList === null
|
|
298
|
+
? 0
|
|
299
|
+
: argList.namedChildren.filter((c) => c !== null && c.type === 'argument').length;
|
|
300
|
+
out.push({
|
|
301
|
+
'@reference.call.constructor': nodeToCapture('@reference.call.constructor', node),
|
|
302
|
+
'@reference.name': nodeToCapture('@reference.name', targetNameNode),
|
|
303
|
+
'@reference.arity': syntheticCapture('@reference.arity', node, String(arity)),
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
return out;
|
|
307
|
+
}
|
|
308
|
+
function findEnclosingTypeDeclaration(node) {
|
|
309
|
+
let cur = node.parent;
|
|
310
|
+
while (cur !== null) {
|
|
311
|
+
if (cur.type === 'class_declaration' ||
|
|
312
|
+
cur.type === 'struct_declaration' ||
|
|
313
|
+
cur.type === 'record_declaration') {
|
|
314
|
+
return cur;
|
|
315
|
+
}
|
|
316
|
+
cur = cur.parent;
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Synthesize `@reference.inherits` captures from C# base lists so the
|
|
322
|
+
* registry-primary scope-resolution path emits EXTENDS / IMPLEMENTS edges
|
|
323
|
+
* (mirrors C++ `emitCppInheritanceCaptures`). Without this, C# inheritance
|
|
324
|
+
* edges came only from the legacy heritage-capture leg (removed in #942),
|
|
325
|
+
* which is dropped for registry-primary languages in the worker pipeline
|
|
326
|
+
* (issue #1951).
|
|
327
|
+
*
|
|
328
|
+
* Scope covers every `base_list`-bearing declaration the legacy heritage
|
|
329
|
+
* leg matched: `class_declaration`, `interface_declaration`,
|
|
330
|
+
* `record_declaration`, and `struct_declaration`. Records and structs were
|
|
331
|
+
* dropped before (#1951): a `record R(...) : Base(args), IFoo` or
|
|
332
|
+
* `struct S : IFoo, ns.IBar` produced no registry-primary inheritance edge
|
|
333
|
+
* even though the legacy heritage query covered them. The
|
|
334
|
+
* EXTENDS-vs-IMPLEMENTS split is decided downstream from the resolved target's
|
|
335
|
+
* symbol kind (`preEmitInheritanceEdges`), so all bases are emitted with the
|
|
336
|
+
* same `inherits` kind here; the base lookup name is normalized to its bare
|
|
337
|
+
* simple identifier (`IRepository<T>` → `IRepository`, `A.B.IFace` → `IFace`,
|
|
338
|
+
* `Base(args)` primary-ctor base → `Base`, `MyAlias::Foo` → `Foo`) to match
|
|
339
|
+
* the V1 simple-name `findClassBindingInScope` contract — exactly the bare
|
|
340
|
+
* text `normalizeSupertypeName` (supertype-alternation.ts) reduces each shape
|
|
341
|
+
* to on the legacy leg.
|
|
342
|
+
*/
|
|
343
|
+
function synthesizeCsharpInheritanceReferences(root) {
|
|
344
|
+
const out = [];
|
|
345
|
+
walkNamedTree(root, (node) => {
|
|
346
|
+
if (node.type !== 'class_declaration' &&
|
|
347
|
+
node.type !== 'interface_declaration' &&
|
|
348
|
+
node.type !== 'record_declaration' &&
|
|
349
|
+
node.type !== 'struct_declaration') {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
const baseList = findNamedChild(node, 'base_list');
|
|
353
|
+
if (baseList === null)
|
|
354
|
+
return;
|
|
355
|
+
for (const base of baseList.namedChildren) {
|
|
356
|
+
if (base === null)
|
|
357
|
+
continue;
|
|
358
|
+
const nameNode = terminalTypeNameNode(base);
|
|
359
|
+
if (nameNode === null)
|
|
360
|
+
continue;
|
|
361
|
+
if (BUILTIN_TYPE_NAMES.has(nameNode.text))
|
|
362
|
+
continue;
|
|
363
|
+
out.push({
|
|
364
|
+
'@reference.inherits': nodeToCapture('@reference.inherits', base),
|
|
365
|
+
'@reference.name': nodeToCapture('@reference.name', nameNode),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
});
|
|
209
369
|
return out;
|
|
210
370
|
}
|
|
211
371
|
function synthesizeGenericTypeArgumentReferences(root) {
|
|
212
372
|
const out = [];
|
|
213
373
|
// Treat all generic type arguments as static type references, including
|
|
214
374
|
// declaration signatures and call-site generic instantiations.
|
|
215
|
-
|
|
375
|
+
walkNamedTree(root, (node) => {
|
|
216
376
|
if (node.type !== 'generic_name')
|
|
217
377
|
return;
|
|
218
378
|
const args = findNamedChild(node, 'type_argument_list');
|
|
@@ -240,10 +400,32 @@ function terminalTypeNameNode(node) {
|
|
|
240
400
|
return node;
|
|
241
401
|
case 'nullable_type':
|
|
242
402
|
return node.firstNamedChild === null ? null : terminalTypeNameNode(node.firstNamedChild);
|
|
243
|
-
case 'qualified_name':
|
|
244
|
-
|
|
403
|
+
case 'qualified_name': {
|
|
404
|
+
// `A.B.Base` -> tail identifier `Base`; `A.B.Base<T>` -> the tail is a
|
|
405
|
+
// `generic_name`, so recurse to drop the type arguments and reach the
|
|
406
|
+
// bare base identifier (#1951).
|
|
407
|
+
const tail = node.lastNamedChild;
|
|
408
|
+
return tail === null ? null : terminalTypeNameNode(tail);
|
|
409
|
+
}
|
|
410
|
+
case 'alias_qualified_name': {
|
|
411
|
+
// `MyAlias::Foo` / `global::IDisposable` -> the `name` field is the bare
|
|
412
|
+
// identifier (the `alias` is the qualifier). Mirrors
|
|
413
|
+
// normalizeSupertypeName's `name`-field reduction for this shape (#1951).
|
|
414
|
+
const name = node.childForFieldName('name');
|
|
415
|
+
return name === null ? null : terminalTypeNameNode(name);
|
|
416
|
+
}
|
|
417
|
+
case 'primary_constructor_base_type': {
|
|
418
|
+
// record base with a constructor call: `Base(args)` / `pkg.Base(id)` /
|
|
419
|
+
// `Box<int>(id)`. The `type` field holds the supertype (identifier /
|
|
420
|
+
// qualified_name / generic_name); the trailing argument_list is dropped.
|
|
421
|
+
// Mirrors normalizeSupertypeName's `type`-field reduction (#1951).
|
|
422
|
+
const type = node.childForFieldName('type');
|
|
423
|
+
return type === null ? null : terminalTypeNameNode(type);
|
|
424
|
+
}
|
|
245
425
|
case 'generic_name':
|
|
246
|
-
|
|
426
|
+
// generic_name has no `name` field (verified by real parse, #1920); the
|
|
427
|
+
// base identifier is the first named child.
|
|
428
|
+
return node.firstNamedChild;
|
|
247
429
|
default:
|
|
248
430
|
return null;
|
|
249
431
|
}
|
|
@@ -255,13 +437,6 @@ function findNamedChild(node, type) {
|
|
|
255
437
|
}
|
|
256
438
|
return null;
|
|
257
439
|
}
|
|
258
|
-
function visit(node, cb) {
|
|
259
|
-
cb(node);
|
|
260
|
-
for (const child of node.namedChildren) {
|
|
261
|
-
if (child !== null)
|
|
262
|
-
visit(child, cb);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
440
|
/** C# 12 primary constructor: `class X(a, b) { }` / `record X(a, b)`.
|
|
266
441
|
* The parameters are a bare `parameter_list` named child of the type
|
|
267
442
|
* declaration (no `constructor_declaration` node). Emit a synthetic
|
|
@@ -333,14 +508,3 @@ function inferArgType(argNode) {
|
|
|
333
508
|
return '';
|
|
334
509
|
}
|
|
335
510
|
}
|
|
336
|
-
/** Find the first C# function-like node at the given range. The
|
|
337
|
-
* declaration anchor range covers the whole method/constructor/etc.
|
|
338
|
-
* node, but the tag alone doesn't tell us which node type. */
|
|
339
|
-
function findFunctionNode(rootNode, range) {
|
|
340
|
-
for (const nodeType of FUNCTION_NODE_TYPES) {
|
|
341
|
-
const n = findNodeAtRange(rootNode, range, nodeType);
|
|
342
|
-
if (n !== null)
|
|
343
|
-
return n;
|
|
344
|
-
}
|
|
345
|
-
return null;
|
|
346
|
-
}
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
* `using static X = Y.Z;`, attributes, and preprocessor-gated
|
|
69
69
|
* declarations are all recognized correctly.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* of these matter in practice
|
|
73
|
-
*
|
|
74
|
-
* `test/integration/resolvers/csharp.test.ts`.
|
|
71
|
+
* The `test/integration/resolvers/csharp.test.ts` resolver suite is the
|
|
72
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
73
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
75
74
|
*/
|
|
76
75
|
export { emitCsharpScopeCaptures } from './captures.js';
|
|
77
76
|
export { getCsharpCaptureCacheStats, resetCsharpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
* `using static X = Y.Z;`, attributes, and preprocessor-gated
|
|
69
69
|
* declarations are all recognized correctly.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
* of these matter in practice
|
|
73
|
-
*
|
|
74
|
-
* `test/integration/resolvers/csharp.test.ts`.
|
|
71
|
+
* The `test/integration/resolvers/csharp.test.ts` resolver suite is the
|
|
72
|
+
* authoritative signal for which of these matter in practice; it runs in
|
|
73
|
+
* the standard CI test workflow, so a regression blocks the merge.
|
|
75
74
|
*/
|
|
76
75
|
export { emitCsharpScopeCaptures } from './captures.js';
|
|
77
76
|
export { getCsharpCaptureCacheStats, resetCsharpCaptureCacheStats } from './cache-stats.js';
|
|
@@ -122,10 +122,24 @@ function stripGeneric(text) {
|
|
|
122
122
|
* receiver's generic type based on the suffix — `data.Values` →
|
|
123
123
|
* element type of `data`'s Dictionary<K,V>. */
|
|
124
124
|
function stripQualifier(text) {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
// Strip only the outermost qualifier: the last `.` at generic nesting depth 0.
|
|
126
|
+
// This preserves F41 (never cut inside `Dictionary<string, Ns.User>`) AND
|
|
127
|
+
// nested types through a generic outer (`Ns.Outer<int>.Inner` → `Inner`, not
|
|
128
|
+
// `Outer<int>.Inner` — #2046 P3).
|
|
129
|
+
let depth = 0;
|
|
130
|
+
let lastDotAtDepth0 = -1;
|
|
131
|
+
for (let i = 0; i < text.length; i++) {
|
|
132
|
+
const c = text[i];
|
|
133
|
+
if (c === '<')
|
|
134
|
+
depth++;
|
|
135
|
+
else if (c === '>')
|
|
136
|
+
depth = Math.max(0, depth - 1);
|
|
137
|
+
else if (c === '.' && depth === 0)
|
|
138
|
+
lastDotAtDepth0 = i;
|
|
139
|
+
}
|
|
140
|
+
if (lastDotAtDepth0 === -1)
|
|
127
141
|
return text;
|
|
128
|
-
const tail = text.slice(
|
|
142
|
+
const tail = text.slice(lastDotAtDepth0 + 1);
|
|
129
143
|
if (COLLECTION_ACCESSOR_SUFFIXES.has(tail))
|
|
130
144
|
return text;
|
|
131
145
|
return tail;
|
|
@@ -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,
|
|
@@ -84,8 +93,9 @@ export declare function createCsharpStructureScanner(): CsharpStructureLineScann
|
|
|
84
93
|
export declare function extractCsharpStructureViaScanner(content: string): CsharpFileStructure;
|
|
85
94
|
/** Content + (optional) pre-parsed tree-sitter trees keyed by filePath.
|
|
86
95
|
* The orchestrator builds `fileContents` from the pipeline's file list;
|
|
87
|
-
* `treeCache` is
|
|
88
|
-
*
|
|
96
|
+
* `treeCache` is currently always empty (its only producer, the sequential
|
|
97
|
+
* parser, was removed), so the providers re-parse. Kept as an extension
|
|
98
|
+
* point that would let cache hits avoid a second `parser.parse()`. */
|
|
89
99
|
export interface CsharpSiblingInputs {
|
|
90
100
|
readonly fileContents: ReadonlyMap<string, string>;
|
|
91
101
|
readonly treeCache?: {
|