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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Phase: parse
|
|
3
3
|
*
|
|
4
4
|
* Chunked parse + resolve loop: reads source in byte-budget chunks,
|
|
5
|
-
* parses via worker pool (
|
|
6
|
-
* heritage, and calls, synthesizes wildcard bindings.
|
|
5
|
+
* parses via the worker pool (the sole parse path — no sequential fallback),
|
|
6
|
+
* resolves imports, heritage, and calls, synthesizes wildcard bindings.
|
|
7
7
|
*
|
|
8
8
|
* This phase encapsulates the entire `runChunkedParseAndResolve` function
|
|
9
9
|
* from the original pipeline. The chunk loop is a memory optimization
|
|
@@ -19,14 +19,14 @@ import type { PipelinePhase } from './types.js';
|
|
|
19
19
|
import type { BindingAccumulator } from '../binding-accumulator.js';
|
|
20
20
|
import type { ParsedFile } from '../../../_shared/index.js';
|
|
21
21
|
import type { ExtractedFetchCall, ExtractedRoute, ExtractedDecoratorRoute, ExtractedToolDef, ExtractedORMQuery, FetchWrapperDef } from '../workers/parse-worker.js';
|
|
22
|
-
import type {
|
|
23
|
-
import type { ASTCache } from '../ast-cache.js';
|
|
22
|
+
import type { MutableSemanticModel } from '../model/index.js';
|
|
24
23
|
export interface ParseOutput {
|
|
25
24
|
/**
|
|
26
25
|
* Read-only snapshot of exported type bindings keyed by file path.
|
|
27
26
|
*
|
|
28
|
-
* Fully populated by `parse`
|
|
29
|
-
*
|
|
27
|
+
* Fully populated by `parse` on the main thread after the worker parse:
|
|
28
|
+
* `enrichExportedTypeMap` propagates fixpoint-inferred TypeEnv bindings and
|
|
29
|
+
* `buildExportedTypeMapFromGraph` reconstructs from graph nodes.
|
|
30
30
|
* Downstream phases — including `crossFile` — receive it as a true
|
|
31
31
|
* `ReadonlyMap`; `crossFile` builds its own mutable working copy locally
|
|
32
32
|
* for per-file re-resolution writes, so this snapshot is never mutated
|
|
@@ -40,8 +40,9 @@ export interface ParseOutput {
|
|
|
40
40
|
readonly allToolDefs: readonly ExtractedToolDef[];
|
|
41
41
|
readonly allORMQueries: readonly ExtractedORMQuery[];
|
|
42
42
|
bindingAccumulator: BindingAccumulator;
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/** SemanticModel populated during parse — scope-resolution reads its
|
|
44
|
+
* TypeRegistry / MethodRegistry / SymbolTable indexes. */
|
|
45
|
+
model: MutableSemanticModel;
|
|
45
46
|
/** Pass-through: all file paths for downstream phases. */
|
|
46
47
|
readonly allPaths: readonly string[];
|
|
47
48
|
/** Pass-through: shared `allPathSet` from structure (built once, not per-phase). */
|
|
@@ -49,29 +50,12 @@ export interface ParseOutput {
|
|
|
49
50
|
/** Pass-through: total file count for progress reporting. */
|
|
50
51
|
totalFiles: number;
|
|
51
52
|
/**
|
|
52
|
-
* True if the parse phase
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* True if the parse phase constructed a worker pool for this run. False
|
|
54
|
+
* means no pool was needed — a warm all-cache-hit run replays cached worker
|
|
55
|
+
* output without spawning workers, or there were no parseable files. There
|
|
56
|
+
* is no sequential parser; the pool is the sole parse path on a cache miss.
|
|
56
57
|
*/
|
|
57
58
|
readonly usedWorkerPool: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Cross-phase tree-sitter Tree cache populated by the sequential
|
|
60
|
-
* parse path. Separate from the chunk-local `astCache` used *inside*
|
|
61
|
-
* the parse phase (which is cleared between chunks) — this one
|
|
62
|
-
* survives the whole phase and hands Trees to scope-resolution so
|
|
63
|
-
* it can skip a second parse.
|
|
64
|
-
*
|
|
65
|
-
* Empty entries for files that ran through the worker pool
|
|
66
|
-
* (workers can't return native tree-sitter Trees across the
|
|
67
|
-
* MessageChannel). Cache miss is safe — consumers fall back to a
|
|
68
|
-
* fresh parse. See plan
|
|
69
|
-
* docs/plans/2026-04-20-002-perf-parse-heritage-mro-plan.md (Unit 4).
|
|
70
|
-
*
|
|
71
|
-
* Disposed by `scopeResolutionPhase` (the sole consumer) via
|
|
72
|
-
* `scopeTreeCache.clear()` after its extract loop finishes.
|
|
73
|
-
*/
|
|
74
|
-
readonly scopeTreeCache: ASTCache;
|
|
75
59
|
/**
|
|
76
60
|
* Per-file `ParsedFile` artifacts produced by workers' calls to
|
|
77
61
|
* `extractParsedFile`. Threaded through to `scopeResolutionPhase`
|
|
@@ -79,10 +63,6 @@ export interface ParseOutput {
|
|
|
79
63
|
* scope-resolution can skip its own `extractParsedFile` (which would
|
|
80
64
|
* otherwise re-parse the file with tree-sitter on the main thread,
|
|
81
65
|
* costing ~58s on a 1000-file repo).
|
|
82
|
-
*
|
|
83
|
-
* Empty for files that went through the sequential parse fallback —
|
|
84
|
-
* sequential doesn't emit ParsedFile artifacts; scope-resolution
|
|
85
|
-
* falls back to a fresh extract for those.
|
|
86
66
|
*/
|
|
87
67
|
readonly parsedFiles: readonly ParsedFile[];
|
|
88
68
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Phase: parse
|
|
3
3
|
*
|
|
4
4
|
* Chunked parse + resolve loop: reads source in byte-budget chunks,
|
|
5
|
-
* parses via worker pool (
|
|
6
|
-
* heritage, and calls, synthesizes wildcard bindings.
|
|
5
|
+
* parses via the worker pool (the sole parse path — no sequential fallback),
|
|
6
|
+
* resolves imports, heritage, and calls, synthesizes wildcard bindings.
|
|
7
7
|
*
|
|
8
8
|
* This phase encapsulates the entire `runChunkedParseAndResolve` function
|
|
9
9
|
* from the original pipeline. The chunk loop is a memory optimization
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Detects execution flows (processes) and creates Process nodes +
|
|
5
5
|
* STEP_IN_PROCESS edges. Also links Route/Tool nodes to processes.
|
|
6
6
|
*
|
|
7
|
-
* @deps communities, routes, tools
|
|
7
|
+
* @deps communities, routes, tools, pruneLocalSymbols
|
|
8
8
|
* @reads graph (all nodes and relationships), communityResult, routeRegistry, toolDefs
|
|
9
9
|
* @writes graph (Process nodes, STEP_IN_PROCESS edges, ENTRY_POINT_OF edges)
|
|
10
10
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Detects execution flows (processes) and creates Process nodes +
|
|
5
5
|
* STEP_IN_PROCESS edges. Also links Route/Tool nodes to processes.
|
|
6
6
|
*
|
|
7
|
-
* @deps communities, routes, tools
|
|
7
|
+
* @deps communities, routes, tools, pruneLocalSymbols
|
|
8
8
|
* @reads graph (all nodes and relationships), communityResult, routeRegistry, toolDefs
|
|
9
9
|
* @writes graph (Process nodes, STEP_IN_PROCESS edges, ENTRY_POINT_OF edges)
|
|
10
10
|
*/
|
|
@@ -16,8 +16,10 @@ import { logger } from '../../logger.js';
|
|
|
16
16
|
export const processesPhase = {
|
|
17
17
|
name: 'processes',
|
|
18
18
|
// `structure` supplies `totalFiles` (progress counter) without the spurious
|
|
19
|
-
// structural data dependency on `parse`.
|
|
20
|
-
|
|
19
|
+
// structural data dependency on `parse`. `pruneLocalSymbols` is declared
|
|
20
|
+
// explicitly so process extraction always reads the trimmed graph even if a
|
|
21
|
+
// future option drops the intervening `mro`/`communities` phases.
|
|
22
|
+
deps: ['communities', 'routes', 'tools', 'pruneLocalSymbols', 'structure'],
|
|
21
23
|
async execute(ctx, deps) {
|
|
22
24
|
const { totalFiles } = getPhaseOutput(deps, 'structure');
|
|
23
25
|
const { communityResult } = getPhaseOutput(deps, 'communities');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase: pruneLocalSymbols
|
|
3
|
+
*
|
|
4
|
+
* Drops inert function/block-local value symbols after scope resolution has
|
|
5
|
+
* already used them for binding and call resolution.
|
|
6
|
+
*
|
|
7
|
+
* @deps scopeResolution
|
|
8
|
+
* @reads graph (nodes and relationships)
|
|
9
|
+
* @writes graph (removes unreferenced local Const/Variable/Static nodes)
|
|
10
|
+
*/
|
|
11
|
+
import type { PipelinePhase } from './types.js';
|
|
12
|
+
import { type LocalSymbolPruneStats } from '../local-symbol-pruner.js';
|
|
13
|
+
export type PruneLocalSymbolsOutput = LocalSymbolPruneStats;
|
|
14
|
+
export declare const pruneLocalSymbolsPhase: PipelinePhase<PruneLocalSymbolsOutput>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase: pruneLocalSymbols
|
|
3
|
+
*
|
|
4
|
+
* Drops inert function/block-local value symbols after scope resolution has
|
|
5
|
+
* already used them for binding and call resolution.
|
|
6
|
+
*
|
|
7
|
+
* @deps scopeResolution
|
|
8
|
+
* @reads graph (nodes and relationships)
|
|
9
|
+
* @writes graph (removes unreferenced local Const/Variable/Static nodes)
|
|
10
|
+
*/
|
|
11
|
+
import { pruneLocalValueSymbols } from '../local-symbol-pruner.js';
|
|
12
|
+
import { isDev } from '../utils/env.js';
|
|
13
|
+
import { logger } from '../../logger.js';
|
|
14
|
+
export const pruneLocalSymbolsPhase = {
|
|
15
|
+
name: 'pruneLocalSymbols',
|
|
16
|
+
deps: ['scopeResolution'],
|
|
17
|
+
async execute(ctx) {
|
|
18
|
+
const stats = pruneLocalValueSymbols(ctx.graph, {
|
|
19
|
+
keepLocalValueSymbols: ctx.options?.keepLocalValueSymbols,
|
|
20
|
+
});
|
|
21
|
+
if (isDev && !stats.skippedByEnv && stats.prunedNodes > 0) {
|
|
22
|
+
logger.info(`Pruned ${stats.prunedNodes}/${stats.candidateNodes} inert local value symbols`);
|
|
23
|
+
}
|
|
24
|
+
return stats;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -17,29 +17,29 @@
|
|
|
17
17
|
import { type PipelineProgress } from '../../_shared/index.js';
|
|
18
18
|
import { PipelineResult } from '../../types/pipeline.js';
|
|
19
19
|
export interface PipelineOptions {
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Skip MRO, community detection, and process extraction for faster test runs.
|
|
22
|
+
* The `pruneLocalSymbols` phase still runs — it is graph construction (it cleans
|
|
23
|
+
* up inert local symbols), not graph analysis — so set `keepLocalValueSymbols`
|
|
24
|
+
* to retain those nodes under `skipGraphPhases`.
|
|
25
|
+
*/
|
|
21
26
|
skipGraphPhases?: boolean;
|
|
22
|
-
/** Force sequential parsing (no worker pool). Useful for testing the sequential path. */
|
|
23
|
-
skipWorkers?: boolean;
|
|
24
27
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* Request parsing with the worker pool disabled. The sequential parser was
|
|
29
|
+
* removed — the worker pool is the sole parse path — so setting this now
|
|
30
|
+
* makes the parse phase throw a `WorkerPoolDisabledError` (equivalent to
|
|
31
|
+
* `--workers 0`). Retained so callers get an actionable error rather than a
|
|
32
|
+
* silently-different result.
|
|
30
33
|
*/
|
|
31
|
-
|
|
32
|
-
minFiles?: number;
|
|
33
|
-
minBytes?: number;
|
|
34
|
-
};
|
|
34
|
+
skipWorkers?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
* @internal Test-only override for the worker script URL the pool
|
|
37
37
|
* spawns. When unset, parse-impl resolves `parse-worker.js` from the
|
|
38
38
|
* adjacent `workers/` directory (or the compiled `dist/` fallback
|
|
39
39
|
* under vitest). Integration tests use this to inject a custom
|
|
40
40
|
* worker script that deterministically triggers worker-pool
|
|
41
|
-
* resilience paths (e.g., crash-on-poison-file)
|
|
42
|
-
*
|
|
41
|
+
* resilience paths (e.g., crash-on-poison-file). Do not use from production
|
|
42
|
+
* call sites.
|
|
43
43
|
*/
|
|
44
44
|
workerUrlForTest?: URL;
|
|
45
45
|
/**
|
|
@@ -61,11 +61,11 @@ export interface PipelineOptions {
|
|
|
61
61
|
* `createWorkerPool` so the pool sizing bypasses the env-var fallback
|
|
62
62
|
* in `resolveAutoPoolSize`. The env-var channel
|
|
63
63
|
* (`GITNEXUS_WORKER_POOL_SIZE`) remains as a back-compat fallback when
|
|
64
|
-
* this field is undefined.
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
64
|
+
* this field is undefined. Must be a positive integer — `0` hard-errors
|
|
65
|
+
* (sequential parsing was removed; equivalent to `skipWorkers`), expressed
|
|
66
|
+
* in the same units as `--workers <N>` so long-running hosts (eval-server,
|
|
67
|
+
* MCP daemon) can size per-call without leaking `process.env` state across
|
|
68
|
+
* analyze invocations.
|
|
69
69
|
*/
|
|
70
70
|
workerPoolSize?: number;
|
|
71
71
|
/**
|
|
@@ -95,5 +95,13 @@ export interface PipelineOptions {
|
|
|
95
95
|
* without leaking `process.env` state across invocations.
|
|
96
96
|
*/
|
|
97
97
|
chunkByteBudget?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Keep inert block-local value symbols (Const/Variable/Static) that the
|
|
100
|
+
* `pruneLocalSymbols` phase would otherwise drop. Mirrors the
|
|
101
|
+
* `GITNEXUS_KEEP_LOCAL_VALUE_SYMBOLS` env var, but threaded per-call so
|
|
102
|
+
* long-running hosts (eval-server, MCP daemon) can opt out without leaking
|
|
103
|
+
* `process.env` state across invocations. When undefined, the env var decides.
|
|
104
|
+
*/
|
|
105
|
+
keepLocalValueSymbols?: boolean;
|
|
98
106
|
}
|
|
99
107
|
export declare const runPipelineFromRepo: (repoPath: string, onProgress: (progress: PipelineProgress) => void, options?: PipelineOptions) => Promise<PipelineResult>;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See ARCHITECTURE.md for the full phase dependency diagram.
|
|
16
16
|
*/
|
|
17
17
|
import { createKnowledgeGraph } from '../graph/graph.js';
|
|
18
|
-
import { runPipeline, getPhaseOutput, scanPhase, structurePhase, markdownPhase, cobolPhase, parsePhase, routesPhase, toolsPhase, ormPhase, crossFilePhase, scopeResolutionPhase, mroPhase, communitiesPhase, processesPhase, } from './pipeline-phases/index.js';
|
|
18
|
+
import { runPipeline, getPhaseOutput, scanPhase, structurePhase, markdownPhase, cobolPhase, parsePhase, routesPhase, toolsPhase, ormPhase, crossFilePhase, scopeResolutionPhase, pruneLocalSymbolsPhase, mroPhase, communitiesPhase, processesPhase, } from './pipeline-phases/index.js';
|
|
19
19
|
// ── Phase registry ─────────────────────────────────────────────────────────
|
|
20
20
|
/**
|
|
21
21
|
* All pipeline phases with their dependency relationships.
|
|
@@ -23,7 +23,8 @@ import { runPipeline, getPhaseOutput, scanPhase, structurePhase, markdownPhase,
|
|
|
23
23
|
* Phase dependency graph:
|
|
24
24
|
*
|
|
25
25
|
* scan → structure → [markdown, cobol] → parse → [routes, tools, orm]
|
|
26
|
-
* → crossFile →
|
|
26
|
+
* → crossFile → scopeResolution → pruneLocalSymbols
|
|
27
|
+
* → mro → communities → processes
|
|
27
28
|
*
|
|
28
29
|
* To add a new phase: create a file in pipeline-phases/, export the phase
|
|
29
30
|
* object, and add it to the appropriate position in this array.
|
|
@@ -40,6 +41,7 @@ function buildPhaseList(options) {
|
|
|
40
41
|
ormPhase,
|
|
41
42
|
crossFilePhase,
|
|
42
43
|
scopeResolutionPhase,
|
|
44
|
+
pruneLocalSymbolsPhase,
|
|
43
45
|
];
|
|
44
46
|
if (!options?.skipGraphPhases) {
|
|
45
47
|
phases.push(mroPhase, communitiesPhase, processesPhase);
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* resolution but not emitted as multiple edges; callers that want
|
|
38
38
|
* branch-on-ambiguity behavior should consume the registries directly.
|
|
39
39
|
*/
|
|
40
|
-
import { buildClassRegistry, buildFieldRegistry, buildMethodRegistry, CLASS_KINDS, FIELD_KINDS, METHOD_KINDS, } from '../../_shared/index.js';
|
|
40
|
+
import { buildClassRegistry, buildFieldRegistry, buildMacroRegistry, buildMethodRegistry, CLASS_KINDS, FIELD_KINDS, METHOD_KINDS, } from '../../_shared/index.js';
|
|
41
41
|
/**
|
|
42
42
|
* Resolve every `ReferenceSite` in `scopes.referenceSites` against the
|
|
43
43
|
* matching registry and produce a `ReferenceIndex` keyed by source scope
|
|
@@ -58,6 +58,7 @@ export function resolveReferenceSites(input) {
|
|
|
58
58
|
const classRegistry = buildClassRegistry(ctx);
|
|
59
59
|
const methodRegistry = buildMethodRegistry(ctx);
|
|
60
60
|
const fieldRegistry = buildFieldRegistry(ctx);
|
|
61
|
+
const macroRegistry = buildMacroRegistry(ctx);
|
|
61
62
|
// bySourceScope is the canonical index; byTargetDef is derived from it.
|
|
62
63
|
const bySourceScope = new Map();
|
|
63
64
|
const byTargetDef = new Map();
|
|
@@ -66,7 +67,7 @@ export function resolveReferenceSites(input) {
|
|
|
66
67
|
let unresolved = 0;
|
|
67
68
|
for (const site of scopes.referenceSites) {
|
|
68
69
|
sitesProcessed++;
|
|
69
|
-
const resolutions = lookupForSite(site, classRegistry, methodRegistry, fieldRegistry);
|
|
70
|
+
const resolutions = lookupForSite(site, classRegistry, methodRegistry, fieldRegistry, macroRegistry);
|
|
70
71
|
if (resolutions.length === 0) {
|
|
71
72
|
unresolved++;
|
|
72
73
|
continue;
|
|
@@ -112,6 +113,12 @@ export function resolveReferenceSites(input) {
|
|
|
112
113
|
* | `type-reference` | ClassRegistry | CLASS_KINDS |
|
|
113
114
|
* | `read`/`write` | FieldRegistry | FIELD_KINDS |
|
|
114
115
|
* | `import-use` | tiered fallback | METHOD ∪ CLASS ∪ FIELD |
|
|
116
|
+
* | `macro` | MacroRegistry | MACRO_KINDS (`Macro` only) |
|
|
117
|
+
*
|
|
118
|
+
* `macro` has its own single-kind registry so a macro invocation
|
|
119
|
+
* (`log!(…)`) resolves ONLY to a `macro_rules! log` definition and never
|
|
120
|
+
* to a same-named free function — macros and functions are disjoint
|
|
121
|
+
* namespaces (the false-`CALLS`-edge class flagged in the #1934 review).
|
|
115
122
|
*
|
|
116
123
|
* `import-use` doesn't have a single registry — the imported name might
|
|
117
124
|
* be a class, a function, or a constant. Try each in priority order and
|
|
@@ -119,7 +126,7 @@ export function resolveReferenceSites(input) {
|
|
|
119
126
|
* scope's `bindings` (Step 1 lexical hit), so the lookup is correct
|
|
120
127
|
* regardless of which registry surfaces the def.
|
|
121
128
|
*/
|
|
122
|
-
function lookupForSite(site, classRegistry, methodRegistry, fieldRegistry) {
|
|
129
|
+
function lookupForSite(site, classRegistry, methodRegistry, fieldRegistry, macroRegistry) {
|
|
123
130
|
switch (site.kind) {
|
|
124
131
|
case 'call': {
|
|
125
132
|
const opts = {
|
|
@@ -159,6 +166,11 @@ function lookupForSite(site, classRegistry, methodRegistry, fieldRegistry) {
|
|
|
159
166
|
return methodHits;
|
|
160
167
|
return fieldRegistry.lookup(site.name, site.inScope);
|
|
161
168
|
}
|
|
169
|
+
case 'macro': {
|
|
170
|
+
// Macro-only namespace: resolves against `Macro`-labeled defs, never
|
|
171
|
+
// functions. No receiver, no arity — see `MacroRegistry`.
|
|
172
|
+
return macroRegistry.lookup(site.name, site.inScope);
|
|
173
|
+
}
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
/** Compose a `Reference` record from a site + its top resolution. */
|
|
@@ -5,6 +5,16 @@ export interface ExtractedRoute {
|
|
|
5
5
|
routePath: string | null;
|
|
6
6
|
routeName: string | null;
|
|
7
7
|
controllerName: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* The controller class's normalized (dot-joined) fully-qualified name when
|
|
10
|
+
* the routes file disambiguates it — via a `use` import (`use App\…\X;` or
|
|
11
|
+
* `use App\…\X as Y;`) or an inline qualified `::class` reference. Resolved
|
|
12
|
+
* to the same key shape the type registry stores (`normalizeQualifiedName`),
|
|
13
|
+
* so the emitter can `lookupClassByQualifiedName` to disambiguate
|
|
14
|
+
* same-short-name controllers. `null`/undefined when only a bare short name
|
|
15
|
+
* is available — the emitter then falls back to short-name resolution.
|
|
16
|
+
*/
|
|
17
|
+
controllerQualifiedName?: string | null;
|
|
8
18
|
methodName: string | null;
|
|
9
19
|
middleware: string[];
|
|
10
20
|
prefix: string | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { extractStringContent, findDescendant } from '../utils/ast-helpers.js';
|
|
2
|
+
import { splitNamespaceUseDeclaration } from '../languages/php/import-decomposer.js';
|
|
3
|
+
import { normalizeQualifiedName } from '../utils/qualified-name.js';
|
|
2
4
|
const ROUTE_HTTP_METHODS = new Set([
|
|
3
5
|
'get',
|
|
4
6
|
'post',
|
|
@@ -120,10 +122,26 @@ function appendResourceActionName(base, action) {
|
|
|
120
122
|
return null;
|
|
121
123
|
return base.endsWith('.') ? `${base}${action}` : `${base}.${action}`;
|
|
122
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Read the controller class reference out of a `class_constant_access_expression`
|
|
127
|
+
* (the `X::class` node). Returns the simple short name (for short-name fallback)
|
|
128
|
+
* and, when the reference is itself namespace-qualified (`\App\Admin\X::class`),
|
|
129
|
+
* its normalized dot-joined fully-qualified name (for direct disambiguation).
|
|
130
|
+
*/
|
|
131
|
+
function readControllerClassRef(classAccess) {
|
|
132
|
+
const nameChild = classAccess.children?.find((c) => c.type === 'name');
|
|
133
|
+
const qualifiedChild = classAccess.children?.find((c) => c.type === 'qualified_name');
|
|
134
|
+
const qualified = qualifiedChild ? normalizeQualifiedName(qualifiedChild.text) : null;
|
|
135
|
+
// When only a qualified_name is present, derive the simple short name from
|
|
136
|
+
// its last segment so short-name fallback still works.
|
|
137
|
+
const simple = nameChild?.text ?? (qualified ? (qualified.split('.').pop() ?? null) : null);
|
|
138
|
+
return { simple, qualified };
|
|
139
|
+
}
|
|
123
140
|
/** Extract controller class name from common Laravel handler argument shapes. */
|
|
124
141
|
function extractControllerTarget(argsNode) {
|
|
142
|
+
const none = { controller: null, controllerQualified: null, method: null, bareMethod: null };
|
|
125
143
|
if (!argsNode)
|
|
126
|
-
return
|
|
144
|
+
return none;
|
|
127
145
|
const args = [];
|
|
128
146
|
for (const child of argsNode.children ?? []) {
|
|
129
147
|
if (child.type === 'argument')
|
|
@@ -134,10 +152,11 @@ function extractControllerTarget(argsNode) {
|
|
|
134
152
|
// Second arg is the handler
|
|
135
153
|
const handlerNode = args[1];
|
|
136
154
|
if (!handlerNode)
|
|
137
|
-
return
|
|
155
|
+
return none;
|
|
138
156
|
// Array syntax: [UserController::class, 'index']
|
|
139
157
|
if (handlerNode.type === 'array_creation_expression') {
|
|
140
158
|
let controller = null;
|
|
159
|
+
let controllerQualified = null;
|
|
141
160
|
let method = null;
|
|
142
161
|
const elements = [];
|
|
143
162
|
for (const el of handlerNode.children ?? []) {
|
|
@@ -147,14 +166,16 @@ function extractControllerTarget(argsNode) {
|
|
|
147
166
|
if (elements[0]) {
|
|
148
167
|
const classAccess = findDescendant(elements[0], 'class_constant_access_expression');
|
|
149
168
|
if (classAccess) {
|
|
150
|
-
|
|
169
|
+
const ref = readControllerClassRef(classAccess);
|
|
170
|
+
controller = ref.simple;
|
|
171
|
+
controllerQualified = ref.qualified;
|
|
151
172
|
}
|
|
152
173
|
}
|
|
153
174
|
if (elements[1]) {
|
|
154
175
|
const str = findDescendant(elements[1], 'string');
|
|
155
176
|
method = str ? extractStringContent(str) : null;
|
|
156
177
|
}
|
|
157
|
-
return { controller, method, bareMethod: null };
|
|
178
|
+
return { controller, controllerQualified, method, bareMethod: null };
|
|
158
179
|
}
|
|
159
180
|
// String syntax: 'UserController@index'. A bare string such as 'index'
|
|
160
181
|
// becomes a method only when a surrounding Route::controller(...) group
|
|
@@ -163,17 +184,22 @@ function extractControllerTarget(argsNode) {
|
|
|
163
184
|
const text = extractStringContent(handlerNode);
|
|
164
185
|
if (text?.includes('@')) {
|
|
165
186
|
const [controller, method] = text.split('@');
|
|
166
|
-
return { controller, method, bareMethod: null };
|
|
187
|
+
return { controller, controllerQualified: null, method, bareMethod: null };
|
|
167
188
|
}
|
|
168
189
|
if (text)
|
|
169
|
-
return { controller: null, method: null, bareMethod: text };
|
|
190
|
+
return { controller: null, controllerQualified: null, method: null, bareMethod: text };
|
|
170
191
|
}
|
|
171
192
|
// Class reference: UserController::class (invokable controller)
|
|
172
193
|
if (handlerNode.type === 'class_constant_access_expression') {
|
|
173
|
-
const
|
|
174
|
-
return {
|
|
194
|
+
const ref = readControllerClassRef(handlerNode);
|
|
195
|
+
return {
|
|
196
|
+
controller: ref.simple,
|
|
197
|
+
controllerQualified: ref.qualified,
|
|
198
|
+
method: '__invoke',
|
|
199
|
+
bareMethod: null,
|
|
200
|
+
};
|
|
175
201
|
}
|
|
176
|
-
return { controller: null, method: null, bareMethod: null };
|
|
202
|
+
return { controller: null, controllerQualified: null, method: null, bareMethod: null };
|
|
177
203
|
}
|
|
178
204
|
/**
|
|
179
205
|
* Unwrap a chained call like Route::middleware('auth')->prefix('api')->group(fn)
|
|
@@ -266,8 +292,59 @@ function parseArrayGroupArgs(argsNode) {
|
|
|
266
292
|
}
|
|
267
293
|
return ctx;
|
|
268
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* Build the routes file's `use`-import alias map: local name (alias, else the
|
|
297
|
+
* imported short name) → the class's normalized dot-joined fully-qualified name.
|
|
298
|
+
* Reuses the PHP `use`-declaration decomposer so grouped (`use Foo\{A, B}`) and
|
|
299
|
+
* aliased (`use Foo\Bar as Baz;`) forms are handled across grammar versions.
|
|
300
|
+
* `use` statements are file-/namespace-scoped, so a shallow walk over the
|
|
301
|
+
* routes file's structural nodes finds them all.
|
|
302
|
+
*/
|
|
303
|
+
function buildUseAliasMap(root) {
|
|
304
|
+
const aliasMap = new Map();
|
|
305
|
+
const stack = [root];
|
|
306
|
+
while (stack.length > 0) {
|
|
307
|
+
const node = stack.pop();
|
|
308
|
+
if (node.type === 'namespace_use_declaration') {
|
|
309
|
+
for (const match of splitNamespaceUseDeclaration(node)) {
|
|
310
|
+
const source = match['@import.source']?.text;
|
|
311
|
+
if (source === undefined)
|
|
312
|
+
continue;
|
|
313
|
+
const local = match['@import.alias']?.text ?? match['@import.name']?.text;
|
|
314
|
+
if (local === undefined || local === '')
|
|
315
|
+
continue;
|
|
316
|
+
aliasMap.set(local, normalizeQualifiedName(source));
|
|
317
|
+
}
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
// Only descend through file/namespace structure where `use` can appear —
|
|
321
|
+
// not into function bodies or expressions.
|
|
322
|
+
if (node.type === 'program' ||
|
|
323
|
+
node.type === 'namespace_definition' ||
|
|
324
|
+
node.type === 'declaration_list' ||
|
|
325
|
+
node.type === 'compound_statement') {
|
|
326
|
+
for (const child of node.namedChildren ?? [])
|
|
327
|
+
stack.push(child);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return aliasMap;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Resolve a route's controller to its normalized fully-qualified name when the
|
|
334
|
+
* routes file disambiguates it: an inline qualified `::class` wins, else the
|
|
335
|
+
* `use`-import alias map for the short/local name, else `null` (the emitter
|
|
336
|
+
* falls back to short-name resolution).
|
|
337
|
+
*/
|
|
338
|
+
function resolveControllerQualifiedName(inlineQualified, controllerName, aliasMap) {
|
|
339
|
+
if (inlineQualified)
|
|
340
|
+
return inlineQualified;
|
|
341
|
+
if (controllerName)
|
|
342
|
+
return aliasMap.get(controllerName) ?? null;
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
269
345
|
export function extractLaravelRoutes(tree, filePath) {
|
|
270
346
|
const routes = [];
|
|
347
|
+
const useAliasMap = buildUseAliasMap(tree.rootNode);
|
|
271
348
|
function resolveStack(stack) {
|
|
272
349
|
const middleware = [];
|
|
273
350
|
let prefix = null;
|
|
@@ -316,6 +393,7 @@ export function extractLaravelRoutes(tree, filePath) {
|
|
|
316
393
|
routePath,
|
|
317
394
|
routeName: appendResourceActionName(routeNameBase, action),
|
|
318
395
|
controllerName: target.controller ?? effective.controller,
|
|
396
|
+
controllerQualifiedName: resolveControllerQualifiedName(target.controllerQualified, target.controller ?? effective.controller, useAliasMap),
|
|
319
397
|
methodName: action,
|
|
320
398
|
middleware: [...effective.middleware],
|
|
321
399
|
prefix: effective.prefix,
|
|
@@ -331,6 +409,7 @@ export function extractLaravelRoutes(tree, filePath) {
|
|
|
331
409
|
routePath,
|
|
332
410
|
routeName,
|
|
333
411
|
controllerName: target.controller ?? effective.controller,
|
|
412
|
+
controllerQualifiedName: resolveControllerQualifiedName(target.controllerQualified, target.controller ?? effective.controller, useAliasMap),
|
|
334
413
|
methodName: target.method ?? (effective.controller ? target.bareMethod : null),
|
|
335
414
|
middleware: [...effective.middleware],
|
|
336
415
|
prefix: effective.prefix,
|
|
@@ -27,9 +27,10 @@ import type { ParsedFile } from '../../_shared/index.js';
|
|
|
27
27
|
import type { LanguageProvider } from './language-provider.js';
|
|
28
28
|
/** Callback used to report scope-extraction warnings to the host (worker or direct). */
|
|
29
29
|
export type ScopeBridgeWarn = (message: string) => void;
|
|
30
|
+
export type ScopeCaptureSourceKind = 'full-file' | 'pre-extracted-script';
|
|
30
31
|
/**
|
|
31
32
|
* Produce a `ParsedFile` for the given file, or `undefined` when the
|
|
32
33
|
* provider hasn't migrated / the extractor throws. Never propagates
|
|
33
34
|
* exceptions.
|
|
34
35
|
*/
|
|
35
|
-
export declare function extractParsedFile(provider: LanguageProvider, sourceText: string, filePath: string, onWarn?: ScopeBridgeWarn, cachedTree?: unknown): ParsedFile | undefined;
|
|
36
|
+
export declare function extractParsedFile(provider: LanguageProvider, sourceText: string, filePath: string, onWarn?: ScopeBridgeWarn, cachedTree?: unknown, sourceKind?: ScopeCaptureSourceKind): ParsedFile | undefined;
|
|
@@ -30,13 +30,13 @@ import { logger } from '../logger.js';
|
|
|
30
30
|
* provider hasn't migrated / the extractor throws. Never propagates
|
|
31
31
|
* exceptions.
|
|
32
32
|
*/
|
|
33
|
-
export function extractParsedFile(provider, sourceText, filePath, onWarn, cachedTree) {
|
|
33
|
+
export function extractParsedFile(provider, sourceText, filePath, onWarn, cachedTree, sourceKind = 'full-file') {
|
|
34
34
|
if (provider.emitScopeCaptures === undefined)
|
|
35
35
|
return undefined;
|
|
36
36
|
if (sourceText.trim().length === 0)
|
|
37
37
|
return undefined;
|
|
38
38
|
try {
|
|
39
|
-
const captures = provider.emitScopeCaptures(sourceText, filePath, cachedTree);
|
|
39
|
+
const captures = provider.emitScopeCaptures(sourceText, filePath, cachedTree, { sourceKind });
|
|
40
40
|
return extractScope(captures, filePath, provider);
|
|
41
41
|
}
|
|
42
42
|
catch (err) {
|
|
@@ -565,6 +565,8 @@ function normalizeNodeLabel(kindStr) {
|
|
|
565
565
|
return 'Annotation';
|
|
566
566
|
case 'namespace':
|
|
567
567
|
return 'Namespace';
|
|
568
|
+
case 'macro':
|
|
569
|
+
return 'Macro';
|
|
568
570
|
default:
|
|
569
571
|
return undefined;
|
|
570
572
|
}
|
|
@@ -775,6 +777,11 @@ function pass5CollectReferences(matches, positionIndex, filePath, referenceSites
|
|
|
775
777
|
if (kind === undefined)
|
|
776
778
|
continue;
|
|
777
779
|
const nameCap = match['@reference.name'] ?? anchor;
|
|
780
|
+
// Optional qualified form of the reference (e.g. a C++ base `Other::Inner`),
|
|
781
|
+
// threaded to resolution so a same-tail nested base resolves to the correct
|
|
782
|
+
// sibling via the full-path QualifiedNameIndex before the simple-tail walk
|
|
783
|
+
// (#1982). Absent for unqualified references — resolution stays unchanged.
|
|
784
|
+
const qualifiedCap = match['@reference.qualified-name'];
|
|
778
785
|
const inScopeId = positionIndex.atPosition(filePath, anchor.range.startLine, anchor.range.startCol);
|
|
779
786
|
if (inScopeId === undefined)
|
|
780
787
|
continue;
|
|
@@ -790,6 +797,9 @@ function pass5CollectReferences(matches, positionIndex, filePath, referenceSites
|
|
|
790
797
|
atRange: anchor.range,
|
|
791
798
|
inScope: inScopeId,
|
|
792
799
|
kind,
|
|
800
|
+
...(qualifiedCap?.text !== undefined && qualifiedCap.text.length > 0
|
|
801
|
+
? { rawQualifiedName: qualifiedCap.text }
|
|
802
|
+
: {}),
|
|
793
803
|
...(callForm !== undefined ? { callForm } : {}),
|
|
794
804
|
...(explicitReceiver !== undefined ? { explicitReceiver } : {}),
|
|
795
805
|
...(arity !== undefined ? { arity } : {}),
|
|
@@ -819,6 +829,8 @@ function referenceKindFromAnchor(name) {
|
|
|
819
829
|
case 'import_use':
|
|
820
830
|
case 'import-use':
|
|
821
831
|
return 'import-use';
|
|
832
|
+
case 'macro':
|
|
833
|
+
return 'macro';
|
|
822
834
|
default:
|
|
823
835
|
return undefined;
|
|
824
836
|
}
|
|
@@ -897,6 +909,7 @@ const KNOWN_SUB_TAGS = new Set([
|
|
|
897
909
|
'@type-binding.name',
|
|
898
910
|
'@type-binding.type',
|
|
899
911
|
'@reference.name',
|
|
912
|
+
'@reference.qualified-name',
|
|
900
913
|
'@reference.receiver',
|
|
901
914
|
'@reference.operator',
|
|
902
915
|
'@reference.arity',
|