gitnexus 1.6.6-rc.99 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -68
- package/dist/_shared/graph/types.d.ts +17 -1
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +3 -5
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js +2 -4
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/module-scope-index.js +1 -2
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -1
- package/dist/_shared/scope-resolution/parsed-file.d.ts +24 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts +13 -1
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js +6 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/evidence.js +2 -3
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts +29 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/macro-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +9 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/types.d.ts +1 -1
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -1
- package/dist/cli/ai-context.d.ts +35 -1
- package/dist/cli/ai-context.js +111 -12
- package/dist/cli/analyze-config.d.ts +92 -0
- package/dist/cli/analyze-config.js +364 -0
- package/dist/cli/analyze.d.ts +17 -1
- package/dist/cli/analyze.js +224 -71
- package/dist/cli/cli-message.d.ts +1 -1
- package/dist/cli/doctor.d.ts +18 -0
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/i18n/en.d.ts +2 -2
- package/dist/cli/i18n/en.js +2 -2
- package/dist/cli/i18n/resources.d.ts +2 -2
- package/dist/cli/i18n/zh-CN.js +2 -2
- package/dist/cli/index.js +4 -2
- package/dist/cli/resolve-invocation.d.ts +21 -0
- package/dist/cli/resolve-invocation.js +68 -0
- package/dist/cli/setup.d.ts +33 -0
- package/dist/cli/setup.js +96 -35
- package/dist/cli/skill-gen.js +2 -2
- package/dist/cli/wiki.js +20 -4
- package/dist/core/embeddings/embedder.d.ts +1 -1
- package/dist/core/embeddings/embedder.js +14 -1
- package/dist/core/embeddings/runtime-support.d.ts +41 -0
- package/dist/core/embeddings/runtime-support.js +65 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +2 -1
- package/dist/core/group/extractors/http-patterns/java.js +15 -1
- package/dist/core/ingestion/call-processor.d.ts +57 -227
- package/dist/core/ingestion/call-processor.js +172 -2595
- package/dist/core/ingestion/call-routing.d.ts +6 -5
- package/dist/core/ingestion/call-routing.js +6 -6
- package/dist/core/ingestion/call-types.d.ts +0 -75
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +26 -1
- package/dist/core/ingestion/class-extractors/configs/ruby.js +3 -0
- package/dist/core/ingestion/class-extractors/generic.js +9 -11
- package/dist/core/ingestion/class-types.d.ts +23 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +11 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +227 -73
- package/dist/core/ingestion/cobol-processor.d.ts +1 -0
- package/dist/core/ingestion/cobol-processor.js +51 -2
- package/dist/core/ingestion/emit-references.js +8 -2
- package/dist/core/ingestion/export-detection.d.ts +2 -1
- package/dist/core/ingestion/export-detection.js +2 -6
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +0 -6
- package/dist/core/ingestion/field-extractors/configs/dart.js +62 -44
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +0 -9
- package/dist/core/ingestion/field-extractors/configs/go.js +40 -1
- package/dist/core/ingestion/field-extractors/configs/jvm.js +43 -4
- package/dist/core/ingestion/field-extractors/configs/php.js +1 -2
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +12 -1
- package/dist/core/ingestion/field-extractors/configs/swift.js +31 -6
- package/dist/core/ingestion/field-extractors/generic.d.ts +6 -0
- package/dist/core/ingestion/field-extractors/generic.js +5 -4
- package/dist/core/ingestion/field-extractors/typescript.js +0 -29
- package/dist/core/ingestion/filesystem-walker.d.ts +0 -9
- package/dist/core/ingestion/filesystem-walker.js +0 -11
- package/dist/core/ingestion/finalize-orchestrator.js +14 -2
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +21 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +72 -11
- package/dist/core/ingestion/import-resolvers/python.d.ts +1 -1
- package/dist/core/ingestion/import-resolvers/standard.d.ts +2 -2
- package/dist/core/ingestion/import-resolvers/standard.js +6 -5
- package/dist/core/ingestion/import-resolvers/utils.d.ts +2 -5
- package/dist/core/ingestion/import-resolvers/utils.js +1 -9
- package/dist/core/ingestion/language-provider.d.ts +39 -119
- package/dist/core/ingestion/language-provider.js +0 -2
- package/dist/core/ingestion/languages/c/capture-side-channel.d.ts +62 -0
- package/dist/core/ingestion/languages/c/capture-side-channel.js +65 -0
- package/dist/core/ingestion/languages/c/captures.js +41 -23
- package/dist/core/ingestion/languages/c/import-decomposer.d.ts +9 -0
- package/dist/core/ingestion/languages/c/import-decomposer.js +15 -0
- package/dist/core/ingestion/languages/c/import-target.js +52 -9
- package/dist/core/ingestion/languages/c/index.d.ts +2 -1
- package/dist/core/ingestion/languages/c/index.js +2 -1
- package/dist/core/ingestion/languages/c/query.js +15 -0
- package/dist/core/ingestion/languages/c/scope-resolver.js +47 -4
- package/dist/core/ingestion/languages/c/static-linkage.d.ts +8 -0
- package/dist/core/ingestion/languages/c/static-linkage.js +46 -1
- package/dist/core/ingestion/languages/c-cpp.js +16 -7
- package/dist/core/ingestion/languages/cobol/captures.js +25 -2
- package/dist/core/ingestion/languages/cpp/adl.d.ts +88 -4
- package/dist/core/ingestion/languages/cpp/adl.js +380 -160
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +2 -8
- package/dist/core/ingestion/languages/cpp/capture-side-channel.d.ts +65 -0
- package/dist/core/ingestion/languages/cpp/capture-side-channel.js +78 -0
- package/dist/core/ingestion/languages/cpp/captures.js +162 -54
- package/dist/core/ingestion/languages/cpp/file-local-linkage.d.ts +18 -52
- package/dist/core/ingestion/languages/cpp/file-local-linkage.js +49 -1
- package/dist/core/ingestion/languages/cpp/import-decomposer.d.ts +7 -0
- package/dist/core/ingestion/languages/cpp/import-decomposer.js +12 -0
- package/dist/core/ingestion/languages/cpp/index.d.ts +1 -0
- package/dist/core/ingestion/languages/cpp/index.js +1 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.d.ts +8 -0
- package/dist/core/ingestion/languages/cpp/inline-namespaces.js +21 -0
- package/dist/core/ingestion/languages/cpp/query.js +21 -0
- package/dist/core/ingestion/languages/cpp/range-bindings.js +20 -5
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +52 -5
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.d.ts +20 -0
- package/dist/core/ingestion/languages/cpp/two-phase-lookup.js +83 -3
- package/dist/core/ingestion/languages/csharp/captures.js +205 -41
- package/dist/core/ingestion/languages/csharp/index.d.ts +3 -4
- package/dist/core/ingestion/languages/csharp/index.js +3 -4
- package/dist/core/ingestion/languages/csharp/interpret.js +17 -3
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +17 -7
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +129 -124
- package/dist/core/ingestion/languages/csharp/qualified-type-names.d.ts +14 -0
- package/dist/core/ingestion/languages/csharp/qualified-type-names.js +59 -0
- package/dist/core/ingestion/languages/csharp/query.js +13 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +10 -6
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +8 -1
- package/dist/core/ingestion/languages/csharp.js +0 -5
- package/dist/core/ingestion/languages/dart/arity-metadata.d.ts +25 -0
- package/dist/core/ingestion/languages/dart/arity-metadata.js +35 -0
- package/dist/core/ingestion/languages/dart/arity.d.ts +19 -0
- package/dist/core/ingestion/languages/dart/arity.js +31 -0
- package/dist/core/ingestion/languages/dart/built-ins.d.ts +11 -0
- package/dist/core/ingestion/languages/dart/built-ins.js +34 -0
- package/dist/core/ingestion/languages/dart/cache-stats.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/cache-stats.js +24 -0
- package/dist/core/ingestion/languages/dart/captures.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/captures.js +445 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.d.ts +13 -0
- package/dist/core/ingestion/languages/dart/expand-wildcards.js +31 -0
- package/dist/core/ingestion/languages/dart/import-target.d.ts +15 -0
- package/dist/core/ingestion/languages/dart/import-target.js +65 -0
- package/dist/core/ingestion/languages/dart/index.d.ts +28 -0
- package/dist/core/ingestion/languages/dart/index.js +28 -0
- package/dist/core/ingestion/languages/dart/interpret.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/interpret.js +95 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.d.ts +10 -0
- package/dist/core/ingestion/languages/dart/merge-bindings.js +39 -0
- package/dist/core/ingestion/languages/dart/query.d.ts +26 -0
- package/dist/core/ingestion/languages/dart/query.js +142 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.d.ts +24 -0
- package/dist/core/ingestion/languages/dart/receiver-binding.js +87 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.d.ts +29 -0
- package/dist/core/ingestion/languages/dart/scope-resolver.js +194 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.d.ts +23 -0
- package/dist/core/ingestion/languages/dart/signature-bindings.js +51 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.d.ts +20 -0
- package/dist/core/ingestion/languages/dart/simple-hooks.js +47 -0
- package/dist/core/ingestion/languages/dart.d.ts +0 -1
- package/dist/core/ingestion/languages/dart.js +15 -29
- package/dist/core/ingestion/languages/go/arity-metadata.d.ts +1 -0
- package/dist/core/ingestion/languages/go/arity-metadata.js +31 -1
- package/dist/core/ingestion/languages/go/captures.js +162 -3
- package/dist/core/ingestion/languages/go/interface-impls.js +476 -50
- package/dist/core/ingestion/languages/go/interpret.js +21 -11
- package/dist/core/ingestion/languages/go/method-owners.js +20 -8
- package/dist/core/ingestion/languages/go/query.js +15 -7
- package/dist/core/ingestion/languages/go/range-binding.js +24 -9
- package/dist/core/ingestion/languages/go/receiver-binding.js +1 -1
- package/dist/core/ingestion/languages/go/scope-resolver.js +2 -2
- package/dist/core/ingestion/languages/go/simple-hooks.js +10 -5
- package/dist/core/ingestion/languages/go/type-binding.d.ts +1 -0
- package/dist/core/ingestion/languages/go/type-binding.js +40 -2
- package/dist/core/ingestion/languages/go.d.ts +0 -1
- package/dist/core/ingestion/languages/go.js +0 -5
- package/dist/core/ingestion/languages/index.d.ts +0 -5
- package/dist/core/ingestion/languages/index.js +0 -3
- package/dist/core/ingestion/languages/java/captures.js +252 -23
- package/dist/core/ingestion/languages/java/interpret.js +12 -6
- package/dist/core/ingestion/languages/java/package-siblings.js +18 -5
- package/dist/core/ingestion/languages/java/query.js +16 -1
- package/dist/core/ingestion/languages/java/scope-resolver.d.ts +2 -8
- package/dist/core/ingestion/languages/java/scope-resolver.js +2 -8
- package/dist/core/ingestion/languages/java.js +0 -5
- package/dist/core/ingestion/languages/javascript/captures.js +185 -11
- package/dist/core/ingestion/languages/javascript/query.js +107 -1
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.d.ts +57 -0
- package/dist/core/ingestion/languages/kotlin/capture-side-channel.js +60 -0
- package/dist/core/ingestion/languages/kotlin/captures.js +213 -22
- package/dist/core/ingestion/languages/kotlin/companion-scopes.d.ts +7 -0
- package/dist/core/ingestion/languages/kotlin/companion-scopes.js +10 -0
- package/dist/core/ingestion/languages/kotlin/index.d.ts +1 -0
- package/dist/core/ingestion/languages/kotlin/index.js +1 -0
- package/dist/core/ingestion/languages/kotlin/query.js +30 -0
- package/dist/core/ingestion/languages/kotlin/scope-resolver.d.ts +5 -7
- package/dist/core/ingestion/languages/kotlin/scope-resolver.js +22 -7
- package/dist/core/ingestion/languages/kotlin.js +8 -5
- package/dist/core/ingestion/languages/php/captures.js +135 -19
- package/dist/core/ingestion/languages/php/import-decomposer.js +21 -63
- package/dist/core/ingestion/languages/php/index.d.ts +3 -4
- package/dist/core/ingestion/languages/php/index.js +3 -4
- package/dist/core/ingestion/languages/php/query.js +5 -0
- package/dist/core/ingestion/languages/php/receiver-binding.js +8 -4
- package/dist/core/ingestion/languages/php.js +0 -4
- package/dist/core/ingestion/languages/python/captures.js +128 -13
- package/dist/core/ingestion/languages/python/depends-references.js +1 -1
- package/dist/core/ingestion/languages/python/import-target.d.ts +4 -5
- package/dist/core/ingestion/languages/python/import-target.js +108 -16
- package/dist/core/ingestion/languages/python/index-stats.d.ts +18 -0
- package/dist/core/ingestion/languages/python/index-stats.js +25 -0
- package/dist/core/ingestion/languages/python/index.d.ts +3 -4
- package/dist/core/ingestion/languages/python/index.js +3 -4
- package/dist/core/ingestion/languages/python/query.js +17 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +7 -6
- package/dist/core/ingestion/languages/python.d.ts +0 -2
- package/dist/core/ingestion/languages/python.js +0 -7
- package/dist/core/ingestion/languages/ruby/captures.js +174 -31
- package/dist/core/ingestion/languages/ruby/import-target.js +2 -1
- package/dist/core/ingestion/languages/ruby/interpret.js +2 -1
- package/dist/core/ingestion/languages/ruby/query.js +10 -0
- package/dist/core/ingestion/languages/ruby/scope-resolver.js +61 -11
- package/dist/core/ingestion/languages/ruby.js +4 -53
- package/dist/core/ingestion/languages/rust/captures.js +95 -13
- package/dist/core/ingestion/languages/rust/query.js +64 -1
- package/dist/core/ingestion/languages/rust/range-binding.js +40 -12
- package/dist/core/ingestion/languages/rust/receiver-binding.js +9 -0
- package/dist/core/ingestion/languages/rust/scope-resolver.js +75 -1
- package/dist/core/ingestion/languages/rust.d.ts +0 -2
- package/dist/core/ingestion/languages/rust.js +0 -6
- package/dist/core/ingestion/languages/swift/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/arity-metadata.js +41 -0
- package/dist/core/ingestion/languages/swift/arity.d.ts +29 -0
- package/dist/core/ingestion/languages/swift/arity.js +42 -0
- package/dist/core/ingestion/languages/swift/base-type.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/base-type.js +27 -0
- package/dist/core/ingestion/languages/swift/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/swift/captures.d.ts +35 -0
- package/dist/core/ingestion/languages/swift/captures.js +495 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/implicit-imports.js +57 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.d.ts +24 -0
- package/dist/core/ingestion/languages/swift/import-decomposer.js +84 -0
- package/dist/core/ingestion/languages/swift/import-target.d.ts +33 -0
- package/dist/core/ingestion/languages/swift/import-target.js +81 -0
- package/dist/core/ingestion/languages/swift/index.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/index.js +37 -0
- package/dist/core/ingestion/languages/swift/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/swift/interpret.js +89 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.d.ts +20 -0
- package/dist/core/ingestion/languages/swift/merge-bindings.js +48 -0
- package/dist/core/ingestion/languages/swift/query.d.ts +46 -0
- package/dist/core/ingestion/languages/swift/query.js +194 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.d.ts +40 -0
- package/dist/core/ingestion/languages/swift/receiver-binding.js +161 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.d.ts +50 -0
- package/dist/core/ingestion/languages/swift/scope-resolver.js +189 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.d.ts +34 -0
- package/dist/core/ingestion/languages/swift/sibling-type-bindings.js +65 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.d.ts +25 -0
- package/dist/core/ingestion/languages/swift/signature-bindings.js +66 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.d.ts +37 -0
- package/dist/core/ingestion/languages/swift/simple-hooks.js +60 -0
- package/dist/core/ingestion/languages/swift/target-grouping.d.ts +51 -0
- package/dist/core/ingestion/languages/swift/target-grouping.js +93 -0
- package/dist/core/ingestion/languages/swift/target-siblings.d.ts +30 -0
- package/dist/core/ingestion/languages/swift/target-siblings.js +71 -0
- package/dist/core/ingestion/languages/swift.d.ts +0 -5
- package/dist/core/ingestion/languages/swift.js +11 -87
- package/dist/core/ingestion/languages/typescript/array-callback.d.ts +3 -29
- package/dist/core/ingestion/languages/typescript/array-callback.js +4 -43
- package/dist/core/ingestion/languages/typescript/captures.js +147 -17
- package/dist/core/ingestion/languages/typescript/index.d.ts +3 -4
- package/dist/core/ingestion/languages/typescript/index.js +3 -4
- package/dist/core/ingestion/languages/typescript/query.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript/query.js +125 -4
- package/dist/core/ingestion/languages/typescript/receiver-binding.js +0 -1
- package/dist/core/ingestion/languages/typescript.d.ts +2 -3
- package/dist/core/ingestion/languages/typescript.js +46 -23
- package/dist/core/ingestion/languages/vue/captures.d.ts +46 -0
- package/dist/core/ingestion/languages/vue/captures.js +67 -0
- package/dist/core/ingestion/languages/vue/import-target.d.ts +27 -0
- package/dist/core/ingestion/languages/vue/import-target.js +58 -0
- package/dist/core/ingestion/languages/vue/index.d.ts +49 -0
- package/dist/core/ingestion/languages/vue/index.js +49 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.d.ts +55 -0
- package/dist/core/ingestion/languages/vue/scope-resolver.js +292 -0
- package/dist/core/ingestion/languages/vue.js +12 -4
- package/dist/core/ingestion/local-symbol-pruner.d.ts +11 -0
- package/dist/core/ingestion/local-symbol-pruner.js +63 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +14 -1
- package/dist/core/ingestion/method-extractors/configs/jvm.js +37 -20
- package/dist/core/ingestion/method-extractors/configs/php.js +0 -1
- package/dist/core/ingestion/method-extractors/configs/swift.js +11 -4
- package/dist/core/ingestion/method-types.d.ts +2 -2
- package/dist/core/ingestion/model/index.d.ts +0 -3
- package/dist/core/ingestion/model/index.js +0 -8
- package/dist/core/ingestion/model/resolve.d.ts +7 -43
- package/dist/core/ingestion/model/resolve.js +7 -226
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +46 -1
- package/dist/core/ingestion/model/semantic-model.d.ts +4 -6
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +3 -4
- package/dist/core/ingestion/model/symbol-table.js +3 -4
- package/dist/core/ingestion/parsing-processor.d.ts +30 -24
- package/dist/core/ingestion/parsing-processor.js +76 -640
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/communities.js +5 -2
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +9 -8
- package/dist/core/ingestion/pipeline-phases/cross-file.js +16 -12
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/mro.js +2 -2
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +44 -22
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +426 -565
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +13 -33
- package/dist/core/ingestion/pipeline-phases/parse.js +2 -2
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +1 -1
- package/dist/core/ingestion/pipeline-phases/processes.js +5 -3
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.d.ts +14 -0
- package/dist/core/ingestion/pipeline-phases/prune-local-symbols.js +26 -0
- package/dist/core/ingestion/pipeline.d.ts +27 -19
- package/dist/core/ingestion/pipeline.js +4 -2
- package/dist/core/ingestion/resolve-references.js +15 -3
- package/dist/core/ingestion/route-extractors/laravel.d.ts +10 -0
- package/dist/core/ingestion/route-extractors/laravel.js +88 -9
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +2 -1
- package/dist/core/ingestion/scope-extractor-bridge.js +2 -2
- package/dist/core/ingestion/scope-extractor.js +13 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +181 -15
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +21 -10
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +10 -2
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +7 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +58 -6
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +24 -5
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +68 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +189 -29
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +21 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +1 -1
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +8 -11
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +171 -50
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +3 -4
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +9 -4
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +28 -5
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +191 -24
- package/dist/core/ingestion/scope-resolution/pipeline/validate-bindings-immutability.js +31 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +72 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +440 -39
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +18 -2
- package/dist/core/ingestion/scope-resolution/workspace-index.js +94 -7
- package/dist/core/ingestion/tree-sitter-queries.d.ts +14 -14
- package/dist/core/ingestion/tree-sitter-queries.js +380 -158
- package/dist/core/ingestion/ts-js-hoc-utils.d.ts +12 -0
- package/dist/core/ingestion/ts-js-hoc-utils.js +105 -0
- package/dist/core/ingestion/type-env.d.ts +2 -1
- package/dist/core/ingestion/type-env.js +6 -8
- package/dist/core/ingestion/type-extractors/c-cpp.js +8 -10
- package/dist/core/ingestion/type-extractors/csharp.js +18 -34
- package/dist/core/ingestion/type-extractors/go.js +2 -10
- package/dist/core/ingestion/type-extractors/jvm.js +6 -5
- package/dist/core/ingestion/type-extractors/php.js +1 -1
- package/dist/core/ingestion/type-extractors/python.js +1 -1
- package/dist/core/ingestion/type-extractors/ruby.js +2 -2
- package/dist/core/ingestion/type-extractors/rust.js +0 -16
- package/dist/core/ingestion/type-extractors/shared.d.ts +2 -2
- package/dist/core/ingestion/type-extractors/shared.js +25 -11
- package/dist/core/ingestion/type-extractors/swift.js +5 -5
- package/dist/core/ingestion/type-extractors/types.d.ts +1 -1
- package/dist/core/ingestion/type-extractors/typescript.js +1 -1
- package/dist/core/ingestion/utils/ast-helpers.d.ts +119 -1
- package/dist/core/ingestion/utils/ast-helpers.js +260 -13
- package/dist/core/ingestion/utils/callable-labels.d.ts +13 -0
- package/dist/core/ingestion/utils/callable-labels.js +14 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.d.ts +10 -0
- package/dist/core/ingestion/utils/deferred-resolution-profile.js +30 -0
- package/dist/core/ingestion/utils/heap-probe.d.ts +20 -0
- package/dist/core/ingestion/utils/heap-probe.js +39 -0
- package/dist/core/ingestion/utils/heritage-marker.d.ts +33 -0
- package/dist/core/ingestion/utils/heritage-marker.js +41 -0
- package/dist/core/ingestion/utils/qualified-name.d.ts +37 -0
- package/dist/core/ingestion/utils/qualified-name.js +67 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +49 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +76 -62
- package/dist/core/ingestion/variable-extractors/configs/go.js +74 -7
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +35 -8
- package/dist/core/ingestion/variable-extractors/generic.js +40 -12
- package/dist/core/ingestion/variable-types.d.ts +9 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +97 -7
- package/dist/core/ingestion/vue-sfc-extractor.js +433 -11
- package/dist/core/ingestion/workers/parse-worker.d.ts +0 -11
- package/dist/core/ingestion/workers/parse-worker.js +358 -187
- package/dist/core/ingestion/workers/worker-pool.d.ts +78 -9
- package/dist/core/ingestion/workers/worker-pool.js +346 -49
- package/dist/core/lbug/csv-generator.js +20 -2
- package/dist/core/lbug/lbug-adapter.js +29 -10
- package/dist/core/lbug/native-check.js +17 -5
- package/dist/core/lbug/pool-adapter.d.ts +0 -19
- package/dist/core/lbug/pool-adapter.js +40 -77
- package/dist/core/lbug/query-result-utils.d.ts +19 -0
- package/dist/core/lbug/query-result-utils.js +28 -0
- package/dist/core/run-analyze.d.ts +9 -2
- package/dist/core/run-analyze.js +24 -3
- package/dist/core/tree-sitter/parser-loader.d.ts +13 -0
- package/dist/core/tree-sitter/parser-loader.js +4 -0
- package/dist/core/tree-sitter/safe-parse.d.ts +70 -3
- package/dist/core/tree-sitter/safe-parse.js +214 -11
- package/dist/core/wiki/generator.js +13 -5
- package/dist/core/wiki/graph-queries.d.ts +3 -0
- package/dist/core/wiki/graph-queries.js +9 -1
- package/dist/core/wiki/llm-client.d.ts +1 -1
- package/dist/core/wiki/llm-client.js +7 -2
- package/dist/core/wiki/local-cli-client.d.ts +2 -1
- package/dist/core/wiki/local-cli-client.js +62 -4
- package/dist/mcp/compatible-stdio-transport.d.ts +3 -0
- package/dist/mcp/compatible-stdio-transport.js +22 -0
- package/dist/mcp/core/embedder.d.ts +1 -1
- package/dist/mcp/core/embedder.js +13 -1
- package/dist/mcp/local/local-backend.d.ts +37 -5
- package/dist/mcp/local/local-backend.js +227 -129
- package/dist/mcp/resources.js +3 -3
- package/dist/mcp/server.js +9 -1
- package/dist/storage/git.d.ts +11 -0
- package/dist/storage/git.js +30 -0
- package/dist/storage/parse-cache.d.ts +23 -1
- package/dist/storage/parse-cache.js +138 -32
- package/dist/storage/parsedfile-store.d.ts +142 -0
- package/dist/storage/parsedfile-store.js +367 -0
- package/dist/storage/repo-manager.d.ts +2 -1
- package/dist/storage/scope-index-store.d.ts +114 -0
- package/dist/storage/scope-index-store.js +236 -0
- package/dist/types/pipeline.d.ts +6 -3
- package/hooks/antigravity/gitnexus-antigravity-hook.cjs +2 -1
- package/hooks/claude/gitnexus-hook.cjs +2 -1
- package/hooks/claude/resolve-analyze-cmd.cjs +323 -0
- package/package.json +4 -5
- package/scripts/bench-scope-resolution.ts +1 -3
- package/scripts/cross-platform-tests.ts +4 -1
- package/skills/gitnexus-cli.md +8 -6
- package/skills/gitnexus-debugging.md +15 -15
- package/skills/gitnexus-exploring.md +11 -11
- package/skills/gitnexus-guide.md +1 -1
- package/skills/gitnexus-impact-analysis.md +10 -10
- package/skills/gitnexus-pr-review.md +19 -19
- package/skills/gitnexus-refactoring.md +25 -25
- package/web/assets/{agent-BRX-afm3.js → agent-EkX7webX.js} +156 -131
- package/web/assets/{architectureDiagram-UL44E2DR-B1oYB8-c.js → architectureDiagram-UL44E2DR-BoczH8cv.js} +1 -1
- package/web/assets/{chunk-LCXTWHL2-SPC6pgWI.js → chunk-LCXTWHL2-By5HB3b-.js} +1 -1
- package/web/assets/{chunk-RG4AUYOV-DZXr4Yv3.js → chunk-RG4AUYOV-BQE_DkpL.js} +1 -1
- package/web/assets/{classDiagram-KGZ6W3CR-BqpOj8L9.js → classDiagram-KGZ6W3CR-Dj_02GUH.js} +1 -1
- package/web/assets/{classDiagram-v2-72OJOZXJ-FmElywK2.js → classDiagram-v2-72OJOZXJ-D-NArMpf.js} +1 -1
- package/web/assets/{diagram-3NCE3AQN-BWtJXMDq.js → diagram-3NCE3AQN-VXtXDO95.js} +1 -1
- package/web/assets/{diagram-GF46GFSD-Hh-fChxU.js → diagram-GF46GFSD-B1qab2Ah.js} +1 -1
- package/web/assets/{diagram-QXG6HAR7-DYeQHxGU.js → diagram-QXG6HAR7-BSCHGzzT.js} +1 -1
- package/web/assets/{diagram-WEQXMOUZ-DYGU4T0y.js → diagram-WEQXMOUZ-DHtknmNT.js} +1 -1
- package/web/assets/{erDiagram-L5TCEMPS-bN3wlP2A.js → erDiagram-L5TCEMPS-Db-IYTmm.js} +1 -1
- package/web/assets/{flowDiagram-H6V6AXG4-YACVtF3-.js → flowDiagram-H6V6AXG4-BHDoyVoW.js} +1 -1
- package/web/assets/{index-BhnAdWTt.js → index-BR0IhgbR.js} +10 -10
- package/web/assets/{infoDiagram-3YFTVSEB-BWBzD28-.js → infoDiagram-3YFTVSEB-6h8wbWEe.js} +1 -1
- package/web/assets/{ishikawaDiagram-BNXS4ZKH-B8qYT-j9.js → ishikawaDiagram-BNXS4ZKH-Dx2OkPk1.js} +1 -1
- package/web/assets/{kanban-definition-75IXJCU3-BeoPr5Tl.js → kanban-definition-75IXJCU3-CIIEZfqV.js} +1 -1
- package/web/assets/{mindmap-definition-2TDM6QVE-CdLLN_so.js → mindmap-definition-2TDM6QVE-DUAqydRq.js} +1 -1
- package/web/assets/{pieDiagram-CU6KROY3-DEd2a_k_.js → pieDiagram-CU6KROY3-BntYuYZa.js} +1 -1
- package/web/assets/{requirementDiagram-JXO7QTGE-QNeTo5C_.js → requirementDiagram-JXO7QTGE-QCD6I29n.js} +1 -1
- package/web/assets/{sequenceDiagram-VS2MUI6T-BHC7q7yJ.js → sequenceDiagram-VS2MUI6T-DScFwLz2.js} +1 -1
- package/web/assets/{stateDiagram-7D4R322I-KONnc2Px.js → stateDiagram-7D4R322I-AkRAm6Hl.js} +1 -1
- package/web/assets/{stateDiagram-v2-36443NZ5-C2QfuMlu.js → stateDiagram-v2-36443NZ5-BCK1vigR.js} +1 -1
- package/web/assets/{timeline-definition-O6YCAMPW-D4t4NJx1.js → timeline-definition-O6YCAMPW-BvpIVXjX.js} +1 -1
- package/web/assets/{vennDiagram-MWXL3ELB-6bctC9Yg.js → vennDiagram-MWXL3ELB-BYGWk6dK.js} +1 -1
- package/web/assets/{wardleyDiagram-CUQ6CDDI-BPZYNTvC.js → wardleyDiagram-CUQ6CDDI-Dk1z7H2T.js} +1 -1
- package/web/assets/{xychartDiagram-N2JHSOCM-lBI9O6DW.js → xychartDiagram-N2JHSOCM-2N6NCSWN.js} +1 -1
- package/web/index.html +1 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +0 -63
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/aggregate.js +0 -122
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +0 -59
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +0 -1
- package/dist/_shared/scope-resolution/shadow/diff.js +0 -79
- package/dist/_shared/scope-resolution/shadow/diff.js.map +0 -1
- package/dist/core/ingestion/ast-cache.d.ts +0 -26
- package/dist/core/ingestion/ast-cache.js +0 -48
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +0 -13
- package/dist/core/ingestion/heritage-extractors/configs/go.js +0 -20
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +0 -18
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +0 -65
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +0 -23
- package/dist/core/ingestion/heritage-extractors/generic.js +0 -47
- package/dist/core/ingestion/heritage-processor.d.ts +0 -54
- package/dist/core/ingestion/heritage-processor.js +0 -367
- package/dist/core/ingestion/heritage-types.d.ts +0 -73
- package/dist/core/ingestion/heritage-types.js +0 -2
- package/dist/core/ingestion/import-processor.d.ts +0 -23
- package/dist/core/ingestion/import-processor.js +0 -377
- package/dist/core/ingestion/model/heritage-map.d.ts +0 -105
- package/dist/core/ingestion/model/heritage-map.js +0 -294
- package/dist/core/ingestion/model/resolution-context.d.ts +0 -93
- package/dist/core/ingestion/model/resolution-context.js +0 -337
- package/dist/core/ingestion/named-bindings/csharp.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/csharp.js +0 -37
- package/dist/core/ingestion/named-bindings/java.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/java.js +0 -29
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/kotlin.js +0 -36
- package/dist/core/ingestion/named-bindings/php.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/php.js +0 -61
- package/dist/core/ingestion/named-bindings/python.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/python.js +0 -49
- package/dist/core/ingestion/named-bindings/rust.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/rust.js +0 -66
- package/dist/core/ingestion/named-bindings/types.d.ts +0 -16
- package/dist/core/ingestion/named-bindings/types.js +0 -6
- package/dist/core/ingestion/named-bindings/typescript.d.ts +0 -3
- package/dist/core/ingestion/named-bindings/typescript.js +0 -58
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +0 -17
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +0 -209
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +0 -22
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +0 -92
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +0 -70
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +0 -312
- package/dist/core/ingestion/registry-primary-flag.d.ts +0 -89
- package/dist/core/ingestion/registry-primary-flag.js +0 -122
- package/dist/core/ingestion/shadow-harness.d.ts +0 -113
- package/dist/core/ingestion/shadow-harness.js +0 -148
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +0 -52
- package/dist/core/ingestion/utils/ruby-self-call.js +0 -59
- package/scripts/ci-list-migrated-languages.ts +0 -24
- package/scripts/run-parity.ts +0 -128
|
@@ -4,7 +4,13 @@
|
|
|
4
4
|
* Note: Different grammars (typescript vs tsx vs javascript) may have
|
|
5
5
|
* slightly different node types. These queries are designed to be
|
|
6
6
|
* compatible with the standard tree-sitter grammars.
|
|
7
|
+
*
|
|
8
|
+
* Heritage (extends/implements/embed/trait) is NOT captured here. The legacy
|
|
9
|
+
* heritage-capture leg was removed (issue #942); inheritance edges are
|
|
10
|
+
* produced by the registry-primary scope-resolution path, which synthesizes
|
|
11
|
+
* `@reference.inherits` captures in each language's `languages/<lang>/captures.ts`.
|
|
7
12
|
*/
|
|
13
|
+
import { ARRAY_METHOD_NOT_ANY_OF_PREDICATE } from './ts-js-hoc-utils.js';
|
|
8
14
|
// TypeScript queries - works with tree-sitter-typescript
|
|
9
15
|
export const TYPESCRIPT_QUERIES = `
|
|
10
16
|
(class_declaration
|
|
@@ -94,10 +100,17 @@ export const TYPESCRIPT_QUERIES = `
|
|
|
94
100
|
; \`tsExtractFunctionName\` for the resolution logic and the \`query.ts\`
|
|
95
101
|
; comment for the full anchor-discipline rationale and the chained-
|
|
96
102
|
; array-method trade-off.
|
|
103
|
+
;
|
|
104
|
+
; NOTE: Excludes member-expression calls to common array methods (map, filter,
|
|
105
|
+
; reduce, etc.) to avoid false positives like \`const x = arr.map(a => ...)\`
|
|
106
|
+
; being classified as a Function when it's actually a Const holding an array.
|
|
107
|
+
; Direct identifier calls and member expressions on non-array-methods (like
|
|
108
|
+
; React.memo) are still matched.
|
|
97
109
|
(lexical_declaration
|
|
98
110
|
(variable_declarator
|
|
99
111
|
name: (identifier) @name
|
|
100
112
|
value: (call_expression
|
|
113
|
+
function: (identifier)
|
|
101
114
|
arguments: (arguments
|
|
102
115
|
(arrow_function))))) @definition.function
|
|
103
116
|
|
|
@@ -105,14 +118,36 @@ export const TYPESCRIPT_QUERIES = `
|
|
|
105
118
|
(variable_declarator
|
|
106
119
|
name: (identifier) @name
|
|
107
120
|
value: (call_expression
|
|
121
|
+
function: (identifier)
|
|
108
122
|
arguments: (arguments
|
|
109
123
|
(function_expression))))) @definition.function
|
|
110
124
|
|
|
125
|
+
(lexical_declaration
|
|
126
|
+
(variable_declarator
|
|
127
|
+
name: (identifier) @name
|
|
128
|
+
value: (call_expression
|
|
129
|
+
function: (member_expression
|
|
130
|
+
property: (property_identifier) @callee)
|
|
131
|
+
arguments: (arguments
|
|
132
|
+
(arrow_function))))
|
|
133
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
134
|
+
|
|
135
|
+
(lexical_declaration
|
|
136
|
+
(variable_declarator
|
|
137
|
+
name: (identifier) @name
|
|
138
|
+
value: (call_expression
|
|
139
|
+
function: (member_expression
|
|
140
|
+
property: (property_identifier) @callee)
|
|
141
|
+
arguments: (arguments
|
|
142
|
+
(function_expression))))
|
|
143
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
144
|
+
|
|
111
145
|
(export_statement
|
|
112
146
|
declaration: (lexical_declaration
|
|
113
147
|
(variable_declarator
|
|
114
148
|
name: (identifier) @name
|
|
115
149
|
value: (call_expression
|
|
150
|
+
function: (identifier)
|
|
116
151
|
arguments: (arguments
|
|
117
152
|
(arrow_function)))))) @definition.function
|
|
118
153
|
|
|
@@ -121,15 +156,40 @@ export const TYPESCRIPT_QUERIES = `
|
|
|
121
156
|
(variable_declarator
|
|
122
157
|
name: (identifier) @name
|
|
123
158
|
value: (call_expression
|
|
159
|
+
function: (identifier)
|
|
124
160
|
arguments: (arguments
|
|
125
161
|
(function_expression)))))) @definition.function
|
|
126
162
|
|
|
163
|
+
(export_statement
|
|
164
|
+
declaration: (lexical_declaration
|
|
165
|
+
(variable_declarator
|
|
166
|
+
name: (identifier) @name
|
|
167
|
+
value: (call_expression
|
|
168
|
+
function: (member_expression
|
|
169
|
+
property: (property_identifier) @callee)
|
|
170
|
+
arguments: (arguments
|
|
171
|
+
(arrow_function)))))
|
|
172
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
173
|
+
|
|
174
|
+
(export_statement
|
|
175
|
+
declaration: (lexical_declaration
|
|
176
|
+
(variable_declarator
|
|
177
|
+
name: (identifier) @name
|
|
178
|
+
value: (call_expression
|
|
179
|
+
function: (member_expression
|
|
180
|
+
property: (property_identifier) @callee)
|
|
181
|
+
arguments: (arguments
|
|
182
|
+
(function_expression)))))
|
|
183
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
184
|
+
|
|
127
185
|
; \`var X = HOC(...)\` parity with registry-primary. Legacy code (and any
|
|
128
186
|
; transpiler output that downlevels \`const\` to \`var\`) hits this shape.
|
|
187
|
+
; Same array-method exclusions as const/let patterns above.
|
|
129
188
|
(variable_declaration
|
|
130
189
|
(variable_declarator
|
|
131
190
|
name: (identifier) @name
|
|
132
191
|
value: (call_expression
|
|
192
|
+
function: (identifier)
|
|
133
193
|
arguments: (arguments
|
|
134
194
|
(arrow_function))))) @definition.function
|
|
135
195
|
|
|
@@ -137,9 +197,60 @@ export const TYPESCRIPT_QUERIES = `
|
|
|
137
197
|
(variable_declarator
|
|
138
198
|
name: (identifier) @name
|
|
139
199
|
value: (call_expression
|
|
200
|
+
function: (identifier)
|
|
140
201
|
arguments: (arguments
|
|
141
202
|
(function_expression))))) @definition.function
|
|
142
203
|
|
|
204
|
+
(variable_declaration
|
|
205
|
+
(variable_declarator
|
|
206
|
+
name: (identifier) @name
|
|
207
|
+
value: (call_expression
|
|
208
|
+
function: (member_expression
|
|
209
|
+
property: (property_identifier) @callee)
|
|
210
|
+
arguments: (arguments
|
|
211
|
+
(arrow_function))))
|
|
212
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
213
|
+
|
|
214
|
+
(variable_declaration
|
|
215
|
+
(variable_declarator
|
|
216
|
+
name: (identifier) @name
|
|
217
|
+
value: (call_expression
|
|
218
|
+
function: (member_expression
|
|
219
|
+
property: (property_identifier) @callee)
|
|
220
|
+
arguments: (arguments
|
|
221
|
+
(function_expression))))
|
|
222
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
223
|
+
|
|
224
|
+
; HOC-wrapped default exports: \`export default defineEventHandler(async (e) => { ... })\`.
|
|
225
|
+
; The worker rewrites the wrapper-derived @name to a file-derived symbol name
|
|
226
|
+
; so helpers like \`defineEventHandler\` / \`React.memo\` do not collapse
|
|
227
|
+
; unrelated modules onto the same Function name.
|
|
228
|
+
(export_statement
|
|
229
|
+
value: (call_expression
|
|
230
|
+
function: (identifier) @hoc
|
|
231
|
+
arguments: (arguments
|
|
232
|
+
(arrow_function)))) @definition.function
|
|
233
|
+
|
|
234
|
+
(export_statement
|
|
235
|
+
value: (call_expression
|
|
236
|
+
function: (identifier) @hoc
|
|
237
|
+
arguments: (arguments
|
|
238
|
+
(function_expression)))) @definition.function
|
|
239
|
+
|
|
240
|
+
(export_statement
|
|
241
|
+
value: (call_expression
|
|
242
|
+
function: (member_expression
|
|
243
|
+
property: (property_identifier) @callee)
|
|
244
|
+
arguments: (arguments
|
|
245
|
+
(arrow_function)))) @definition.function
|
|
246
|
+
|
|
247
|
+
(export_statement
|
|
248
|
+
value: (call_expression
|
|
249
|
+
function: (member_expression
|
|
250
|
+
property: (property_identifier) @callee)
|
|
251
|
+
arguments: (arguments
|
|
252
|
+
(function_expression)))) @definition.function
|
|
253
|
+
|
|
143
254
|
; Variable/constant declarations (non-function values).
|
|
144
255
|
; Overlap with @definition.function patterns is handled by parse-worker dedup.
|
|
145
256
|
(lexical_declaration
|
|
@@ -204,20 +315,6 @@ export const TYPESCRIPT_QUERIES = `
|
|
|
204
315
|
(accessibility_modifier)
|
|
205
316
|
pattern: (identifier) @name) @definition.property
|
|
206
317
|
|
|
207
|
-
; Heritage queries - class extends
|
|
208
|
-
(class_declaration
|
|
209
|
-
name: (type_identifier) @heritage.class
|
|
210
|
-
(class_heritage
|
|
211
|
-
(extends_clause
|
|
212
|
-
value: (identifier) @heritage.extends))) @heritage
|
|
213
|
-
|
|
214
|
-
; Heritage queries - class implements interface
|
|
215
|
-
(class_declaration
|
|
216
|
-
name: (type_identifier) @heritage.class
|
|
217
|
-
(class_heritage
|
|
218
|
-
(implements_clause
|
|
219
|
-
(type_identifier) @heritage.implements))) @heritage.impl
|
|
220
|
-
|
|
221
318
|
; Write access: obj.field = value
|
|
222
319
|
(assignment_expression
|
|
223
320
|
left: (member_expression
|
|
@@ -327,10 +424,12 @@ export const JAVASCRIPT_QUERIES = `
|
|
|
327
424
|
; / debounce / user-defined HOC factories). Both \`const\` and \`var\` forms
|
|
328
425
|
; are mirrored so JS code that uses \`var\` (or transpiler output) gets the
|
|
329
426
|
; same attribution as the registry-primary path.
|
|
427
|
+
; Excludes common array methods (map, filter, reduce, etc.) to avoid false positives.
|
|
330
428
|
(lexical_declaration
|
|
331
429
|
(variable_declarator
|
|
332
430
|
name: (identifier) @name
|
|
333
431
|
value: (call_expression
|
|
432
|
+
function: (identifier)
|
|
334
433
|
arguments: (arguments
|
|
335
434
|
(arrow_function))))) @definition.function
|
|
336
435
|
|
|
@@ -338,14 +437,36 @@ export const JAVASCRIPT_QUERIES = `
|
|
|
338
437
|
(variable_declarator
|
|
339
438
|
name: (identifier) @name
|
|
340
439
|
value: (call_expression
|
|
440
|
+
function: (identifier)
|
|
341
441
|
arguments: (arguments
|
|
342
442
|
(function_expression))))) @definition.function
|
|
343
443
|
|
|
444
|
+
(lexical_declaration
|
|
445
|
+
(variable_declarator
|
|
446
|
+
name: (identifier) @name
|
|
447
|
+
value: (call_expression
|
|
448
|
+
function: (member_expression
|
|
449
|
+
property: (property_identifier) @callee)
|
|
450
|
+
arguments: (arguments
|
|
451
|
+
(arrow_function))))
|
|
452
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
453
|
+
|
|
454
|
+
(lexical_declaration
|
|
455
|
+
(variable_declarator
|
|
456
|
+
name: (identifier) @name
|
|
457
|
+
value: (call_expression
|
|
458
|
+
function: (member_expression
|
|
459
|
+
property: (property_identifier) @callee)
|
|
460
|
+
arguments: (arguments
|
|
461
|
+
(function_expression))))
|
|
462
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
463
|
+
|
|
344
464
|
(export_statement
|
|
345
465
|
declaration: (lexical_declaration
|
|
346
466
|
(variable_declarator
|
|
347
467
|
name: (identifier) @name
|
|
348
468
|
value: (call_expression
|
|
469
|
+
function: (identifier)
|
|
349
470
|
arguments: (arguments
|
|
350
471
|
(arrow_function)))))) @definition.function
|
|
351
472
|
|
|
@@ -354,14 +475,39 @@ export const JAVASCRIPT_QUERIES = `
|
|
|
354
475
|
(variable_declarator
|
|
355
476
|
name: (identifier) @name
|
|
356
477
|
value: (call_expression
|
|
478
|
+
function: (identifier)
|
|
357
479
|
arguments: (arguments
|
|
358
480
|
(function_expression)))))) @definition.function
|
|
359
481
|
|
|
482
|
+
(export_statement
|
|
483
|
+
declaration: (lexical_declaration
|
|
484
|
+
(variable_declarator
|
|
485
|
+
name: (identifier) @name
|
|
486
|
+
value: (call_expression
|
|
487
|
+
function: (member_expression
|
|
488
|
+
property: (property_identifier) @callee)
|
|
489
|
+
arguments: (arguments
|
|
490
|
+
(arrow_function)))))
|
|
491
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
492
|
+
|
|
493
|
+
(export_statement
|
|
494
|
+
declaration: (lexical_declaration
|
|
495
|
+
(variable_declarator
|
|
496
|
+
name: (identifier) @name
|
|
497
|
+
value: (call_expression
|
|
498
|
+
function: (member_expression
|
|
499
|
+
property: (property_identifier) @callee)
|
|
500
|
+
arguments: (arguments
|
|
501
|
+
(function_expression)))))
|
|
502
|
+
${ARRAY_METHOD_NOT_ANY_OF_PREDICATE}) @definition.function
|
|
503
|
+
|
|
360
504
|
; \`var X = HOC(...)\` parity with registry-primary.
|
|
505
|
+
; Same array-method exclusions as const/let patterns.
|
|
361
506
|
(variable_declaration
|
|
362
507
|
(variable_declarator
|
|
363
508
|
name: (identifier) @name
|
|
364
509
|
value: (call_expression
|
|
510
|
+
function: (identifier)
|
|
365
511
|
arguments: (arguments
|
|
366
512
|
(arrow_function))))) @definition.function
|
|
367
513
|
|
|
@@ -369,9 +515,57 @@ export const JAVASCRIPT_QUERIES = `
|
|
|
369
515
|
(variable_declarator
|
|
370
516
|
name: (identifier) @name
|
|
371
517
|
value: (call_expression
|
|
518
|
+
function: (identifier)
|
|
372
519
|
arguments: (arguments
|
|
373
520
|
(function_expression))))) @definition.function
|
|
374
521
|
|
|
522
|
+
(variable_declaration
|
|
523
|
+
(variable_declarator
|
|
524
|
+
name: (identifier) @name
|
|
525
|
+
value: (call_expression
|
|
526
|
+
function: (member_expression
|
|
527
|
+
property: (property_identifier) @callee)
|
|
528
|
+
arguments: (arguments
|
|
529
|
+
(arrow_function))))
|
|
530
|
+
(#not-any-of? @callee "map" "filter" "reduce" "forEach" "find" "findIndex" "some" "every" "flatMap" "sort" "splice" "slice" "concat" "fill" "copyWithin" "join" "flat" "at" "entries" "keys" "values" "indexOf" "lastIndexOf" "includes" "pop" "push" "shift" "unshift" "reverse" "reduceRight" "toSorted" "toReversed" "toSpliced" "with")) @definition.function
|
|
531
|
+
|
|
532
|
+
(variable_declaration
|
|
533
|
+
(variable_declarator
|
|
534
|
+
name: (identifier) @name
|
|
535
|
+
value: (call_expression
|
|
536
|
+
function: (member_expression
|
|
537
|
+
property: (property_identifier) @callee)
|
|
538
|
+
arguments: (arguments
|
|
539
|
+
(function_expression))))
|
|
540
|
+
(#not-any-of? @callee "map" "filter" "reduce" "forEach" "find" "findIndex" "some" "every" "flatMap" "sort" "splice" "slice" "concat" "fill" "copyWithin" "join" "flat" "at" "entries" "keys" "values" "indexOf" "lastIndexOf" "includes" "pop" "push" "shift" "unshift" "reverse" "reduceRight" "toSorted" "toReversed" "toSpliced" "with")) @definition.function
|
|
541
|
+
|
|
542
|
+
; HOC-wrapped default exports (JS parity with TS patterns above).
|
|
543
|
+
(export_statement
|
|
544
|
+
value: (call_expression
|
|
545
|
+
function: (identifier) @hoc
|
|
546
|
+
arguments: (arguments
|
|
547
|
+
(arrow_function)))) @definition.function
|
|
548
|
+
|
|
549
|
+
(export_statement
|
|
550
|
+
value: (call_expression
|
|
551
|
+
function: (identifier) @hoc
|
|
552
|
+
arguments: (arguments
|
|
553
|
+
(function_expression)))) @definition.function
|
|
554
|
+
|
|
555
|
+
(export_statement
|
|
556
|
+
value: (call_expression
|
|
557
|
+
function: (member_expression
|
|
558
|
+
property: (property_identifier) @callee)
|
|
559
|
+
arguments: (arguments
|
|
560
|
+
(arrow_function)))) @definition.function
|
|
561
|
+
|
|
562
|
+
(export_statement
|
|
563
|
+
value: (call_expression
|
|
564
|
+
function: (member_expression
|
|
565
|
+
property: (property_identifier) @callee)
|
|
566
|
+
arguments: (arguments
|
|
567
|
+
(function_expression)))) @definition.function
|
|
568
|
+
|
|
375
569
|
; Variable/constant declarations (non-function values).
|
|
376
570
|
; Overlap with @definition.function patterns is handled by parse-worker dedup.
|
|
377
571
|
(lexical_declaration
|
|
@@ -410,13 +604,6 @@ export const JAVASCRIPT_QUERIES = `
|
|
|
410
604
|
(field_definition
|
|
411
605
|
property: (property_identifier) @name) @definition.property
|
|
412
606
|
|
|
413
|
-
; Heritage queries - class extends (JavaScript uses different AST than TypeScript)
|
|
414
|
-
; In tree-sitter-javascript, class_heritage directly contains the parent identifier
|
|
415
|
-
(class_declaration
|
|
416
|
-
name: (identifier) @heritage.class
|
|
417
|
-
(class_heritage
|
|
418
|
-
(identifier) @heritage.extends)) @heritage
|
|
419
|
-
|
|
420
607
|
; Write access: obj.field = value
|
|
421
608
|
(assignment_expression
|
|
422
609
|
left: (member_expression
|
|
@@ -502,12 +689,6 @@ export const PYTHON_QUERIES = `
|
|
|
502
689
|
(assignment
|
|
503
690
|
left: (identifier) @name)) @definition.variable
|
|
504
691
|
|
|
505
|
-
; Heritage queries - Python class inheritance
|
|
506
|
-
(class_definition
|
|
507
|
-
name: (identifier) @heritage.class
|
|
508
|
-
superclasses: (argument_list
|
|
509
|
-
(identifier) @heritage.extends)) @heritage
|
|
510
|
-
|
|
511
692
|
; Write access: obj.field = value
|
|
512
693
|
(assignment
|
|
513
694
|
left: (attribute
|
|
@@ -571,14 +752,6 @@ export const JAVA_QUERIES = `
|
|
|
571
752
|
declarator: (variable_declarator
|
|
572
753
|
name: (identifier) @name)) @definition.variable
|
|
573
754
|
|
|
574
|
-
; Heritage - extends class
|
|
575
|
-
(class_declaration name: (identifier) @heritage.class
|
|
576
|
-
(superclass (type_identifier) @heritage.extends)) @heritage
|
|
577
|
-
|
|
578
|
-
; Heritage - implements interfaces
|
|
579
|
-
(class_declaration name: (identifier) @heritage.class
|
|
580
|
-
(super_interfaces (type_list (type_identifier) @heritage.implements))) @heritage.impl
|
|
581
|
-
|
|
582
755
|
; Write access: obj.field = value
|
|
583
756
|
(assignment_expression
|
|
584
757
|
left: (field_access
|
|
@@ -601,8 +774,17 @@ export const C_QUERIES = `
|
|
|
601
774
|
|
|
602
775
|
; Structs, Unions, Enums, Typedefs
|
|
603
776
|
(struct_specifier name: (type_identifier) @name) @definition.struct
|
|
777
|
+
(type_definition
|
|
778
|
+
type: (struct_specifier
|
|
779
|
+
body: (field_declaration_list))
|
|
780
|
+
declarator: (type_identifier) @name) @definition.struct
|
|
604
781
|
(union_specifier name: (type_identifier) @name) @definition.union
|
|
605
782
|
(enum_specifier name: (type_identifier) @name) @definition.enum
|
|
783
|
+
(type_definition
|
|
784
|
+
type: (enum_specifier
|
|
785
|
+
body: (enumerator_list))
|
|
786
|
+
declarator: (type_identifier) @name) @definition.enum
|
|
787
|
+
(enumerator name: (identifier) @name) @definition.const
|
|
606
788
|
(type_definition declarator: (type_identifier) @name) @definition.typedef
|
|
607
789
|
|
|
608
790
|
; Macros
|
|
@@ -626,6 +808,7 @@ export const GO_QUERIES = `
|
|
|
626
808
|
; Functions & Methods
|
|
627
809
|
(function_declaration name: (identifier) @name) @definition.function
|
|
628
810
|
(method_declaration name: (field_identifier) @name) @definition.method
|
|
811
|
+
(method_elem name: (field_identifier) @name) @definition.method
|
|
629
812
|
|
|
630
813
|
; Types
|
|
631
814
|
(type_declaration (type_spec name: (type_identifier) @name type: (struct_type))) @definition.struct
|
|
@@ -640,22 +823,14 @@ export const GO_QUERIES = `
|
|
|
640
823
|
(field_declaration
|
|
641
824
|
name: (field_identifier) @name) @definition.property)
|
|
642
825
|
|
|
643
|
-
; Struct embedding (anonymous fields = inheritance)
|
|
644
|
-
(type_declaration
|
|
645
|
-
(type_spec
|
|
646
|
-
name: (type_identifier) @heritage.class
|
|
647
|
-
type: (struct_type
|
|
648
|
-
(field_declaration_list
|
|
649
|
-
(field_declaration
|
|
650
|
-
type: (type_identifier) @heritage.extends))))) @definition.struct
|
|
651
|
-
|
|
652
826
|
; Calls
|
|
653
827
|
(call_expression function: (identifier) @call.name) @call
|
|
654
828
|
(call_expression function: (selector_expression field: (field_identifier) @call.name)) @call
|
|
655
829
|
|
|
656
830
|
; Const/var declarations
|
|
657
|
-
(const_declaration (const_spec
|
|
658
|
-
(var_declaration (var_spec
|
|
831
|
+
(const_declaration (const_spec (identifier) @name)) @definition.const
|
|
832
|
+
(var_declaration (var_spec (identifier) @name)) @definition.variable
|
|
833
|
+
(var_declaration (var_spec_list (var_spec (identifier) @name))) @definition.variable
|
|
659
834
|
|
|
660
835
|
; Short variable declaration: x := 5
|
|
661
836
|
(short_var_declaration left: (expression_list (identifier) @name)) @definition.variable
|
|
@@ -689,6 +864,12 @@ export const CPP_QUERIES = `
|
|
|
689
864
|
name: (template_type
|
|
690
865
|
(type_identifier) @name
|
|
691
866
|
(template_argument_list) @template-arguments)) @definition.class
|
|
867
|
+
; Out-of-line nested definition: class Outer::Inner { ... } / struct Outer::Inner { ... }.
|
|
868
|
+
; Key the node by the full qualified_identifier text so the def materializes a
|
|
869
|
+
; node that matches the HAS_METHOD owner id (also the full qualified text) and
|
|
870
|
+
; stays distinct from a same-tail type in another scope (#1975, #1978).
|
|
871
|
+
(class_specifier name: (qualified_identifier) @name) @definition.class
|
|
872
|
+
(struct_specifier name: (qualified_identifier) @name) @definition.struct
|
|
692
873
|
(struct_specifier name: (type_identifier) @name) @definition.struct
|
|
693
874
|
(struct_specifier
|
|
694
875
|
name: (template_type
|
|
@@ -698,6 +879,15 @@ export const CPP_QUERIES = `
|
|
|
698
879
|
(enum_specifier name: (type_identifier) @name) @definition.enum
|
|
699
880
|
|
|
700
881
|
; Typedefs and unions (common in C-style headers and mixed C/C++ code)
|
|
882
|
+
(type_definition
|
|
883
|
+
type: (struct_specifier
|
|
884
|
+
body: (field_declaration_list))
|
|
885
|
+
declarator: (type_identifier) @name) @definition.struct
|
|
886
|
+
(type_definition
|
|
887
|
+
type: (enum_specifier
|
|
888
|
+
body: (enumerator_list))
|
|
889
|
+
declarator: (type_identifier) @name) @definition.enum
|
|
890
|
+
(enumerator name: (identifier) @name) @definition.const
|
|
701
891
|
(type_definition declarator: (type_identifier) @name) @definition.typedef
|
|
702
892
|
(union_specifier name: (type_identifier) @name) @definition.union
|
|
703
893
|
|
|
@@ -807,11 +997,18 @@ export const CPP_QUERIES = `
|
|
|
807
997
|
declarator: (init_declarator
|
|
808
998
|
declarator: (identifier) @name)) @definition.variable
|
|
809
999
|
|
|
810
|
-
;
|
|
811
|
-
(
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1000
|
+
; Structured bindings: auto [a, b] = makePair(); (one @name per bound identifier)
|
|
1001
|
+
(declaration
|
|
1002
|
+
declarator: (init_declarator
|
|
1003
|
+
declarator: (structured_binding_declarator
|
|
1004
|
+
(identifier) @name))) @definition.variable
|
|
1005
|
+
|
|
1006
|
+
; Structured bindings, reference form: auto& [x, y] = tup;
|
|
1007
|
+
(declaration
|
|
1008
|
+
declarator: (init_declarator
|
|
1009
|
+
declarator: (reference_declarator
|
|
1010
|
+
(structured_binding_declarator
|
|
1011
|
+
(identifier) @name)))) @definition.variable
|
|
815
1012
|
|
|
816
1013
|
; Write access: obj.field = value
|
|
817
1014
|
(assignment_expression
|
|
@@ -874,20 +1071,6 @@ export const CSHARP_QUERIES = `
|
|
|
874
1071
|
(variable_declarator
|
|
875
1072
|
(identifier) @name))) @definition.variable
|
|
876
1073
|
|
|
877
|
-
; Heritage
|
|
878
|
-
(class_declaration name: (identifier) @heritage.class
|
|
879
|
-
(base_list (identifier) @heritage.extends)) @heritage
|
|
880
|
-
(class_declaration name: (identifier) @heritage.class
|
|
881
|
-
(base_list (generic_name (identifier) @heritage.extends))) @heritage
|
|
882
|
-
|
|
883
|
-
; Interface inheritance: interface IFoo : IBar / interface IFoo : IBar, IBaz
|
|
884
|
-
; Without these patterns, interface-to-interface relationships are never
|
|
885
|
-
; captured, so transitive "class X implements IBar" chains are broken.
|
|
886
|
-
(interface_declaration name: (identifier) @heritage.class
|
|
887
|
-
(base_list (identifier) @heritage.extends)) @heritage
|
|
888
|
-
(interface_declaration name: (identifier) @heritage.class
|
|
889
|
-
(base_list (generic_name (identifier) @heritage.extends))) @heritage
|
|
890
|
-
|
|
891
1074
|
; Write access: obj.field = value
|
|
892
1075
|
(assignment_expression
|
|
893
1076
|
left: (member_access_expression
|
|
@@ -901,10 +1084,19 @@ export const RUST_QUERIES = `
|
|
|
901
1084
|
(function_item name: (identifier) @name) @definition.function
|
|
902
1085
|
(function_signature_item name: (identifier) @name) @definition.function
|
|
903
1086
|
(struct_item name: (type_identifier) @name) @definition.struct
|
|
1087
|
+
; A union is materialized as a Struct node (same rationale as the
|
|
1088
|
+
; scope-resolution @declaration.struct in languages/rust/query.ts: every
|
|
1089
|
+
; registry-primary resolution gate includes Struct but excludes Union, so a
|
|
1090
|
+
; Union-labeled node would be an unresolvable orphan). #1934 F71.
|
|
1091
|
+
(union_item name: (type_identifier) @name) @definition.struct
|
|
904
1092
|
(enum_item name: (type_identifier) @name) @definition.enum
|
|
905
1093
|
(trait_item name: (type_identifier) @name) @definition.trait
|
|
906
1094
|
(impl_item type: (type_identifier) @name !trait) @definition.impl
|
|
907
1095
|
(impl_item type: (generic_type type: (type_identifier) @name) !trait) @definition.impl
|
|
1096
|
+
; Scoped inherent impl: impl path::Type { ... }. Key the Impl node by the full
|
|
1097
|
+
; scoped_type_identifier text so it matches the owner id (also full text) and
|
|
1098
|
+
; stays distinct from a same-tail type in another module (#1975).
|
|
1099
|
+
(impl_item type: (scoped_type_identifier) @name !trait) @definition.impl
|
|
908
1100
|
(mod_item name: (identifier) @name) @definition.module
|
|
909
1101
|
|
|
910
1102
|
; Type aliases, const, static, macros
|
|
@@ -930,12 +1122,6 @@ export const RUST_QUERIES = `
|
|
|
930
1122
|
(field_declaration
|
|
931
1123
|
name: (field_identifier) @name) @definition.property)
|
|
932
1124
|
|
|
933
|
-
; Heritage (trait implementation) — all combinations of concrete/generic trait × concrete/generic type
|
|
934
|
-
(impl_item trait: (type_identifier) @heritage.trait type: (type_identifier) @heritage.class) @heritage
|
|
935
|
-
(impl_item trait: (generic_type type: (type_identifier) @heritage.trait) type: (type_identifier) @heritage.class) @heritage
|
|
936
|
-
(impl_item trait: (type_identifier) @heritage.trait type: (generic_type type: (type_identifier) @heritage.class)) @heritage
|
|
937
|
-
(impl_item trait: (generic_type type: (type_identifier) @heritage.trait) type: (generic_type type: (type_identifier) @heritage.class)) @heritage
|
|
938
|
-
|
|
939
1125
|
; Write access: obj.field = value
|
|
940
1126
|
(assignment_expression
|
|
941
1127
|
left: (field_expression
|
|
@@ -1024,35 +1210,6 @@ export const PHP_QUERIES = `
|
|
|
1024
1210
|
(const_element
|
|
1025
1211
|
(name) @name)) @definition.const
|
|
1026
1212
|
|
|
1027
|
-
; ── Heritage: extends ────────────────────────────────────────────────────────
|
|
1028
|
-
(class_declaration
|
|
1029
|
-
name: (name) @heritage.class
|
|
1030
|
-
(base_clause
|
|
1031
|
-
[(name) (qualified_name)] @heritage.extends)) @heritage
|
|
1032
|
-
|
|
1033
|
-
; ── Heritage: implements ─────────────────────────────────────────────────────
|
|
1034
|
-
(class_declaration
|
|
1035
|
-
name: (name) @heritage.class
|
|
1036
|
-
(class_interface_clause
|
|
1037
|
-
[(name) (qualified_name)] @heritage.implements)) @heritage.impl
|
|
1038
|
-
|
|
1039
|
-
; ── Heritage: use trait (must capture enclosing class name) ──────────────────
|
|
1040
|
-
(class_declaration
|
|
1041
|
-
name: (name) @heritage.class
|
|
1042
|
-
body: (declaration_list
|
|
1043
|
-
(use_declaration
|
|
1044
|
-
[(name) (qualified_name)] @heritage.trait))) @heritage
|
|
1045
|
-
|
|
1046
|
-
; ── Heritage: trait uses another trait (transitive trait composition) ────────
|
|
1047
|
-
; PHP allows a trait body to contain "use OtherTrait;". The trait-uses-trait
|
|
1048
|
-
; IMPLEMENTS edge is required by buildPhpMro to compute the full transitive
|
|
1049
|
-
; trait closure (depth 3+ chains).
|
|
1050
|
-
(trait_declaration
|
|
1051
|
-
name: (name) @heritage.class
|
|
1052
|
-
body: (declaration_list
|
|
1053
|
-
(use_declaration
|
|
1054
|
-
[(name) (qualified_name)] @heritage.trait))) @heritage
|
|
1055
|
-
|
|
1056
1213
|
; PHP HTTP consumers: file_get_contents('/path'), curl_init('/path')
|
|
1057
1214
|
(function_call_expression
|
|
1058
1215
|
function: (name) @_php_http (#match? @_php_http "^(file_get_contents|curl_init)$")
|
|
@@ -1085,10 +1242,21 @@ export const RUBY_QUERIES = `
|
|
|
1085
1242
|
(module
|
|
1086
1243
|
name: (constant) @name) @definition.module
|
|
1087
1244
|
|
|
1245
|
+
; Namespaced module: module Baz::Qux (name field is a scope_resolution node).
|
|
1246
|
+
; Separate top-level pattern (not a [...] alternation) so neither branch is
|
|
1247
|
+
; silently dropped — see #1975. The full scope_resolution text keys the node so
|
|
1248
|
+
; it matches the HAS_METHOD owner id derived from the same name field.
|
|
1249
|
+
(module
|
|
1250
|
+
name: (scope_resolution) @name) @definition.module
|
|
1251
|
+
|
|
1088
1252
|
; ── Classes ──────────────────────────────────────────────────────────────────
|
|
1089
1253
|
(class
|
|
1090
1254
|
name: (constant) @name) @definition.class
|
|
1091
1255
|
|
|
1256
|
+
; Namespaced class: class Foo::Bar (name field is a scope_resolution node).
|
|
1257
|
+
(class
|
|
1258
|
+
name: (scope_resolution) @name) @definition.class
|
|
1259
|
+
|
|
1092
1260
|
; ── Instance methods ─────────────────────────────────────────────────────────
|
|
1093
1261
|
(method
|
|
1094
1262
|
name: (identifier) @name) @definition.method
|
|
@@ -1115,12 +1283,6 @@ export const RUBY_QUERIES = `
|
|
|
1115
1283
|
(body_statement
|
|
1116
1284
|
(identifier) @call.name @call)
|
|
1117
1285
|
|
|
1118
|
-
; ── Heritage: class < SuperClass ─────────────────────────────────────────────
|
|
1119
|
-
(class
|
|
1120
|
-
name: (constant) @heritage.class
|
|
1121
|
-
superclass: (superclass
|
|
1122
|
-
(constant) @heritage.extends)) @heritage
|
|
1123
|
-
|
|
1124
1286
|
; Write access: obj.field = value (Ruby setter — syntactically a method call to field=)
|
|
1125
1287
|
(assignment
|
|
1126
1288
|
left: (call
|
|
@@ -1164,11 +1326,47 @@ export const KOTLIN_QUERIES = `
|
|
|
1164
1326
|
(function_declaration
|
|
1165
1327
|
(simple_identifier) @name) @definition.function
|
|
1166
1328
|
|
|
1329
|
+
; ── Secondary constructors (F49 sibling F48, issue #1919) ────────────────
|
|
1330
|
+
; "constructor(...) { }" inside a class body is a secondary_constructor with
|
|
1331
|
+
; no name child — its only identity token is the anonymous "constructor"
|
|
1332
|
+
; keyword, captured here as @name so the node is named "constructor"
|
|
1333
|
+
; (matching kotlinMethodConfig.extractName). Multiple secondary constructors
|
|
1334
|
+
; share that name but get distinct ids via the worker's #<arity> suffix.
|
|
1335
|
+
(secondary_constructor
|
|
1336
|
+
"constructor" @name) @definition.constructor
|
|
1337
|
+
|
|
1167
1338
|
; ── Properties ───────────────────────────────────────────────────────────
|
|
1168
1339
|
(property_declaration
|
|
1169
1340
|
(variable_declaration
|
|
1170
1341
|
(simple_identifier) @name)) @definition.property
|
|
1171
1342
|
|
|
1343
|
+
; ── Destructuring declarations (F51, issue #1919) ────────────────────────
|
|
1344
|
+
; "val (a, b) = pair" binds several names through a multi_variable_declaration
|
|
1345
|
+
; (NOT a variable_declaration), which the property rule above misses. Emit one
|
|
1346
|
+
; @definition.property per bound name — the SAME label every other Kotlin val/var
|
|
1347
|
+
; gets (KOTLIN_QUERIES has no @definition.variable rule, so a single "val x"
|
|
1348
|
+
; is already a Property; matching that keeps destructured names consistent and
|
|
1349
|
+
; out of the block-scope local-symbol pruner that drops Variable/Const/Static).
|
|
1350
|
+
; The Kotlin "_" discard placeholder is filtered out here via (#not-eq? @name "_")
|
|
1351
|
+
; — these locals have no enclosing class, so the field-extractor enrichment path
|
|
1352
|
+
; never runs and cannot do the filtering itself. Each rule is a standalone
|
|
1353
|
+
; pattern (NOT a top-level [...] alternation), so the predicate is safe under
|
|
1354
|
+
; tree-sitter 0.21.1 (no sibling-branch drop). Loop destructuring
|
|
1355
|
+
; "for ((k, v) in m)" nests the SAME multi_variable_declaration directly under the
|
|
1356
|
+
; for_statement (no property_declaration wrapper); the scope-path loop binding only
|
|
1357
|
+
; handles the single variable_declaration form, so this rule does not double-emit.
|
|
1358
|
+
((property_declaration
|
|
1359
|
+
(multi_variable_declaration
|
|
1360
|
+
(variable_declaration
|
|
1361
|
+
(simple_identifier) @name))) @definition.property
|
|
1362
|
+
(#not-eq? @name "_"))
|
|
1363
|
+
|
|
1364
|
+
((for_statement
|
|
1365
|
+
(multi_variable_declaration
|
|
1366
|
+
(variable_declaration
|
|
1367
|
+
(simple_identifier) @name))) @definition.property
|
|
1368
|
+
(#not-eq? @name "_"))
|
|
1369
|
+
|
|
1172
1370
|
; Primary constructor val/var parameters (data class, value class, regular class)
|
|
1173
1371
|
; binding_pattern_kind contains "val" or "var" — without it, the param is not a property
|
|
1174
1372
|
(class_parameter
|
|
@@ -1203,22 +1401,23 @@ export const KOTLIN_QUERIES = `
|
|
|
1203
1401
|
(type_identifier) @call.name)) @call
|
|
1204
1402
|
|
|
1205
1403
|
; ── Infix function calls (e.g., a to b, x until y) ──────────────────────
|
|
1404
|
+
; tree-sitter-kotlin models infix_expression as three UNNAMED-FIELD children:
|
|
1405
|
+
; (operand) (operator) (operand) — all three are simple_identifier for
|
|
1406
|
+
; "a to b". The old rule "(infix_expression (simple_identifier) @call.name)"
|
|
1407
|
+
; matched EVERY simple_identifier child, so it captured the operands a/b as
|
|
1408
|
+
; spurious @call.name calls (F49, issue #1919). There is no operator: field to
|
|
1409
|
+
; anchor on, so anchor positionally: the operator is the middle child, flanked
|
|
1410
|
+
; by an operand on each side. End-anchored on both sides so only the lone
|
|
1411
|
+
; middle simple_identifier (the infix function) is captured; chained
|
|
1412
|
+
; "a to b to c" still matches each nested infix_expression's own operator.
|
|
1206
1413
|
(infix_expression
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
(
|
|
1213
|
-
|
|
1214
|
-
(user_type (type_identifier) @heritage.extends))) @heritage
|
|
1215
|
-
|
|
1216
|
-
; Class extension (constructor_invocation): class Foo : Bar()
|
|
1217
|
-
(class_declaration
|
|
1218
|
-
(type_identifier) @heritage.class
|
|
1219
|
-
(delegation_specifier
|
|
1220
|
-
(constructor_invocation
|
|
1221
|
-
(user_type (type_identifier) @heritage.extends)))) @heritage
|
|
1414
|
+
.
|
|
1415
|
+
(_)
|
|
1416
|
+
.
|
|
1417
|
+
(simple_identifier) @call.name
|
|
1418
|
+
.
|
|
1419
|
+
(_)
|
|
1420
|
+
.) @call
|
|
1222
1421
|
|
|
1223
1422
|
; Write access: obj.field = value
|
|
1224
1423
|
(assignment
|
|
@@ -1264,6 +1463,13 @@ export const SWIFT_QUERIES = `
|
|
|
1264
1463
|
; Properties (stored and computed)
|
|
1265
1464
|
(property_declaration (pattern (simple_identifier) @name)) @definition.property
|
|
1266
1465
|
|
|
1466
|
+
; Protocol property requirements (F75): "var title: String { get }" parses to a
|
|
1467
|
+
; protocol_property_declaration (NOT property_declaration). Its name is a
|
|
1468
|
+
; "name:" pattern field wrapping a value_binding_pattern + the bound
|
|
1469
|
+
; simple_identifier; match the inner identifier so the requirement is emitted
|
|
1470
|
+
; as a property symbol of the protocol.
|
|
1471
|
+
(protocol_property_declaration (pattern (simple_identifier) @name)) @definition.property
|
|
1472
|
+
|
|
1267
1473
|
; Enum cases
|
|
1268
1474
|
(enum_entry (simple_identifier) @name) @definition.property
|
|
1269
1475
|
|
|
@@ -1276,19 +1482,6 @@ export const SWIFT_QUERIES = `
|
|
|
1276
1482
|
; Calls - member/navigation calls (obj.method())
|
|
1277
1483
|
(call_expression (navigation_expression (navigation_suffix (simple_identifier) @call.name))) @call
|
|
1278
1484
|
|
|
1279
|
-
; Heritage - class/struct/enum inheritance and protocol conformance
|
|
1280
|
-
(class_declaration name: (type_identifier) @heritage.class
|
|
1281
|
-
(inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage
|
|
1282
|
-
|
|
1283
|
-
; Heritage - protocol inheritance
|
|
1284
|
-
(protocol_declaration name: (type_identifier) @heritage.class
|
|
1285
|
-
(inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage
|
|
1286
|
-
|
|
1287
|
-
; Heritage - extension protocol conformance (e.g. extension Foo: SomeProtocol)
|
|
1288
|
-
; Extensions wrap the name in user_type unlike class/struct/enum declarations
|
|
1289
|
-
(class_declaration "extension" name: (user_type (type_identifier) @heritage.class)
|
|
1290
|
-
(inheritance_specifier inherits_from: (user_type (type_identifier) @heritage.extends))) @heritage
|
|
1291
|
-
|
|
1292
1485
|
; Write access: obj.field = value (tree-sitter-swift 0.7.1 uses named fields)
|
|
1293
1486
|
(assignment
|
|
1294
1487
|
target: (directly_assignable_expression
|
|
@@ -1322,12 +1515,36 @@ export const DART_QUERIES = `
|
|
|
1322
1515
|
(enum_declaration
|
|
1323
1516
|
name: (identifier) @name) @definition.enum
|
|
1324
1517
|
|
|
1325
|
-
; ── Type aliases
|
|
1326
|
-
; Anchor "=" after the name to avoid capturing the RHS type
|
|
1518
|
+
; ── Type aliases — new-style (typedef Pred = bool Function(int);) ────────────
|
|
1519
|
+
; Anchor "=" after the name to avoid capturing the RHS type. The name is the
|
|
1520
|
+
; first type_identifier (the alias), the RHS function_type follows the "=".
|
|
1327
1521
|
(type_alias
|
|
1328
1522
|
(type_identifier) @name
|
|
1329
1523
|
"=") @definition.type
|
|
1330
1524
|
|
|
1525
|
+
; ── Type aliases — old-style (typedef int Cmp(int a, int b);) ────────────────
|
|
1526
|
+
; The old-style function typedef has NO "=" — it parses as a type_alias whose
|
|
1527
|
+
; children are: return type_identifier, NAME type_identifier, formal_parameter_list.
|
|
1528
|
+
; Anchor @name as the type_identifier immediately before the parameter list so we
|
|
1529
|
+
; capture the alias name (Cmp), not the leading return type (int).
|
|
1530
|
+
(type_alias
|
|
1531
|
+
(type_identifier) @name
|
|
1532
|
+
.
|
|
1533
|
+
(formal_parameter_list)) @definition.type
|
|
1534
|
+
|
|
1535
|
+
; ── Type aliases — generic old-style (typedef int Cmp<T>(T a, T b);) ─────────
|
|
1536
|
+
; #1919 review CF2: a generic <T> inserts a type_parameters node between the
|
|
1537
|
+
; NAME and the parameter list, so the non-generic adjacency above misses it.
|
|
1538
|
+
; Standalone pattern (NOT an alternation arm) anchoring @name immediately before
|
|
1539
|
+
; type_parameters, which is immediately before the parameter list. The new-style
|
|
1540
|
+
; "=" rule above is unanchored and already covers generic new-style (Mapper<T>).
|
|
1541
|
+
(type_alias
|
|
1542
|
+
(type_identifier) @name
|
|
1543
|
+
.
|
|
1544
|
+
(type_parameters)
|
|
1545
|
+
.
|
|
1546
|
+
(formal_parameter_list)) @definition.type
|
|
1547
|
+
|
|
1331
1548
|
; ── Top-level functions (parent is program, not method_signature) ────────────
|
|
1332
1549
|
(program
|
|
1333
1550
|
(function_signature
|
|
@@ -1366,6 +1583,19 @@ export const DART_QUERIES = `
|
|
|
1366
1583
|
(initialized_identifier
|
|
1367
1584
|
(identifier) @name))) @definition.property
|
|
1368
1585
|
|
|
1586
|
+
; ── static const / static final / const class fields ────────────────────────
|
|
1587
|
+
; A "static const a = 1;" / "static final String b = ..., c = ...;" field parses
|
|
1588
|
+
; with a static_final_declaration_list (NOT an initialized_identifier_list), so
|
|
1589
|
+
; the field rules above miss them. One @name per static_final_declaration, so a
|
|
1590
|
+
; multi-name declaration yields a Property per name. Anchored on declaration (not
|
|
1591
|
+
; class_body) so top-level final/const variables — whose
|
|
1592
|
+
; static_final_declaration_list is a direct child of program, not wrapped in a
|
|
1593
|
+
; declaration — never match here.
|
|
1594
|
+
(declaration
|
|
1595
|
+
(static_final_declaration_list
|
|
1596
|
+
(static_final_declaration
|
|
1597
|
+
(identifier) @name))) @definition.property
|
|
1598
|
+
|
|
1369
1599
|
; ── Getters ──────────────────────────────────────────────────────────────────
|
|
1370
1600
|
(method_signature
|
|
1371
1601
|
(getter_signature
|
|
@@ -1376,11 +1606,22 @@ export const DART_QUERIES = `
|
|
|
1376
1606
|
(setter_signature
|
|
1377
1607
|
name: (identifier) @name)) @definition.property
|
|
1378
1608
|
|
|
1379
|
-
; ── Top-level variable declarations
|
|
1380
|
-
(
|
|
1609
|
+
; ── Top-level variable declarations ──────────────────────────────────────────
|
|
1610
|
+
; Top-level Dart variables are NOT wrapped in a declaration node (that wrapper
|
|
1611
|
+
; only occurs for class-body members). They sit as loose siblings under program:
|
|
1612
|
+
; var name = 'x'; int x = 5; → initialized_identifier_list
|
|
1613
|
+
; final int count = 3; const a = 1, b = 2; → static_final_declaration_list
|
|
1614
|
+
; Anchor both rules under (program) so class-body fields (which reuse the same
|
|
1615
|
+
; inner node types) are never matched here. One @name per declared name so
|
|
1616
|
+
; multi-name forms (const a = 1, b = 2;) yield a Variable per name.
|
|
1617
|
+
(program
|
|
1381
1618
|
(initialized_identifier_list
|
|
1382
1619
|
(initialized_identifier
|
|
1383
|
-
(identifier) @name))
|
|
1620
|
+
(identifier) @name)) @definition.variable)
|
|
1621
|
+
(program
|
|
1622
|
+
(static_final_declaration_list
|
|
1623
|
+
(static_final_declaration
|
|
1624
|
+
(identifier) @name)) @definition.variable)
|
|
1384
1625
|
|
|
1385
1626
|
; ── Imports ──────────────────────────────────────────────────────────────────
|
|
1386
1627
|
(import_or_export
|
|
@@ -1489,25 +1730,6 @@ export const DART_QUERIES = `
|
|
|
1489
1730
|
(unconditional_assignable_selector
|
|
1490
1731
|
(identifier) @assignment.property))
|
|
1491
1732
|
right: (_)) @assignment
|
|
1492
|
-
|
|
1493
|
-
; ── Heritage: extends ────────────────────────────────────────────────────────
|
|
1494
|
-
(class_definition
|
|
1495
|
-
name: (identifier) @heritage.class
|
|
1496
|
-
superclass: (superclass
|
|
1497
|
-
(type_identifier) @heritage.extends)) @heritage
|
|
1498
|
-
|
|
1499
|
-
; ── Heritage: implements ─────────────────────────────────────────────────────
|
|
1500
|
-
(class_definition
|
|
1501
|
-
name: (identifier) @heritage.class
|
|
1502
|
-
interfaces: (interfaces
|
|
1503
|
-
(type_identifier) @heritage.implements)) @heritage.impl
|
|
1504
|
-
|
|
1505
|
-
; ── Heritage: with (mixins) ──────────────────────────────────────────────────
|
|
1506
|
-
(class_definition
|
|
1507
|
-
name: (identifier) @heritage.class
|
|
1508
|
-
superclass: (superclass
|
|
1509
|
-
(mixins
|
|
1510
|
-
(type_identifier) @heritage.trait))) @heritage
|
|
1511
1733
|
`;
|
|
1512
1734
|
import { SupportedLanguages } from '../../_shared/index.js';
|
|
1513
1735
|
export const LANGUAGE_QUERIES = {
|