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
|
@@ -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
|
import { SupportedLanguages } from '../../../_shared/index.js';
|
|
@@ -14,7 +13,6 @@ import { typeConfig as typescriptConfig } from '../type-extractors/typescript.js
|
|
|
14
13
|
import { tsExportChecker } from '../export-detection.js';
|
|
15
14
|
import { createImportResolver } from '../import-resolvers/resolver-factory.js';
|
|
16
15
|
import { typescriptImportConfig, javascriptImportConfig, } from '../import-resolvers/configs/typescript-javascript.js';
|
|
17
|
-
import { extractTsNamedBindings } from '../named-bindings/typescript.js';
|
|
18
16
|
import { TYPESCRIPT_QUERIES, JAVASCRIPT_QUERIES } from '../tree-sitter-queries.js';
|
|
19
17
|
import { typescriptFieldExtractor } from '../field-extractors/typescript.js';
|
|
20
18
|
import { createFieldExtractor } from '../field-extractors/generic.js';
|
|
@@ -25,7 +23,7 @@ import { createVariableExtractor } from '../variable-extractors/generic.js';
|
|
|
25
23
|
import { typescriptVariableConfig, javascriptVariableConfig, } from '../variable-extractors/configs/typescript-javascript.js';
|
|
26
24
|
import { createCallExtractor } from '../call-extractors/generic.js';
|
|
27
25
|
import { typescriptCallConfig, javascriptCallConfig, } from '../call-extractors/configs/typescript-javascript.js';
|
|
28
|
-
import {
|
|
26
|
+
import { ARRAY_METHOD_HOC_BLOCKLIST_SET, DEFAULT_EXPORT_IDENTIFIER_BLOCKLIST_SET, deriveDefaultExportHocName, } from '../ts-js-hoc-utils.js';
|
|
29
27
|
import { emitTsScopeCaptures, interpretTsImport, interpretTsTypeBinding, tsBindingScopeFor, tsImportOwningScope, tsReceiverBinding, typescriptMergeBindings, typescriptArityCompatibility, resolveTsImportTarget, } from './typescript/index.js';
|
|
30
28
|
import { emitJsScopeCaptures, interpretJsImport, interpretJsTypeBinding, jsBindingScopeFor, jsImportOwningScope, jsReceiverBinding, jsMergeBindings, jsArityCompatibility, } from './javascript/index.js';
|
|
31
29
|
/**
|
|
@@ -54,7 +52,7 @@ import { emitJsScopeCaptures, interpretJsImport, interpretJsTypeBinding, jsBindi
|
|
|
54
52
|
* findEnclosingFunctionId then continues up to the next named ancestor
|
|
55
53
|
* (or to the file).
|
|
56
54
|
*/
|
|
57
|
-
const tsExtractFunctionName = (node) => {
|
|
55
|
+
const tsExtractFunctionName = (node, filePath) => {
|
|
58
56
|
if (node.type !== 'arrow_function' && node.type !== 'function_expression')
|
|
59
57
|
return null;
|
|
60
58
|
const parent = node.parent;
|
|
@@ -99,27 +97,56 @@ const tsExtractFunctionName = (node) => {
|
|
|
99
97
|
// `arguments`, grandparent is `call_expression`, great-grandparent is
|
|
100
98
|
// `variable_declarator`. Walk the chain up and take the variable's name
|
|
101
99
|
// — the meaningful identifier the developer wrote on the LHS. Mirrors
|
|
102
|
-
// the four registry-primary patterns in `typescript/query.ts`.
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
// calls (`const x = arr.find((y) => p(y))`) match too and produce a
|
|
108
|
-
// mostly-harmless `Function:x` (consumed as a value, never invoked),
|
|
109
|
-
// accepted as a small false-positive cost vs. the much larger gain of
|
|
110
|
-
// capturing the React UI-component idiom.
|
|
100
|
+
// the four registry-primary patterns in `typescript/query.ts`.
|
|
101
|
+
//
|
|
102
|
+
// NOTE: Excludes common array methods (map, filter, reduce, etc.) to avoid
|
|
103
|
+
// false positives like `const x = arr.map(a => ...)` being classified as
|
|
104
|
+
// Function when it's actually a Const holding an array.
|
|
111
105
|
if (parent.type === 'arguments') {
|
|
112
106
|
const callExpr = parent.parent;
|
|
113
107
|
if (!callExpr || callExpr.type !== 'call_expression') {
|
|
114
108
|
return { funcName: null, label: 'Function' };
|
|
115
109
|
}
|
|
110
|
+
// Check if callee is a member_expression calling an array method
|
|
111
|
+
const callee = callExpr.childForFieldName?.('function');
|
|
112
|
+
if (callee?.type === 'member_expression') {
|
|
113
|
+
const property = callee.childForFieldName?.('property');
|
|
114
|
+
if (property?.type === 'property_identifier' &&
|
|
115
|
+
ARRAY_METHOD_HOC_BLOCKLIST_SET.has(property.text)) {
|
|
116
|
+
return { funcName: null, label: 'Function' };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
116
119
|
const declarator = callExpr.parent;
|
|
117
|
-
|
|
120
|
+
// Existing path: const X = HOC(arrow)
|
|
121
|
+
if (declarator?.type === 'variable_declarator') {
|
|
122
|
+
const nameNode = declarator.childForFieldName?.('name');
|
|
123
|
+
if (nameNode?.type === 'identifier') {
|
|
124
|
+
return { funcName: nameNode.text, label: 'Function' };
|
|
125
|
+
}
|
|
118
126
|
return { funcName: null, label: 'Function' };
|
|
119
127
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
128
|
+
// export default HOC(arrow) — name it from the file, not the wrapper.
|
|
129
|
+
// This keeps route handlers and wrapped defaults navigable without
|
|
130
|
+
// collapsing every file onto names like `memo` or `defineEventHandler`.
|
|
131
|
+
if (declarator?.type === 'export_statement') {
|
|
132
|
+
if (callee?.type === 'identifier') {
|
|
133
|
+
if (DEFAULT_EXPORT_IDENTIFIER_BLOCKLIST_SET.has(callee.text)) {
|
|
134
|
+
return { funcName: null, label: 'Function' };
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
funcName: filePath ? deriveDefaultExportHocName(filePath) : null,
|
|
138
|
+
label: 'Function',
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Member-expression callees like React.memo keep the same file-derived
|
|
142
|
+
// name, with array-like helpers excluded above.
|
|
143
|
+
if (callee?.type === 'member_expression') {
|
|
144
|
+
return {
|
|
145
|
+
funcName: filePath ? deriveDefaultExportHocName(filePath) : null,
|
|
146
|
+
label: 'Function',
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return { funcName: null, label: 'Function' };
|
|
123
150
|
}
|
|
124
151
|
return { funcName: null, label: 'Function' };
|
|
125
152
|
}
|
|
@@ -251,7 +278,6 @@ export const typescriptProvider = defineLanguage({
|
|
|
251
278
|
typeConfig: typescriptConfig,
|
|
252
279
|
exportChecker: tsExportChecker,
|
|
253
280
|
importResolver: createImportResolver(typescriptImportConfig),
|
|
254
|
-
namedBindingExtractor: extractTsNamedBindings,
|
|
255
281
|
callExtractor: createCallExtractor(typescriptCallConfig),
|
|
256
282
|
fieldExtractor: typescriptFieldExtractor,
|
|
257
283
|
methodExtractor: createMethodExtractor({
|
|
@@ -260,7 +286,6 @@ export const typescriptProvider = defineLanguage({
|
|
|
260
286
|
}),
|
|
261
287
|
variableExtractor: createVariableExtractor(typescriptVariableConfig),
|
|
262
288
|
classExtractor: createClassExtractor(typescriptClassConfig),
|
|
263
|
-
heritageExtractor: createHeritageExtractor(SupportedLanguages.TypeScript),
|
|
264
289
|
builtInNames: BUILT_INS,
|
|
265
290
|
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
266
291
|
// TypeScript is the third migration after Python and C#. See
|
|
@@ -311,7 +336,6 @@ export const javascriptProvider = defineLanguage({
|
|
|
311
336
|
typeConfig: typescriptConfig,
|
|
312
337
|
exportChecker: tsExportChecker,
|
|
313
338
|
importResolver: createImportResolver(javascriptImportConfig),
|
|
314
|
-
namedBindingExtractor: extractTsNamedBindings,
|
|
315
339
|
callExtractor: createCallExtractor(javascriptCallConfig),
|
|
316
340
|
fieldExtractor: createFieldExtractor(javascriptConfig),
|
|
317
341
|
methodExtractor: createMethodExtractor({
|
|
@@ -320,7 +344,6 @@ export const javascriptProvider = defineLanguage({
|
|
|
320
344
|
}),
|
|
321
345
|
variableExtractor: createVariableExtractor(javascriptVariableConfig),
|
|
322
346
|
classExtractor: createClassExtractor(javascriptClassConfig),
|
|
323
|
-
heritageExtractor: createHeritageExtractor(SupportedLanguages.JavaScript),
|
|
324
347
|
builtInNames: BUILT_INS,
|
|
325
348
|
// ── RFC #909 Ring 3: scope-based resolution hooks (RFC §5) ──────────
|
|
326
349
|
// JavaScript is the fourth migration after Python, C#, and TypeScript.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue SFC scope captures (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Extracts the `<script>` / `<script setup>` block from the SFC source
|
|
5
|
+
* and delegates to `emitTsScopeCaptures`. The parse-worker builds the
|
|
6
|
+
* cached tree from the extracted script content using the TypeScript
|
|
7
|
+
* grammar (see `[SupportedLanguages.Vue]: TypeScript.typescript` in
|
|
8
|
+
* `parse-worker.ts`), so passing that tree here keeps grammar identity
|
|
9
|
+
* consistent and avoids a redundant re-parse.
|
|
10
|
+
*
|
|
11
|
+
* Template expressions are intentionally out-of-scope: component-
|
|
12
|
+
* reference CALLS edges are already emitted by the legacy template
|
|
13
|
+
* extractor in the parse worker and would be double-counted here.
|
|
14
|
+
*
|
|
15
|
+
* Position note: all capture positions are relative to the *extracted*
|
|
16
|
+
* script block, not the full .vue file. This is consistent with the
|
|
17
|
+
* cached tree and with how the scope model uses positions (only for
|
|
18
|
+
* scope-containment walks within a single file), so no offset
|
|
19
|
+
* translation is required for graph-edge correctness.
|
|
20
|
+
*/
|
|
21
|
+
import type { CaptureMatch } from '../../../../_shared/index.js';
|
|
22
|
+
/**
|
|
23
|
+
* Emit scope captures for a Vue SFC.
|
|
24
|
+
*
|
|
25
|
+
* Handles three call-site shapes:
|
|
26
|
+
*
|
|
27
|
+
* 1. **Full SFC content** (sequential path, <15 files): `sourceText`
|
|
28
|
+
* contains the whole `.vue` file with `<template>`, `<script>`, etc.
|
|
29
|
+
* `extractVueScript` extracts the script block and we delegate to
|
|
30
|
+
* `emitTsScopeCaptures` or `emitJsScopeCaptures` based on `lang`.
|
|
31
|
+
*
|
|
32
|
+
* 2. **Already-extracted script content** (worker-mode path, ≥15 files):
|
|
33
|
+
* the parse worker calls `extractVueScript` itself before calling
|
|
34
|
+
* `extractParsedFile`, so `sourceText` is already the bare script
|
|
35
|
+
* text with no `<script>` tags. The caller marks this explicitly via
|
|
36
|
+
* `sourceMeta.sourceKind === 'pre-extracted-script'`.
|
|
37
|
+
*
|
|
38
|
+
* 3. **Supporting TS/JS files** included in Vue scope-resolution runs:
|
|
39
|
+
* when `filePath` is not `.vue`, delegate straight to TypeScript captures.
|
|
40
|
+
*
|
|
41
|
+
* Returns an empty array for render-function-only SFCs (no `<script>` block).
|
|
42
|
+
*/
|
|
43
|
+
export declare function emitVueScopeCaptures(sourceText: string, filePath: string, cachedTree?: unknown, sourceMeta?: {
|
|
44
|
+
sourceKind?: 'full-file' | 'pre-extracted-script';
|
|
45
|
+
setupLang?: string;
|
|
46
|
+
}): readonly CaptureMatch[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue SFC scope captures (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Extracts the `<script>` / `<script setup>` block from the SFC source
|
|
5
|
+
* and delegates to `emitTsScopeCaptures`. The parse-worker builds the
|
|
6
|
+
* cached tree from the extracted script content using the TypeScript
|
|
7
|
+
* grammar (see `[SupportedLanguages.Vue]: TypeScript.typescript` in
|
|
8
|
+
* `parse-worker.ts`), so passing that tree here keeps grammar identity
|
|
9
|
+
* consistent and avoids a redundant re-parse.
|
|
10
|
+
*
|
|
11
|
+
* Template expressions are intentionally out-of-scope: component-
|
|
12
|
+
* reference CALLS edges are already emitted by the legacy template
|
|
13
|
+
* extractor in the parse worker and would be double-counted here.
|
|
14
|
+
*
|
|
15
|
+
* Position note: all capture positions are relative to the *extracted*
|
|
16
|
+
* script block, not the full .vue file. This is consistent with the
|
|
17
|
+
* cached tree and with how the scope model uses positions (only for
|
|
18
|
+
* scope-containment walks within a single file), so no offset
|
|
19
|
+
* translation is required for graph-edge correctness.
|
|
20
|
+
*/
|
|
21
|
+
import { extractVueScript } from '../../vue-sfc-extractor.js';
|
|
22
|
+
import { emitTsScopeCaptures } from '../typescript/captures.js';
|
|
23
|
+
import { emitJsScopeCaptures } from '../javascript/captures.js';
|
|
24
|
+
/**
|
|
25
|
+
* Emit scope captures for a Vue SFC.
|
|
26
|
+
*
|
|
27
|
+
* Handles three call-site shapes:
|
|
28
|
+
*
|
|
29
|
+
* 1. **Full SFC content** (sequential path, <15 files): `sourceText`
|
|
30
|
+
* contains the whole `.vue` file with `<template>`, `<script>`, etc.
|
|
31
|
+
* `extractVueScript` extracts the script block and we delegate to
|
|
32
|
+
* `emitTsScopeCaptures` or `emitJsScopeCaptures` based on `lang`.
|
|
33
|
+
*
|
|
34
|
+
* 2. **Already-extracted script content** (worker-mode path, ≥15 files):
|
|
35
|
+
* the parse worker calls `extractVueScript` itself before calling
|
|
36
|
+
* `extractParsedFile`, so `sourceText` is already the bare script
|
|
37
|
+
* text with no `<script>` tags. The caller marks this explicitly via
|
|
38
|
+
* `sourceMeta.sourceKind === 'pre-extracted-script'`.
|
|
39
|
+
*
|
|
40
|
+
* 3. **Supporting TS/JS files** included in Vue scope-resolution runs:
|
|
41
|
+
* when `filePath` is not `.vue`, delegate straight to TypeScript captures.
|
|
42
|
+
*
|
|
43
|
+
* Returns an empty array for render-function-only SFCs (no `<script>` block).
|
|
44
|
+
*/
|
|
45
|
+
export function emitVueScopeCaptures(sourceText, filePath, cachedTree, sourceMeta) {
|
|
46
|
+
// Vue resolver may include supporting TS/JS files in the same run to
|
|
47
|
+
// preserve cross-file import/type context for `.vue` callers. These are
|
|
48
|
+
// already plain script files, so no SFC extraction is needed.
|
|
49
|
+
if (!filePath.endsWith('.vue')) {
|
|
50
|
+
return emitTsScopeCaptures(sourceText, filePath, cachedTree);
|
|
51
|
+
}
|
|
52
|
+
if (sourceMeta?.sourceKind === 'pre-extracted-script') {
|
|
53
|
+
// Worker-mode path: the parse worker always uses TypeScript grammar for
|
|
54
|
+
// .vue files. Lang-based grammar selection is a sequential-path feature.
|
|
55
|
+
return emitTsScopeCaptures(sourceText, filePath, cachedTree);
|
|
56
|
+
}
|
|
57
|
+
const extracted = extractVueScript(sourceText);
|
|
58
|
+
if (extracted === null)
|
|
59
|
+
return [];
|
|
60
|
+
// Select captures based on script lang attribute.
|
|
61
|
+
// Use TS grammar unless ALL blocks explicitly request JS/JSX.
|
|
62
|
+
// Mixed-lang: TS handles JS natively; JS grammar chokes on TS syntax.
|
|
63
|
+
if (extracted.lang === 'js' || extracted.lang === 'jsx') {
|
|
64
|
+
return emitJsScopeCaptures(extracted.scriptContent, filePath, cachedTree);
|
|
65
|
+
}
|
|
66
|
+
return emitTsScopeCaptures(extracted.scriptContent, filePath, cachedTree);
|
|
67
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import-target resolver for Vue SFCs (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Vue `<script>` / `<script setup>` blocks are TypeScript (or plain
|
|
5
|
+
* JavaScript), so the resolver delegates to `resolveTsTarget` with
|
|
6
|
+
* `language: SupportedLanguages.TypeScript` to get:
|
|
7
|
+
*
|
|
8
|
+
* - tsconfig path-alias rewriting (Vue projects universally use TS)
|
|
9
|
+
* - `.ts` / `.tsx` / `.js` / `.jsx` extension-suffix fallback
|
|
10
|
+
*
|
|
11
|
+
* `.vue` imports are written with explicit extensions (`'./Button.vue'`),
|
|
12
|
+
* so no Vue-specific suffix guessing is required: the standard
|
|
13
|
+
* resolver finds them via the exact-path branch before any extension
|
|
14
|
+
* logic fires.
|
|
15
|
+
*
|
|
16
|
+
* Memoization mirrors the TypeScript adapter: workspace file-list
|
|
17
|
+
* arrays, the suffix index, and the per-pass resolve cache are rebuilt
|
|
18
|
+
* lazily when `allFilePaths` reference changes (once per workspace pass).
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Build a memoized `resolveImportTarget` adapter for Vue SFCs.
|
|
22
|
+
*
|
|
23
|
+
* Uses `SupportedLanguages.TypeScript` so tsconfig path-alias resolution
|
|
24
|
+
* and `.ts`/`.tsx` extension guessing fire for relative and bare-specifier
|
|
25
|
+
* imports inside `<script>` blocks.
|
|
26
|
+
*/
|
|
27
|
+
export declare function makeVueResolveImportTarget(): (targetRaw: string, fromFile: string, allFilePaths: ReadonlySet<string>, resolutionConfig?: unknown) => string | readonly string[] | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Import-target resolver for Vue SFCs (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Vue `<script>` / `<script setup>` blocks are TypeScript (or plain
|
|
5
|
+
* JavaScript), so the resolver delegates to `resolveTsTarget` with
|
|
6
|
+
* `language: SupportedLanguages.TypeScript` to get:
|
|
7
|
+
*
|
|
8
|
+
* - tsconfig path-alias rewriting (Vue projects universally use TS)
|
|
9
|
+
* - `.ts` / `.tsx` / `.js` / `.jsx` extension-suffix fallback
|
|
10
|
+
*
|
|
11
|
+
* `.vue` imports are written with explicit extensions (`'./Button.vue'`),
|
|
12
|
+
* so no Vue-specific suffix guessing is required: the standard
|
|
13
|
+
* resolver finds them via the exact-path branch before any extension
|
|
14
|
+
* logic fires.
|
|
15
|
+
*
|
|
16
|
+
* Memoization mirrors the TypeScript adapter: workspace file-list
|
|
17
|
+
* arrays, the suffix index, and the per-pass resolve cache are rebuilt
|
|
18
|
+
* lazily when `allFilePaths` reference changes (once per workspace pass).
|
|
19
|
+
*/
|
|
20
|
+
import { SupportedLanguages } from '../../../../_shared/index.js';
|
|
21
|
+
import { resolveTsTarget } from '../typescript/import-target.js';
|
|
22
|
+
import { buildSuffixIndex } from '../../import-resolvers/utils.js';
|
|
23
|
+
/**
|
|
24
|
+
* Build a memoized `resolveImportTarget` adapter for Vue SFCs.
|
|
25
|
+
*
|
|
26
|
+
* Uses `SupportedLanguages.TypeScript` so tsconfig path-alias resolution
|
|
27
|
+
* and `.ts`/`.tsx` extension guessing fire for relative and bare-specifier
|
|
28
|
+
* imports inside `<script>` blocks.
|
|
29
|
+
*/
|
|
30
|
+
export function makeVueResolveImportTarget() {
|
|
31
|
+
let cached = null;
|
|
32
|
+
return (targetRaw, fromFile, allFilePaths, resolutionConfig) => {
|
|
33
|
+
if (cached === null || cached.key !== allFilePaths) {
|
|
34
|
+
const allFileList = Array.from(allFilePaths);
|
|
35
|
+
const normalizedFileList = allFileList.map((f) => f.toLowerCase());
|
|
36
|
+
cached = {
|
|
37
|
+
key: allFilePaths,
|
|
38
|
+
allFilePaths: new Set(allFilePaths),
|
|
39
|
+
allFileList,
|
|
40
|
+
normalizedFileList,
|
|
41
|
+
index: buildSuffixIndex(normalizedFileList, allFileList),
|
|
42
|
+
resolveCache: new Map(),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const cfg = resolutionConfig;
|
|
46
|
+
const ws = {
|
|
47
|
+
fromFile,
|
|
48
|
+
language: SupportedLanguages.TypeScript,
|
|
49
|
+
allFilePaths: cached.allFilePaths,
|
|
50
|
+
allFileList: cached.allFileList,
|
|
51
|
+
normalizedFileList: cached.normalizedFileList,
|
|
52
|
+
index: cached.index,
|
|
53
|
+
resolveCache: cached.resolveCache,
|
|
54
|
+
tsconfigPaths: cfg?.tsconfigPaths ?? null,
|
|
55
|
+
};
|
|
56
|
+
return resolveTsTarget(targetRaw, ws);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue SFC scope-resolution hooks (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Public API barrel. Consumers should import from this file rather
|
|
5
|
+
* than the individual modules.
|
|
6
|
+
*
|
|
7
|
+
* Module layout (each file is a single concern):
|
|
8
|
+
*
|
|
9
|
+
* - `captures.ts` — `emitVueScopeCaptures` — extracts the
|
|
10
|
+
* `<script>` / `<script setup>` block and
|
|
11
|
+
* delegates to `emitTsScopeCaptures` (TypeScript
|
|
12
|
+
* grammar, same grammar the parse-worker uses).
|
|
13
|
+
* - `import-target.ts` — `makeVueResolveImportTarget` — memoized
|
|
14
|
+
* adapter using the TypeScript resolver with
|
|
15
|
+
* tsconfig path-alias support.
|
|
16
|
+
* - `scope-resolver.ts` — `vueScopeResolver` wiring object.
|
|
17
|
+
*
|
|
18
|
+
* ## Known limitations
|
|
19
|
+
*
|
|
20
|
+
* 1. **Template expressions** — Full template AST parsing is not performed.
|
|
21
|
+
* `vueScopeResolver.emitPostResolutionEdges` extracts five categories of
|
|
22
|
+
* template-derived edges via lightweight regex, all emitted after standard
|
|
23
|
+
* scope-resolution passes complete:
|
|
24
|
+
* - PascalCase/kebab-case component references → `vue-template-component` `CALLS`
|
|
25
|
+
* - `@event="handler"` on **native** elements → `vue-template-callback` `CALLS`
|
|
26
|
+
* - `@event="handler"` on **component** elements → `vue-event: @<name>` `BINDS_EVENT_HANDLER`
|
|
27
|
+
* - `emit(...)` / `this.$emit(...)` in script → `vue-emit: <name>` `EMITS_EVENT`
|
|
28
|
+
* - `:prop="varName"` single-identifier bindings → `vue-template-attribute` `ACCESSES`
|
|
29
|
+
* `BINDS_EVENT_HANDLER` and `EMITS_EVENT` are complementary "hanging" edges:
|
|
30
|
+
* a Cypher query joining on the shared component File node reveals which
|
|
31
|
+
* handlers receive which component's emitted events.
|
|
32
|
+
* Complex inline expressions (`@click="toggle(item)"`, `{{ a + b }}`,
|
|
33
|
+
* member-access bindings `:key="post.id"`) are intentionally excluded
|
|
34
|
+
* because they cannot be resolved to a single call/access target without
|
|
35
|
+
* a full template AST. Tracked in #1647.
|
|
36
|
+
* 2. **Options API `this` resolution** — `this.X()` in Options API
|
|
37
|
+
* components does not resolve through type-binding when the component
|
|
38
|
+
* uses a plain object literal rather than a class. `fieldFallbackOnMethodLookup`
|
|
39
|
+
* recovers common cases via field-name matching.
|
|
40
|
+
* 3. **`<script setup>` + `<script>` dual-block** — When both blocks are
|
|
41
|
+
* present, only `<script setup>` is processed (per `extractVueScript`
|
|
42
|
+
* priority). The non-setup block is skipped.
|
|
43
|
+
* 4. **JSX in `<template>`** — Vue's template compiler is not a
|
|
44
|
+
* tree-sitter grammar; JSX-style bindings inside templates are not
|
|
45
|
+
* processed by the scope-resolution pipeline.
|
|
46
|
+
*/
|
|
47
|
+
export { emitVueScopeCaptures } from './captures.js';
|
|
48
|
+
export { makeVueResolveImportTarget } from './import-target.js';
|
|
49
|
+
export { vueScopeResolver } from './scope-resolver.js';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue SFC scope-resolution hooks (RFC #909 Ring 3, issue #940).
|
|
3
|
+
*
|
|
4
|
+
* Public API barrel. Consumers should import from this file rather
|
|
5
|
+
* than the individual modules.
|
|
6
|
+
*
|
|
7
|
+
* Module layout (each file is a single concern):
|
|
8
|
+
*
|
|
9
|
+
* - `captures.ts` — `emitVueScopeCaptures` — extracts the
|
|
10
|
+
* `<script>` / `<script setup>` block and
|
|
11
|
+
* delegates to `emitTsScopeCaptures` (TypeScript
|
|
12
|
+
* grammar, same grammar the parse-worker uses).
|
|
13
|
+
* - `import-target.ts` — `makeVueResolveImportTarget` — memoized
|
|
14
|
+
* adapter using the TypeScript resolver with
|
|
15
|
+
* tsconfig path-alias support.
|
|
16
|
+
* - `scope-resolver.ts` — `vueScopeResolver` wiring object.
|
|
17
|
+
*
|
|
18
|
+
* ## Known limitations
|
|
19
|
+
*
|
|
20
|
+
* 1. **Template expressions** — Full template AST parsing is not performed.
|
|
21
|
+
* `vueScopeResolver.emitPostResolutionEdges` extracts five categories of
|
|
22
|
+
* template-derived edges via lightweight regex, all emitted after standard
|
|
23
|
+
* scope-resolution passes complete:
|
|
24
|
+
* - PascalCase/kebab-case component references → `vue-template-component` `CALLS`
|
|
25
|
+
* - `@event="handler"` on **native** elements → `vue-template-callback` `CALLS`
|
|
26
|
+
* - `@event="handler"` on **component** elements → `vue-event: @<name>` `BINDS_EVENT_HANDLER`
|
|
27
|
+
* - `emit(...)` / `this.$emit(...)` in script → `vue-emit: <name>` `EMITS_EVENT`
|
|
28
|
+
* - `:prop="varName"` single-identifier bindings → `vue-template-attribute` `ACCESSES`
|
|
29
|
+
* `BINDS_EVENT_HANDLER` and `EMITS_EVENT` are complementary "hanging" edges:
|
|
30
|
+
* a Cypher query joining on the shared component File node reveals which
|
|
31
|
+
* handlers receive which component's emitted events.
|
|
32
|
+
* Complex inline expressions (`@click="toggle(item)"`, `{{ a + b }}`,
|
|
33
|
+
* member-access bindings `:key="post.id"`) are intentionally excluded
|
|
34
|
+
* because they cannot be resolved to a single call/access target without
|
|
35
|
+
* a full template AST. Tracked in #1647.
|
|
36
|
+
* 2. **Options API `this` resolution** — `this.X()` in Options API
|
|
37
|
+
* components does not resolve through type-binding when the component
|
|
38
|
+
* uses a plain object literal rather than a class. `fieldFallbackOnMethodLookup`
|
|
39
|
+
* recovers common cases via field-name matching.
|
|
40
|
+
* 3. **`<script setup>` + `<script>` dual-block** — When both blocks are
|
|
41
|
+
* present, only `<script setup>` is processed (per `extractVueScript`
|
|
42
|
+
* priority). The non-setup block is skipped.
|
|
43
|
+
* 4. **JSX in `<template>`** — Vue's template compiler is not a
|
|
44
|
+
* tree-sitter grammar; JSX-style bindings inside templates are not
|
|
45
|
+
* processed by the scope-resolution pipeline.
|
|
46
|
+
*/
|
|
47
|
+
export { emitVueScopeCaptures } from './captures.js';
|
|
48
|
+
export { makeVueResolveImportTarget } from './import-target.js';
|
|
49
|
+
export { vueScopeResolver } from './scope-resolver.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue `ScopeResolver` registered in `SCOPE_RESOLVERS` and consumed by
|
|
3
|
+
* the generic `runScopeResolution` orchestrator (RFC #909 Ring 3, issue #940).
|
|
4
|
+
*
|
|
5
|
+
* ## Design rationale
|
|
6
|
+
*
|
|
7
|
+
* Vue SFCs compile down to TypeScript/JavaScript — the `<script>` /
|
|
8
|
+
* `<script setup>` block is pure TS/JS, parsed with the TypeScript
|
|
9
|
+
* grammar and captured by `emitVueScopeCaptures` (which delegates
|
|
10
|
+
* to `emitTsScopeCaptures`). Because of this, nearly all hooks are
|
|
11
|
+
* identical to the TypeScript resolver:
|
|
12
|
+
*
|
|
13
|
+
* - `mergeBindings` — TypeScript LEGB semantics apply in script blocks.
|
|
14
|
+
* - `arityCompatibility` — same positional + rest rules.
|
|
15
|
+
* - `buildMro` / `populateOwners` — shared with TypeScript.
|
|
16
|
+
* - `isSuperReceiver` — `super(...)` / `super.foo` / `super[x]` pattern.
|
|
17
|
+
* - `resolveImportTarget` — TypeScript resolver with `.vue` explicit-
|
|
18
|
+
* extension support; tsconfig paths loaded via
|
|
19
|
+
* `loadResolutionConfig`.
|
|
20
|
+
*
|
|
21
|
+
* ## Key differences from TypeScript
|
|
22
|
+
*
|
|
23
|
+
* - `language: SupportedLanguages.Vue` — routes the resolver to Vue
|
|
24
|
+
* files only; TypeScript files use the TypeScript resolver.
|
|
25
|
+
* - `languageProvider: vueProvider` — the Vue-specific language
|
|
26
|
+
* provider supplies the right built-ins and export checker for
|
|
27
|
+
* `<script setup>` (all top-level bindings implicitly exported).
|
|
28
|
+
* - `importEdgeReason: 'vue-scope: import'` — distinct tag for
|
|
29
|
+
* debugging / edge provenance.
|
|
30
|
+
* - `allowGlobalFreeCallFallback: false` — Vue uses explicit imports;
|
|
31
|
+
* workspace-wide unique-name fallback is unnecessary and would
|
|
32
|
+
* produce spurious edges for Vue built-ins (ref, reactive, …).
|
|
33
|
+
*
|
|
34
|
+
* ## Options API / this-binding
|
|
35
|
+
*
|
|
36
|
+
* Options API (`defineComponent({ methods: { … } })`) stores methods
|
|
37
|
+
* on the component instance, which tree-sitter sees as object property
|
|
38
|
+
* values. `this.X()` inside a method resolves via the existing
|
|
39
|
+
* `tsReceiverBinding` hook (inherited from TypeScript), which walks to
|
|
40
|
+
* the enclosing Class scope. For Options API the enclosing "class" is
|
|
41
|
+
* the `defineComponent({…})` object — not a true class — so `this`
|
|
42
|
+
* calls may not resolve through the type-binding layer. `fieldFallbackOnMethodLookup`
|
|
43
|
+
* is therefore set to `true` so the field-name fallback catches common
|
|
44
|
+
* patterns even without an explicit type annotation.
|
|
45
|
+
*
|
|
46
|
+
* ## `<script setup>` macro calls
|
|
47
|
+
*
|
|
48
|
+
* `defineProps`, `defineEmits`, `defineExpose`, `withDefaults`, etc.
|
|
49
|
+
* are compiler macros available as globals inside `<script setup>`.
|
|
50
|
+
* They are listed in `vueProvider.builtInNames` and therefore treated
|
|
51
|
+
* as resolved without requiring an import edge.
|
|
52
|
+
*/
|
|
53
|
+
import type { ScopeResolver } from '../../scope-resolution/contract/scope-resolver.js';
|
|
54
|
+
declare const vueScopeResolver: ScopeResolver;
|
|
55
|
+
export { vueScopeResolver };
|