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
|
@@ -23,32 +23,6 @@
|
|
|
23
23
|
* Pure given the input node. No I/O, no globals.
|
|
24
24
|
*/
|
|
25
25
|
import type { SyntaxNode } from '../../utils/ast-helpers.js';
|
|
26
|
-
/**
|
|
27
|
-
* Array prototype higher-order methods whose result is a value, not a
|
|
28
|
-
* function. A callback passed to one of these is an anonymous callback,
|
|
29
|
-
* never a top-level function definition. Identifier-callee HOCs
|
|
30
|
-
* (`forwardRef(...)`, `useCallback(...)`, custom factories) are
|
|
31
|
-
* deliberately NOT listed — they keep their `Function` classification.
|
|
32
|
-
*
|
|
33
|
-
* Trade-off (unchanged from before #1876): a custom *fluent-API* member
|
|
34
|
-
* call with a callback whose method name is not in this set
|
|
35
|
-
* (`qb.where(x => …)`) still classifies as `Function`. There is no clean
|
|
36
|
-
* syntactic line beyond the well-known Array surface, so the set is
|
|
37
|
-
* intentionally closed and easy to extend.
|
|
38
|
-
*
|
|
39
|
-
* Receiver-blind, by design: the match keys on the method NAME only, never
|
|
40
|
-
* the receiver type (tree-sitter has no type information here). So an in-set
|
|
41
|
-
* name on a NON-array receiver — `Map`/`Set` `.forEach`, an RxJS
|
|
42
|
-
* `observable.map(…)`, a query builder `.sort(…)`, a lodash chain
|
|
43
|
-
* `.filter(…)` — is ALSO treated as a callback and has its
|
|
44
|
-
* `@declaration.function` dropped. This is an accepted limitation, not a
|
|
45
|
-
* regression: those bindings hold the call's *result value*, not a callable,
|
|
46
|
-
* so a value def is the correct classification anyway. The only genuine loss
|
|
47
|
-
* is a bespoke DSL whose in-set-named method returns something callable —
|
|
48
|
-
* rare enough to accept rather than guard with type inference. Pinned by the
|
|
49
|
-
* "in-set method on a non-array receiver" case in `*-captures.test.ts`.
|
|
50
|
-
*/
|
|
51
|
-
export declare const ARRAY_CALLBACK_METHODS: ReadonlySet<string>;
|
|
52
26
|
/**
|
|
53
27
|
* True when `node` (an `arrow_function` / `function_expression`) is the
|
|
54
28
|
* callback argument of an array higher-order-method call, i.e. the
|
|
@@ -60,8 +34,8 @@ export declare const ARRAY_CALLBACK_METHODS: ReadonlySet<string>;
|
|
|
60
34
|
* (`forwardRef(() => …)` — callee is an `identifier`, not a
|
|
61
35
|
* `member_expression`), so neither is ever suppressed.
|
|
62
36
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
37
|
+
* The helper itself only handles direct `member_expression` callees. Broader
|
|
38
|
+
* shapes like `(arr.map)(cb)` and `arr['map'](cb)` are now filtered at the
|
|
39
|
+
* query layer, so this emit-side check stays focused on the direct fallback.
|
|
66
40
|
*/
|
|
67
41
|
export declare function isArrayMethodCallbackArrow(node: SyntaxNode): boolean;
|
|
@@ -22,46 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* Pure given the input node. No I/O, no globals.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
|
-
* Array prototype higher-order methods whose result is a value, not a
|
|
27
|
-
* function. A callback passed to one of these is an anonymous callback,
|
|
28
|
-
* never a top-level function definition. Identifier-callee HOCs
|
|
29
|
-
* (`forwardRef(...)`, `useCallback(...)`, custom factories) are
|
|
30
|
-
* deliberately NOT listed — they keep their `Function` classification.
|
|
31
|
-
*
|
|
32
|
-
* Trade-off (unchanged from before #1876): a custom *fluent-API* member
|
|
33
|
-
* call with a callback whose method name is not in this set
|
|
34
|
-
* (`qb.where(x => …)`) still classifies as `Function`. There is no clean
|
|
35
|
-
* syntactic line beyond the well-known Array surface, so the set is
|
|
36
|
-
* intentionally closed and easy to extend.
|
|
37
|
-
*
|
|
38
|
-
* Receiver-blind, by design: the match keys on the method NAME only, never
|
|
39
|
-
* the receiver type (tree-sitter has no type information here). So an in-set
|
|
40
|
-
* name on a NON-array receiver — `Map`/`Set` `.forEach`, an RxJS
|
|
41
|
-
* `observable.map(…)`, a query builder `.sort(…)`, a lodash chain
|
|
42
|
-
* `.filter(…)` — is ALSO treated as a callback and has its
|
|
43
|
-
* `@declaration.function` dropped. This is an accepted limitation, not a
|
|
44
|
-
* regression: those bindings hold the call's *result value*, not a callable,
|
|
45
|
-
* so a value def is the correct classification anyway. The only genuine loss
|
|
46
|
-
* is a bespoke DSL whose in-set-named method returns something callable —
|
|
47
|
-
* rare enough to accept rather than guard with type inference. Pinned by the
|
|
48
|
-
* "in-set method on a non-array receiver" case in `*-captures.test.ts`.
|
|
49
|
-
*/
|
|
50
|
-
export const ARRAY_CALLBACK_METHODS = new Set([
|
|
51
|
-
'map',
|
|
52
|
-
'filter',
|
|
53
|
-
'find',
|
|
54
|
-
'findIndex',
|
|
55
|
-
'findLast',
|
|
56
|
-
'findLastIndex',
|
|
57
|
-
'forEach',
|
|
58
|
-
'reduce',
|
|
59
|
-
'reduceRight',
|
|
60
|
-
'some',
|
|
61
|
-
'every',
|
|
62
|
-
'flatMap',
|
|
63
|
-
'sort',
|
|
64
|
-
]);
|
|
25
|
+
import { ARRAY_CALLBACK_METHODS } from '../../ts-js-hoc-utils.js';
|
|
65
26
|
/**
|
|
66
27
|
* True when `node` (an `arrow_function` / `function_expression`) is the
|
|
67
28
|
* callback argument of an array higher-order-method call, i.e. the
|
|
@@ -73,9 +34,9 @@ export const ARRAY_CALLBACK_METHODS = new Set([
|
|
|
73
34
|
* (`forwardRef(() => …)` — callee is an `identifier`, not a
|
|
74
35
|
* `member_expression`), so neither is ever suppressed.
|
|
75
36
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
37
|
+
* The helper itself only handles direct `member_expression` callees. Broader
|
|
38
|
+
* shapes like `(arr.map)(cb)` and `arr['map'](cb)` are now filtered at the
|
|
39
|
+
* query layer, so this emit-side check stays focused on the direct fallback.
|
|
79
40
|
*/
|
|
80
41
|
export function isArrayMethodCallbackArrow(node) {
|
|
81
42
|
const args = node.parent;
|
|
@@ -33,6 +33,7 @@ import { computeTsArityMetadata } from './arity-metadata.js';
|
|
|
33
33
|
import { isArrayMethodCallbackArrow } from './array-callback.js';
|
|
34
34
|
import { getTreeSitterBufferSize } from '../../constants.js';
|
|
35
35
|
import { parseSourceSafe } from '../../../tree-sitter/safe-parse.js';
|
|
36
|
+
import { deriveDefaultExportHocName, isBlockedDefaultExportHoc, isDefaultExportHocFunctionNode, } from '../../ts-js-hoc-utils.js';
|
|
36
37
|
/** tree-sitter-typescript node types for function-like scopes that may
|
|
37
38
|
* carry a synthesized `this` binding. Kept in sync with the
|
|
38
39
|
* `@scope.function` patterns in `query.ts`. */
|
|
@@ -139,10 +140,11 @@ function findSelfOrAncestorOfTypes(node, types) {
|
|
|
139
140
|
return null;
|
|
140
141
|
}
|
|
141
142
|
export function emitTsScopeCaptures(sourceText, filePath, cachedTree) {
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
143
|
+
// Reuse a pre-parsed Tree when the caller passes one via `cachedTree`; a
|
|
144
|
+
// miss re-parses. (The cache is currently always empty — its only producer,
|
|
145
|
+
// the sequential parser, was removed — so this re-parses in practice.) The
|
|
146
|
+
// cachedTree parameter is typed `unknown` at the LanguageProvider contract
|
|
147
|
+
// layer; cast here at the use site.
|
|
146
148
|
//
|
|
147
149
|
// Grammar selection: `.tsx` files are parsed with the TSX grammar,
|
|
148
150
|
// `.ts` files with the TypeScript grammar. The two grammars have
|
|
@@ -242,6 +244,15 @@ export function emitTsScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
242
244
|
if (arrowNode !== null && isArrayMethodCallbackArrow(arrowNode)) {
|
|
243
245
|
continue;
|
|
244
246
|
}
|
|
247
|
+
if (arrowNode !== null && isBlockedDefaultExportHoc(arrowNode)) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
if (fnDeclAnchor !== undefined) {
|
|
252
|
+
const fnNode = findFunctionNode(tree.rootNode, fnDeclAnchor.range, groupedNodes['@declaration.function']);
|
|
253
|
+
if (fnNode !== null && isDefaultExportHocFunctionNode(fnNode)) {
|
|
254
|
+
grouped['@declaration.name'] = syntheticCapture('@declaration.name', fnNode, deriveDefaultExportHocName(filePath));
|
|
255
|
+
}
|
|
245
256
|
}
|
|
246
257
|
// Synthesize arity metadata on function-like declaration anchors
|
|
247
258
|
// before pushing the match. The registry uses these to narrow
|
|
@@ -271,21 +282,26 @@ export function emitTsScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
271
282
|
// calls use `new_expression`; regular calls use `call_expression`.
|
|
272
283
|
//
|
|
273
284
|
// JSX call anchors (`jsx_self_closing_element` / `jsx_opening_element`
|
|
274
|
-
// captured by the TSX-only suffix in `query.ts`) intentionally do
|
|
275
|
-
//
|
|
276
|
-
//
|
|
277
|
-
//
|
|
278
|
-
//
|
|
279
|
-
//
|
|
280
|
-
//
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
//
|
|
285
|
+
// captured by the TSX-only suffix in `query.ts`) intentionally do NOT carry
|
|
286
|
+
// arity metadata. A JSX component used as a call argument (e.g.
|
|
287
|
+
// `render(<Foo .../>)`) is itself a @reference.call.* anchor; without a guard
|
|
288
|
+
// the ascent below would climb from it into the enclosing call_expression and
|
|
289
|
+
// mis-attribute that call's arity to the component. The early guard skips
|
|
290
|
+
// arity synthesis for JSX anchors — restoring the pre-#1951 range-based
|
|
291
|
+
// behavior (the old findNodeAtRange found no call_expression at the JSX
|
|
292
|
+
// element's range). The guard lives here, not inside findSelfOrAncestorOfTypes
|
|
293
|
+
// (shared with the import-statement and function-scope ascents). This is
|
|
294
|
+
// acceptable for React: components are virtually never overloaded in the
|
|
295
|
+
// current GitNexus graph model, so name-only dispatch matches the single
|
|
296
|
+
// component definition. A future props-arity-aware synthesizer would count
|
|
297
|
+
// `jsx_attribute` children of the opening tag instead of `arguments`.
|
|
286
298
|
const callAnchor = pickFirstCapture(grouped, CALL_TAGS);
|
|
287
299
|
const callAnchorNode = pickFirstNode(groupedNodes, CALL_TAGS);
|
|
288
|
-
|
|
300
|
+
const anchorIsJsxElement = callAnchorNode?.type === 'jsx_self_closing_element' ||
|
|
301
|
+
callAnchorNode?.type === 'jsx_opening_element';
|
|
302
|
+
if (callAnchor !== undefined &&
|
|
303
|
+
grouped['@reference.arity'] === undefined &&
|
|
304
|
+
!anchorIsJsxElement) {
|
|
289
305
|
const callNode = findSelfOrAncestorOfTypes(callAnchorNode, ['call_expression', 'new_expression']) ??
|
|
290
306
|
findNodeAtRange(tree.rootNode, callAnchor.range, 'call_expression') ??
|
|
291
307
|
findNodeAtRange(tree.rootNode, callAnchor.range, 'new_expression');
|
|
@@ -327,8 +343,122 @@ export function emitTsScopeCaptures(sourceText, filePath, cachedTree) {
|
|
|
327
343
|
synthesizeDestructuringBindings(tree.rootNode, out);
|
|
328
344
|
synthesizeForOfMapTupleBindings(tree.rootNode, out);
|
|
329
345
|
synthesizeInstanceofNarrowings(tree.rootNode, out);
|
|
346
|
+
synthesizeTsInheritanceReferences(tree.rootNode, out);
|
|
330
347
|
return out;
|
|
331
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Synthesize `@reference.inherits` captures from TypeScript class heritage so
|
|
351
|
+
* the registry-primary scope-resolution path emits EXTENDS / IMPLEMENTS edges
|
|
352
|
+
* (mirrors C# `synthesizeCsharpInheritanceReferences` / JS
|
|
353
|
+
* `synthesizeJsInheritanceReferences`). Without this, TS inheritance edges came
|
|
354
|
+
* only from the legacy heritage-capture leg (removed in #942), which the worker
|
|
355
|
+
* pipeline drops for registry-primary languages — yielding 0 inheritance edges
|
|
356
|
+
* in worker mode (issue #1951).
|
|
357
|
+
*
|
|
358
|
+
* Scope is intentionally limited to a `class_declaration`'s `class_heritage`
|
|
359
|
+
* `extends_clause` value + `implements_clause` types, matching the legacy
|
|
360
|
+
* TypeScript heritage query's class scope (TYPESCRIPT_QUERIES). Generic
|
|
361
|
+
* bases agree across both paths: `extends Base<T>` is captured by the legacy
|
|
362
|
+
* `extends_clause value: (identifier)` already (the `type_arguments` are a
|
|
363
|
+
* sibling field), and `implements IFoo<T>` is captured by a legacy clause
|
|
364
|
+
* widened to read the `generic_type`'s `name:` identifier — so the registry
|
|
365
|
+
* path keeps parity on SIMPLE (unqualified) generic bases too (#1951).
|
|
366
|
+
* Qualified bases (`ns.Base`, `ns.Base<T>`, `ns.IFoo<T>`) are ALSO now at parity
|
|
367
|
+
* (#1956 tri-review U2): the synth resolves them by their member_expression /
|
|
368
|
+
* nested_type_identifier tail, and the legacy heritage query was widened with
|
|
369
|
+
* matching arms (member_expression for extends, nested_type_identifier plain +
|
|
370
|
+
* generic-wrapped for implements).
|
|
371
|
+
*
|
|
372
|
+
* `interface_declaration` / `abstract_class_declaration` heritage is NOT emitted
|
|
373
|
+
* by the synth. The EXTENDS-vs-IMPLEMENTS split is decided downstream from the
|
|
374
|
+
* resolved target's symbol kind in `preEmitInheritanceEdges` (class-extends →
|
|
375
|
+
* EXTENDS, implements-interface / interface-target → IMPLEMENTS), so all bases
|
|
376
|
+
* are emitted with the same `inherits` kind here. The base lookup name is
|
|
377
|
+
* normalized to its bare simple identifier (`BaseModel<string>` → `BaseModel`,
|
|
378
|
+
* `models.Base` → `Base`) so `findClassBindingInScope` resolves it.
|
|
379
|
+
*/
|
|
380
|
+
function synthesizeTsInheritanceReferences(root, out) {
|
|
381
|
+
const stack = [root];
|
|
382
|
+
for (;;) {
|
|
383
|
+
const node = stack.pop();
|
|
384
|
+
if (node === undefined)
|
|
385
|
+
break;
|
|
386
|
+
for (const child of node.namedChildren) {
|
|
387
|
+
if (child !== null)
|
|
388
|
+
stack.push(child);
|
|
389
|
+
}
|
|
390
|
+
if (node.type !== 'class_declaration')
|
|
391
|
+
continue;
|
|
392
|
+
// Find the `class_heritage` child (holds extends / implements clauses).
|
|
393
|
+
let heritage = null;
|
|
394
|
+
for (const child of node.namedChildren) {
|
|
395
|
+
if (child !== null && child.type === 'class_heritage') {
|
|
396
|
+
heritage = child;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (heritage === null)
|
|
401
|
+
continue;
|
|
402
|
+
for (const clause of heritage.namedChildren) {
|
|
403
|
+
if (clause === null)
|
|
404
|
+
continue;
|
|
405
|
+
if (clause.type === 'extends_clause') {
|
|
406
|
+
// `extends Foo` / `extends Foo<T>` — the base is the `value:` field
|
|
407
|
+
// (an identifier; generics live in a sibling `type_arguments`).
|
|
408
|
+
const value = clause.childForFieldName('value') ?? clause.firstNamedChild;
|
|
409
|
+
emitTsInheritanceBase(value, out);
|
|
410
|
+
}
|
|
411
|
+
else if (clause.type === 'implements_clause') {
|
|
412
|
+
// `implements IFoo, IBar<T>` — each base type is a direct named child.
|
|
413
|
+
for (const base of clause.namedChildren) {
|
|
414
|
+
emitTsInheritanceBase(base, out);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
/** Emit one `@reference.inherits` match for a TS heritage base, normalizing
|
|
421
|
+
* the lookup name to its bare simple identifier. No-ops on null / non-type
|
|
422
|
+
* nodes or when the bare name can't be derived. */
|
|
423
|
+
function emitTsInheritanceBase(base, out) {
|
|
424
|
+
if (base === null)
|
|
425
|
+
return;
|
|
426
|
+
const nameNode = terminalTsTypeNameNode(base);
|
|
427
|
+
if (nameNode === null)
|
|
428
|
+
return;
|
|
429
|
+
out.push({
|
|
430
|
+
'@reference.inherits': nodeToCapture('@reference.inherits', base),
|
|
431
|
+
'@reference.name': nodeToCapture('@reference.name', nameNode),
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
/** Resolve a TypeScript heritage base node to its bare simple-identifier node.
|
|
435
|
+
* `Foo` → `Foo`, `Foo<T>` (generic_type) → `Foo`, `models.Base`
|
|
436
|
+
* (nested_type_identifier / member_expression) → `Base`. Mirrors C#'s
|
|
437
|
+
* `terminalTypeNameNode`; returns null when no leaf identifier is reachable. */
|
|
438
|
+
function terminalTsTypeNameNode(node) {
|
|
439
|
+
switch (node.type) {
|
|
440
|
+
case 'identifier':
|
|
441
|
+
case 'type_identifier':
|
|
442
|
+
// `extends ns.Base` parses as a member_expression whose tail is a
|
|
443
|
+
// `property_identifier` (not a type_identifier) — treat it as a leaf name.
|
|
444
|
+
case 'property_identifier':
|
|
445
|
+
return node;
|
|
446
|
+
case 'generic_type': {
|
|
447
|
+
// generic_type has a `name:` field (type_identifier / nested_type_identifier);
|
|
448
|
+
// recurse to strip the type_arguments and reach the bare base identifier.
|
|
449
|
+
const name = node.childForFieldName('name') ?? node.firstNamedChild;
|
|
450
|
+
return name === null ? null : terminalTsTypeNameNode(name);
|
|
451
|
+
}
|
|
452
|
+
case 'nested_type_identifier':
|
|
453
|
+
case 'member_expression': {
|
|
454
|
+
// Qualified `A.B.Base` → tail identifier `Base`.
|
|
455
|
+
const tail = node.lastNamedChild;
|
|
456
|
+
return tail === null ? null : terminalTsTypeNameNode(tail);
|
|
457
|
+
}
|
|
458
|
+
default:
|
|
459
|
+
return null;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
332
462
|
/**
|
|
333
463
|
* Walk the AST and synthesize type-binding captures for object
|
|
334
464
|
* destructuring of the form `const { field } = rhs` or
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
* identifiers are narrowed (`user instanceof User`). Member paths
|
|
81
81
|
* such as `user.address instanceof Address` remain unresolved.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* either the legacy or registry-primary run.
|
|
83
|
+
* The `test/integration/resolvers/typescript.test.ts` resolver suite is
|
|
84
|
+
* the authoritative signal for which of these matter in practice; it runs
|
|
85
|
+
* in the standard CI test workflow, so a regression blocks the merge.
|
|
87
86
|
*/
|
|
88
87
|
export { emitTsScopeCaptures } from './captures.js';
|
|
89
88
|
export { getTypescriptCaptureCacheStats, resetTypescriptCaptureCacheStats } from './cache-stats.js';
|
|
@@ -80,10 +80,9 @@
|
|
|
80
80
|
* identifiers are narrowed (`user instanceof User`). Member paths
|
|
81
81
|
* such as `user.address instanceof Address` remain unresolved.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* either the legacy or registry-primary run.
|
|
83
|
+
* The `test/integration/resolvers/typescript.test.ts` resolver suite is
|
|
84
|
+
* the authoritative signal for which of these matter in practice; it runs
|
|
85
|
+
* in the standard CI test workflow, so a regression blocks the merge.
|
|
87
86
|
*/
|
|
88
87
|
export { emitTsScopeCaptures } from './captures.js';
|
|
89
88
|
export { getTypescriptCaptureCacheStats, resetTypescriptCaptureCacheStats } from './cache-stats.js';
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
* same identifier also binds as a parameter in the constructor scope
|
|
34
34
|
* via the normal `required_parameter` → `@type-binding.parameter` path.
|
|
35
35
|
* - **Enum** — dual type+value. Emits `@scope.class` (enum body contains
|
|
36
|
-
* member declarations) + `@declaration.enum`.
|
|
37
|
-
*
|
|
38
|
-
* inside enum_body.
|
|
36
|
+
* member declarations) + `@declaration.enum`. Enum member names
|
|
37
|
+
* are captured via `enum_assignment` (see below).
|
|
39
38
|
*
|
|
40
39
|
* Node types pinned via `scripts/_probe_typescript_grammar.ts`:
|
|
41
40
|
* internal_module, namespace_export, namespace_import, import_specifier,
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
* same identifier also binds as a parameter in the constructor scope
|
|
34
34
|
* via the normal `required_parameter` → `@type-binding.parameter` path.
|
|
35
35
|
* - **Enum** — dual type+value. Emits `@scope.class` (enum body contains
|
|
36
|
-
* member declarations) + `@declaration.enum`.
|
|
37
|
-
*
|
|
38
|
-
* inside enum_body.
|
|
36
|
+
* member declarations) + `@declaration.enum`. Enum member names
|
|
37
|
+
* are captured via `enum_assignment` (see below).
|
|
39
38
|
*
|
|
40
39
|
* Node types pinned via `scripts/_probe_typescript_grammar.ts`:
|
|
41
40
|
* internal_module, namespace_export, namespace_import, import_specifier,
|
|
@@ -52,6 +51,7 @@
|
|
|
52
51
|
*/
|
|
53
52
|
import Parser from 'tree-sitter';
|
|
54
53
|
import TS from 'tree-sitter-typescript';
|
|
54
|
+
import { ARRAY_METHOD_NOT_ANY_OF_PREDICATE, DEFAULT_EXPORT_IDENTIFIER_NOT_ANY_OF_PREDICATE, } from '../../ts-js-hoc-utils.js';
|
|
55
55
|
// tree-sitter-typescript exports both `typescript` and `tsx` grammars on
|
|
56
56
|
// the default export. The package's `.d.ts` types the default export
|
|
57
57
|
// loosely; we narrow at the use site. The two grammars are NOT
|
|
@@ -81,6 +81,11 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
81
81
|
(abstract_class_declaration) @scope.class
|
|
82
82
|
(interface_declaration) @scope.class
|
|
83
83
|
(enum_declaration) @scope.class
|
|
84
|
+
;; Class expressions: const Foo = class { ... } / const Foo = class Named { ... }.
|
|
85
|
+
;; tree-sitter-typescript uses (class) (NOT class_expression) -- same node
|
|
86
|
+
;; name as tree-sitter-javascript. The name field is optional (anonymous
|
|
87
|
+
;; class expressions omit it); ScopeExtractor tolerates missing names.
|
|
88
|
+
(class) @scope.class
|
|
84
89
|
|
|
85
90
|
(function_declaration) @scope.function
|
|
86
91
|
(generator_function_declaration) @scope.function
|
|
@@ -273,10 +278,16 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
273
278
|
;; via \`(filePath, type, qualifiedName)\` — second wins. Acceptable;
|
|
274
279
|
;; multi-arrow-callback APIs are rare (\`new Promise(executor)\` is the
|
|
275
280
|
;; main one and takes a single executor).
|
|
281
|
+
;;
|
|
282
|
+
;; NOTE: Split into identifier vs member_expression patterns. Member
|
|
283
|
+
;; expressions are filtered with a blocklist of common array methods
|
|
284
|
+
;; (map, filter, reduce, etc.) to avoid false positives like
|
|
285
|
+
;; \`const x = arr.map(a => ...)\` being classified as Function.
|
|
276
286
|
(lexical_declaration
|
|
277
287
|
(variable_declarator
|
|
278
288
|
name: (identifier) @declaration.name
|
|
279
289
|
value: (call_expression
|
|
290
|
+
function: (identifier)
|
|
280
291
|
arguments: (arguments
|
|
281
292
|
(arrow_function) @declaration.function))))
|
|
282
293
|
|
|
@@ -284,13 +295,35 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
284
295
|
(variable_declarator
|
|
285
296
|
name: (identifier) @declaration.name
|
|
286
297
|
value: (call_expression
|
|
298
|
+
function: (identifier)
|
|
287
299
|
arguments: (arguments
|
|
288
300
|
(function_expression) @declaration.function))))
|
|
289
301
|
|
|
302
|
+
(lexical_declaration
|
|
303
|
+
(variable_declarator
|
|
304
|
+
name: (identifier) @declaration.name
|
|
305
|
+
value: (call_expression
|
|
306
|
+
function: (member_expression
|
|
307
|
+
property: (property_identifier) @callee)
|
|
308
|
+
arguments: (arguments
|
|
309
|
+
(arrow_function) @declaration.function)))
|
|
310
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
311
|
+
|
|
312
|
+
(lexical_declaration
|
|
313
|
+
(variable_declarator
|
|
314
|
+
name: (identifier) @declaration.name
|
|
315
|
+
value: (call_expression
|
|
316
|
+
function: (member_expression
|
|
317
|
+
property: (property_identifier) @callee)
|
|
318
|
+
arguments: (arguments
|
|
319
|
+
(function_expression) @declaration.function)))
|
|
320
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
321
|
+
|
|
290
322
|
(variable_declaration
|
|
291
323
|
(variable_declarator
|
|
292
324
|
name: (identifier) @declaration.name
|
|
293
325
|
value: (call_expression
|
|
326
|
+
function: (identifier)
|
|
294
327
|
arguments: (arguments
|
|
295
328
|
(arrow_function) @declaration.function))))
|
|
296
329
|
|
|
@@ -298,10 +331,68 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
298
331
|
(variable_declarator
|
|
299
332
|
name: (identifier) @declaration.name
|
|
300
333
|
value: (call_expression
|
|
334
|
+
function: (identifier)
|
|
301
335
|
arguments: (arguments
|
|
302
336
|
(function_expression) @declaration.function))))
|
|
303
337
|
|
|
338
|
+
(variable_declaration
|
|
339
|
+
(variable_declarator
|
|
340
|
+
name: (identifier) @declaration.name
|
|
341
|
+
value: (call_expression
|
|
342
|
+
function: (member_expression
|
|
343
|
+
property: (property_identifier) @callee)
|
|
344
|
+
arguments: (arguments
|
|
345
|
+
(arrow_function) @declaration.function)))
|
|
346
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
347
|
+
|
|
348
|
+
(variable_declaration
|
|
349
|
+
(variable_declarator
|
|
350
|
+
name: (identifier) @declaration.name
|
|
351
|
+
value: (call_expression
|
|
352
|
+
function: (member_expression
|
|
353
|
+
property: (property_identifier) @callee)
|
|
354
|
+
arguments: (arguments
|
|
355
|
+
(function_expression) @declaration.function)))
|
|
356
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
357
|
+
|
|
358
|
+
;; HOC-wrapped default exports: \`export default defineEventHandler(async (e) => { ... })\`.
|
|
359
|
+
;; The emit phase rewrites @declaration.name to a file-derived name so
|
|
360
|
+
;; wrappers like \`defineEventHandler\` / \`React.memo\` do not collapse
|
|
361
|
+
;; unrelated modules onto the same symbol name.
|
|
362
|
+
((export_statement
|
|
363
|
+
value: (call_expression
|
|
364
|
+
function: (identifier) @hoc
|
|
365
|
+
arguments: (arguments
|
|
366
|
+
(arrow_function) @declaration.function)))
|
|
367
|
+
${DEFAULT_EXPORT_IDENTIFIER_NOT_ANY_OF_PREDICATE})
|
|
368
|
+
|
|
369
|
+
((export_statement
|
|
370
|
+
value: (call_expression
|
|
371
|
+
function: (identifier) @hoc
|
|
372
|
+
arguments: (arguments
|
|
373
|
+
(function_expression) @declaration.function)))
|
|
374
|
+
${DEFAULT_EXPORT_IDENTIFIER_NOT_ANY_OF_PREDICATE})
|
|
375
|
+
|
|
376
|
+
((export_statement
|
|
377
|
+
value: (call_expression
|
|
378
|
+
function: (member_expression
|
|
379
|
+
property: (property_identifier) @callee)
|
|
380
|
+
arguments: (arguments
|
|
381
|
+
(arrow_function) @declaration.function)))
|
|
382
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
383
|
+
|
|
384
|
+
((export_statement
|
|
385
|
+
value: (call_expression
|
|
386
|
+
function: (member_expression
|
|
387
|
+
property: (property_identifier) @callee)
|
|
388
|
+
arguments: (arguments
|
|
389
|
+
(function_expression) @declaration.function)))
|
|
390
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE})
|
|
391
|
+
|
|
304
392
|
;; Method definitions — regular + private (#field) methods.
|
|
393
|
+
;; These match inside both class_declaration and class (class expression)
|
|
394
|
+
;; bodies. The @scope.class for class expressions (see (class) above)
|
|
395
|
+
;; ensures methods inside class expressions get the correct Class scope parent.
|
|
305
396
|
(method_definition
|
|
306
397
|
name: (property_identifier) @declaration.name) @declaration.method
|
|
307
398
|
|
|
@@ -323,6 +414,15 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
323
414
|
(public_field_definition
|
|
324
415
|
name: (private_property_identifier) @declaration.name) @declaration.property
|
|
325
416
|
|
|
417
|
+
;; Enum members: enum Color { Red, Green = 1, Blue }.
|
|
418
|
+
;; Bare members (no value): Red, Blue — property_identifier inside enum_body.
|
|
419
|
+
;; Members with value: Green = 1 — enum_assignment with name field.
|
|
420
|
+
(enum_body
|
|
421
|
+
(property_identifier) @declaration.name) @declaration.property
|
|
422
|
+
|
|
423
|
+
(enum_assignment
|
|
424
|
+
name: (_) @declaration.name) @declaration.property
|
|
425
|
+
|
|
326
426
|
;; Declarations — parameter properties: \`constructor(public name: string)\`.
|
|
327
427
|
;; The accessibility_modifier presence distinguishes these from regular
|
|
328
428
|
;; parameters. The identifier is also bound as a parameter in the
|
|
@@ -444,6 +544,26 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
444
544
|
type: (type_annotation
|
|
445
545
|
(generic_type) @type-binding.type)) @type-binding.parameter
|
|
446
546
|
|
|
547
|
+
(optional_parameter
|
|
548
|
+
pattern: (identifier) @type-binding.name
|
|
549
|
+
type: (type_annotation
|
|
550
|
+
(predefined_type) @type-binding.type)) @type-binding.parameter
|
|
551
|
+
|
|
552
|
+
(optional_parameter
|
|
553
|
+
pattern: (identifier) @type-binding.name
|
|
554
|
+
type: (type_annotation
|
|
555
|
+
(union_type) @type-binding.type)) @type-binding.parameter
|
|
556
|
+
|
|
557
|
+
(optional_parameter
|
|
558
|
+
pattern: (identifier) @type-binding.name
|
|
559
|
+
type: (type_annotation
|
|
560
|
+
(array_type) @type-binding.type)) @type-binding.parameter
|
|
561
|
+
|
|
562
|
+
(optional_parameter
|
|
563
|
+
pattern: (identifier) @type-binding.name
|
|
564
|
+
type: (type_annotation
|
|
565
|
+
(readonly_type) @type-binding.type)) @type-binding.parameter
|
|
566
|
+
|
|
447
567
|
;; Type bindings — variable annotations: \`let u: User = ...\` / \`const u: User\`.
|
|
448
568
|
(variable_declarator
|
|
449
569
|
name: (identifier) @type-binding.name
|
|
@@ -843,7 +963,8 @@ const TYPESCRIPT_SCOPE_QUERY = `
|
|
|
843
963
|
constructor: (identifier) @reference.name) @reference.call.constructor
|
|
844
964
|
|
|
845
965
|
(new_expression
|
|
846
|
-
constructor: (member_expression
|
|
966
|
+
constructor: (member_expression
|
|
967
|
+
property: (property_identifier) @reference.name) @reference.call.constructor.qualified) @reference.call.constructor
|
|
847
968
|
|
|
848
969
|
;; References — write access: \`obj.field = value\`.
|
|
849
970
|
(assignment_expression
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TypeScript and JavaScript language providers.
|
|
3
3
|
*
|
|
4
|
-
* Both languages share the same type extraction config (typescriptConfig)
|
|
5
|
-
* export checker (tsExportChecker)
|
|
6
|
-
* (extractTsNamedBindings). They differ in file extensions, tree-sitter
|
|
4
|
+
* Both languages share the same type extraction config (typescriptConfig)
|
|
5
|
+
* and export checker (tsExportChecker). They differ in file extensions, tree-sitter
|
|
7
6
|
* queries (TypeScript grammar has interface/type nodes), and language ID.
|
|
8
7
|
*/
|
|
9
8
|
export declare const BUILT_INS: ReadonlySet<string>;
|