@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.2
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/bin/codegraph +5 -0
- package/lib/dist/.test-build-engine.json +1 -0
- package/lib/dist/.test-build-viewer.json +1 -0
- package/lib/dist/bin/codegraph.d.ts +1 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -1
- package/lib/dist/bin/codegraph.js +605 -291
- package/lib/dist/bin/codegraph.js.map +1 -1
- package/lib/dist/bin/command-supervision.d.ts +7 -0
- package/lib/dist/bin/command-supervision.d.ts.map +1 -1
- package/lib/dist/bin/command-supervision.js +39 -27
- package/lib/dist/bin/command-supervision.js.map +1 -1
- package/lib/dist/bin/viewer-gate.d.ts +17 -0
- package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
- package/lib/dist/bin/viewer-gate.js +31 -0
- package/lib/dist/bin/viewer-gate.js.map +1 -0
- package/lib/dist/context/index.d.ts.map +1 -1
- package/lib/dist/context/index.js +43 -2
- package/lib/dist/context/index.js.map +1 -1
- package/lib/dist/db/index.d.ts +21 -2
- package/lib/dist/db/index.d.ts.map +1 -1
- package/lib/dist/db/index.js +86 -31
- package/lib/dist/db/index.js.map +1 -1
- package/lib/dist/db/migrations.d.ts +1 -1
- package/lib/dist/db/migrations.d.ts.map +1 -1
- package/lib/dist/db/migrations.js +40 -1
- package/lib/dist/db/migrations.js.map +1 -1
- package/lib/dist/db/queries.d.ts +454 -10
- package/lib/dist/db/queries.d.ts.map +1 -1
- package/lib/dist/db/queries.js +1080 -41
- package/lib/dist/db/queries.js.map +1 -1
- package/lib/dist/db/schema.sql +11 -1
- package/lib/dist/db/sqlite-adapter.d.ts +2 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/lib/dist/db/sqlite-adapter.js +56 -7
- package/lib/dist/db/sqlite-adapter.js.map +1 -1
- package/lib/dist/db/synthesis-stage.d.ts +12 -0
- package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
- package/lib/dist/db/synthesis-stage.js +89 -0
- package/lib/dist/db/synthesis-stage.js.map +1 -0
- package/lib/dist/db/wal-valve.d.ts +32 -12
- package/lib/dist/db/wal-valve.d.ts.map +1 -1
- package/lib/dist/db/wal-valve.js +65 -22
- package/lib/dist/db/wal-valve.js.map +1 -1
- package/lib/dist/db/wsl-shared-index.d.ts +53 -0
- package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
- package/lib/dist/db/wsl-shared-index.js +121 -0
- package/lib/dist/db/wsl-shared-index.js.map +1 -0
- package/lib/dist/directory.d.ts +131 -2
- package/lib/dist/directory.d.ts.map +1 -1
- package/lib/dist/directory.js +299 -23
- package/lib/dist/directory.js.map +1 -1
- package/lib/dist/errors.d.ts +14 -0
- package/lib/dist/errors.d.ts.map +1 -1
- package/lib/dist/errors.js +16 -1
- package/lib/dist/errors.js.map +1 -1
- package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/astro-extractor.js +7 -35
- package/lib/dist/extraction/astro-extractor.js.map +1 -1
- package/lib/dist/extraction/cfml-extractor.d.ts +77 -10
- package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/cfml-extractor.js +302 -71
- package/lib/dist/extraction/cfml-extractor.js.map +1 -1
- package/lib/dist/extraction/commonjs-requires.d.ts +23 -0
- package/lib/dist/extraction/commonjs-requires.d.ts.map +1 -0
- package/lib/dist/extraction/commonjs-requires.js +68 -0
- package/lib/dist/extraction/commonjs-requires.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/dfm-extractor.js +14 -10
- package/lib/dist/extraction/dfm-extractor.js.map +1 -1
- package/lib/dist/extraction/extraction-version.d.ts +1 -1
- package/lib/dist/extraction/extraction-version.js +1 -1
- package/lib/dist/extraction/function-ref.d.ts +6 -4
- package/lib/dist/extraction/function-ref.d.ts.map +1 -1
- package/lib/dist/extraction/function-ref.js +35 -14
- package/lib/dist/extraction/function-ref.js.map +1 -1
- package/lib/dist/extraction/generated-detection.d.ts +9 -0
- package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
- package/lib/dist/extraction/generated-detection.js +42 -2
- package/lib/dist/extraction/generated-detection.js.map +1 -1
- package/lib/dist/extraction/grammars.d.ts +40 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -1
- package/lib/dist/extraction/grammars.js +171 -1
- package/lib/dist/extraction/grammars.js.map +1 -1
- package/lib/dist/extraction/index.d.ts +132 -19
- package/lib/dist/extraction/index.d.ts.map +1 -1
- package/lib/dist/extraction/index.js +825 -195
- package/lib/dist/extraction/index.js.map +1 -1
- package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
- package/lib/dist/extraction/kernel/index.js +6 -0
- package/lib/dist/extraction/kernel/index.js.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.d.ts +73 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/c-cpp.js +412 -16
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
- package/lib/dist/extraction/languages/csharp.js +14 -5
- package/lib/dist/extraction/languages/csharp.js.map +1 -1
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
- package/lib/dist/extraction/languages/dart.js +16 -3
- package/lib/dist/extraction/languages/dart.js.map +1 -1
- package/lib/dist/extraction/languages/javascript.js +1 -1
- package/lib/dist/extraction/languages/javascript.js.map +1 -1
- package/lib/dist/extraction/languages/kotlin.d.ts +4 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/lib/dist/extraction/languages/kotlin.js +237 -36
- package/lib/dist/extraction/languages/kotlin.js.map +1 -1
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
- package/lib/dist/extraction/languages/lua.js +4 -1
- package/lib/dist/extraction/languages/lua.js.map +1 -1
- package/lib/dist/extraction/languages/python.d.ts.map +1 -1
- package/lib/dist/extraction/languages/python.js +71 -0
- package/lib/dist/extraction/languages/python.js.map +1 -1
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
- package/lib/dist/extraction/languages/rust.js +3 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -1
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
- package/lib/dist/extraction/languages/scala.js +18 -3
- package/lib/dist/extraction/languages/scala.js.map +1 -1
- package/lib/dist/extraction/languages/swift.d.ts +15 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
- package/lib/dist/extraction/languages/swift.js +50 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -1
- package/lib/dist/extraction/languages/typescript.d.ts +7 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/lib/dist/extraction/languages/typescript.js +30 -2
- package/lib/dist/extraction/languages/typescript.js.map +1 -1
- package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/liquid-extractor.js +98 -22
- package/lib/dist/extraction/liquid-extractor.js.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/mybatis-extractor.js +6 -4
- package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
- package/lib/dist/extraction/parse-budget.d.ts +16 -0
- package/lib/dist/extraction/parse-budget.d.ts.map +1 -0
- package/lib/dist/extraction/parse-budget.js +24 -0
- package/lib/dist/extraction/parse-budget.js.map +1 -0
- package/lib/dist/extraction/parse-pool.d.ts +12 -0
- package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
- package/lib/dist/extraction/parse-pool.js +51 -3
- package/lib/dist/extraction/parse-pool.js.map +1 -1
- package/lib/dist/extraction/parse-worker.js +3 -1
- package/lib/dist/extraction/parse-worker.js.map +1 -1
- package/lib/dist/extraction/sfc-script.d.ts +43 -0
- package/lib/dist/extraction/sfc-script.d.ts.map +1 -0
- package/lib/dist/extraction/sfc-script.js +135 -0
- package/lib/dist/extraction/sfc-script.js.map +1 -0
- package/lib/dist/extraction/store-worker.js +5 -0
- package/lib/dist/extraction/store-worker.js.map +1 -1
- package/lib/dist/extraction/store-writer.d.ts +10 -2
- package/lib/dist/extraction/store-writer.d.ts.map +1 -1
- package/lib/dist/extraction/store-writer.js +12 -4
- package/lib/dist/extraction/store-writer.js.map +1 -1
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/svelte-extractor.js +7 -37
- package/lib/dist/extraction/svelte-extractor.js.map +1 -1
- package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
- package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
- package/lib/dist/extraction/syntax-tokens.js +382 -0
- package/lib/dist/extraction/syntax-tokens.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.d.ts +104 -17
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/lib/dist/extraction/tree-sitter.js +943 -88
- package/lib/dist/extraction/tree-sitter.js.map +1 -1
- package/lib/dist/extraction/vue-extractor.d.ts +7 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
- package/lib/dist/extraction/vue-extractor.js +73 -35
- package/lib/dist/extraction/vue-extractor.js.map +1 -1
- package/lib/dist/extraction/vue-options-api.d.ts +28 -0
- package/lib/dist/extraction/vue-options-api.d.ts.map +1 -0
- package/lib/dist/extraction/vue-options-api.js +196 -0
- package/lib/dist/extraction/vue-options-api.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/file-limits.d.ts +40 -0
- package/lib/dist/file-limits.d.ts.map +1 -0
- package/lib/dist/file-limits.js +147 -0
- package/lib/dist/file-limits.js.map +1 -0
- package/lib/dist/graph/branch-guards.d.ts +265 -0
- package/lib/dist/graph/branch-guards.d.ts.map +1 -0
- package/lib/dist/graph/branch-guards.js +2326 -0
- package/lib/dist/graph/branch-guards.js.map +1 -0
- package/lib/dist/graph/dead-code.d.ts +251 -0
- package/lib/dist/graph/dead-code.d.ts.map +1 -0
- package/lib/dist/graph/dead-code.js +776 -0
- package/lib/dist/graph/dead-code.js.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
- package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
- package/lib/dist/graph/dynamic-boundary-report.js +283 -0
- package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
- package/lib/dist/graph/index.d.ts +4 -0
- package/lib/dist/graph/index.d.ts.map +1 -1
- package/lib/dist/graph/index.js +16 -1
- package/lib/dist/graph/index.js.map +1 -1
- package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
- package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
- package/lib/dist/graph/named-symbol-flow.js +559 -0
- package/lib/dist/graph/named-symbol-flow.js.map +1 -0
- package/lib/dist/graph/symbol-lookup.d.ts +83 -0
- package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
- package/lib/dist/graph/symbol-lookup.js +181 -0
- package/lib/dist/graph/symbol-lookup.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +9 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -1
- package/lib/dist/graph/traversal.js +61 -35
- package/lib/dist/graph/traversal.js.map +1 -1
- package/lib/dist/graph/type-hierarchy.d.ts +155 -0
- package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
- package/lib/dist/graph/type-hierarchy.js +382 -0
- package/lib/dist/graph/type-hierarchy.js.map +1 -0
- package/lib/dist/index.d.ts +256 -11
- package/lib/dist/index.d.ts.map +1 -1
- package/lib/dist/index.js +402 -34
- package/lib/dist/index.js.map +1 -1
- package/lib/dist/installer/index.d.ts.map +1 -1
- package/lib/dist/installer/index.js +3 -2
- package/lib/dist/installer/index.js.map +1 -1
- package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
- package/lib/dist/installer/targets/antigravity.js +14 -2
- package/lib/dist/installer/targets/antigravity.js.map +1 -1
- package/lib/dist/installer/targets/claude.d.ts +3 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -1
- package/lib/dist/installer/targets/claude.js +35 -7
- package/lib/dist/installer/targets/claude.js.map +1 -1
- package/lib/dist/installer/targets/codex.d.ts +2 -1
- package/lib/dist/installer/targets/codex.d.ts.map +1 -1
- package/lib/dist/installer/targets/codex.js +14 -4
- package/lib/dist/installer/targets/codex.js.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
- package/lib/dist/installer/targets/copilot-cli.js +7 -1
- package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
- package/lib/dist/installer/targets/opencode.d.ts +16 -5
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
- package/lib/dist/installer/targets/opencode.js +73 -22
- package/lib/dist/installer/targets/opencode.js.map +1 -1
- package/lib/dist/installer/targets/shared.d.ts +14 -3
- package/lib/dist/installer/targets/shared.d.ts.map +1 -1
- package/lib/dist/installer/targets/shared.js +39 -11
- package/lib/dist/installer/targets/shared.js.map +1 -1
- package/lib/dist/installer/targets/types.d.ts +7 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -1
- package/lib/dist/mcp/answer-freshness.d.ts +10 -0
- package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/answer-freshness.js +68 -0
- package/lib/dist/mcp/answer-freshness.js.map +1 -0
- package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-manager.js +16 -0
- package/lib/dist/mcp/daemon-manager.js.map +1 -1
- package/lib/dist/mcp/daemon-paths.d.ts +2 -0
- package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-paths.js +20 -5
- package/lib/dist/mcp/daemon-paths.js.map +1 -1
- package/lib/dist/mcp/daemon-registry.d.ts +11 -4
- package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
- package/lib/dist/mcp/daemon-registry.js +132 -36
- package/lib/dist/mcp/daemon-registry.js.map +1 -1
- package/lib/dist/mcp/daemon.d.ts +17 -7
- package/lib/dist/mcp/daemon.d.ts.map +1 -1
- package/lib/dist/mcp/daemon.js +116 -24
- package/lib/dist/mcp/daemon.js.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
- package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/lib/dist/mcp/dynamic-boundaries.js +46 -42
- package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/lib/dist/mcp/engine.d.ts +30 -9
- package/lib/dist/mcp/engine.d.ts.map +1 -1
- package/lib/dist/mcp/engine.js +158 -66
- package/lib/dist/mcp/engine.js.map +1 -1
- package/lib/dist/mcp/explore-dedup.d.ts +5 -2
- package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
- package/lib/dist/mcp/explore-dedup.js +8 -5
- package/lib/dist/mcp/explore-dedup.js.map +1 -1
- package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
- package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness-worker.js +36 -0
- package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
- package/lib/dist/mcp/index-freshness.d.ts +13 -0
- package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
- package/lib/dist/mcp/index-freshness.js +117 -0
- package/lib/dist/mcp/index-freshness.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +3 -1
- package/lib/dist/mcp/index.d.ts.map +1 -1
- package/lib/dist/mcp/index.js +95 -11
- package/lib/dist/mcp/index.js.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
- package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/lib/dist/mcp/liveness-watchdog.js +11 -2
- package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
- package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
- package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
- package/lib/dist/mcp/project-lifecycle.js +182 -0
- package/lib/dist/mcp/project-lifecycle.js.map +1 -0
- package/lib/dist/mcp/proxy.d.ts +9 -2
- package/lib/dist/mcp/proxy.d.ts.map +1 -1
- package/lib/dist/mcp/proxy.js +201 -32
- package/lib/dist/mcp/proxy.js.map +1 -1
- package/lib/dist/mcp/query-pool.d.ts +18 -3
- package/lib/dist/mcp/query-pool.d.ts.map +1 -1
- package/lib/dist/mcp/query-pool.js +67 -11
- package/lib/dist/mcp/query-pool.js.map +1 -1
- package/lib/dist/mcp/query-worker.js +2 -2
- package/lib/dist/mcp/query-worker.js.map +1 -1
- package/lib/dist/mcp/server-instructions.d.ts +1 -1
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
- package/lib/dist/mcp/server-instructions.js +6 -3
- package/lib/dist/mcp/server-instructions.js.map +1 -1
- package/lib/dist/mcp/startup-handshake.d.ts +3 -1
- package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
- package/lib/dist/mcp/startup-handshake.js +10 -2
- package/lib/dist/mcp/startup-handshake.js.map +1 -1
- package/lib/dist/mcp/tools.d.ts +306 -36
- package/lib/dist/mcp/tools.d.ts.map +1 -1
- package/lib/dist/mcp/tools.js +2395 -966
- package/lib/dist/mcp/tools.js.map +1 -1
- package/lib/dist/mcp/writer-lock.d.ts +61 -0
- package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
- package/lib/dist/mcp/writer-lock.js +260 -0
- package/lib/dist/mcp/writer-lock.js.map +1 -0
- package/lib/dist/resolution/alias-binding.d.ts +56 -0
- package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
- package/lib/dist/resolution/alias-binding.js +143 -0
- package/lib/dist/resolution/alias-binding.js.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts +49 -0
- package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/angular-template-synthesizer.js +359 -0
- package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -0
- package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
- package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/lib/dist/resolution/callback-synthesizer.js +460 -144
- package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
- package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
- package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-constructor.js +123 -0
- package/lib/dist/resolution/cpp-constructor.js.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
- package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
- package/lib/dist/resolution/cpp-macro-visibility.js +392 -0
- package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
- package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
- package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/frameworks/angular-router.d.ts +142 -0
- package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/angular-router.js +1126 -0
- package/lib/dist/resolution/frameworks/angular-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/astro.js +32 -6
- package/lib/dist/resolution/frameworks/astro.js.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/csharp.js +186 -24
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.d.ts +10 -0
- package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/expo-modules.js +95 -1
- package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
- package/lib/dist/resolution/frameworks/expo-router.d.ts +195 -0
- package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/expo-router.js +847 -0
- package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/express.js +339 -45
- package/lib/dist/resolution/frameworks/express.js.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/fabric.js +13 -11
- package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/go.js +11 -28
- package/lib/dist/resolution/frameworks/go.js.map +1 -1
- package/lib/dist/resolution/frameworks/index.d.ts +8 -2
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/index.js +39 -1
- package/lib/dist/resolution/frameworks/index.js.map +1 -1
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/java.js +88 -68
- package/lib/dist/resolution/frameworks/java.js.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/laravel.js +369 -26
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
- package/lib/dist/resolution/frameworks/name-heuristic.d.ts +35 -0
- package/lib/dist/resolution/frameworks/name-heuristic.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/name-heuristic.js +45 -0
- package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/nestjs.js +288 -55
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
- package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
- package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nextjs.js +329 -0
- package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
- package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/object-literal.js +139 -0
- package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
- package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/package-deps.js +78 -0
- package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
- package/lib/dist/resolution/frameworks/page-component.d.ts +20 -0
- package/lib/dist/resolution/frameworks/page-component.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/page-component.js +45 -0
- package/lib/dist/resolution/frameworks/page-component.js.map +1 -0
- package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/play.js +3 -1
- package/lib/dist/resolution/frameworks/play.js.map +1 -1
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/python.js +279 -26
- package/lib/dist/resolution/frameworks/python.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
- package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react-native.js +153 -14
- package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
- package/lib/dist/resolution/frameworks/react-router.d.ts +47 -0
- package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react-router.js +201 -0
- package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +13 -2
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/react.js +542 -144
- package/lib/dist/resolution/frameworks/react.js.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/ruby.js +177 -17
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/rust.js +24 -22
- package/lib/dist/resolution/frameworks/rust.js.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/svelte.js +14 -6
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
- package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/swift.js +253 -124
- package/lib/dist/resolution/frameworks/swift.js.map +1 -1
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
- package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
- package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts +98 -0
- package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue-router.js +500 -0
- package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -2
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
- package/lib/dist/resolution/frameworks/vue.js +45 -11
- package/lib/dist/resolution/frameworks/vue.js.map +1 -1
- package/lib/dist/resolution/import-resolver.d.ts +66 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
- package/lib/dist/resolution/import-resolver.js +643 -61
- package/lib/dist/resolution/import-resolver.js.map +1 -1
- package/lib/dist/resolution/index.d.ts +124 -25
- package/lib/dist/resolution/index.d.ts.map +1 -1
- package/lib/dist/resolution/index.js +769 -152
- package/lib/dist/resolution/index.js.map +1 -1
- package/lib/dist/resolution/js-builtins.d.ts +13 -0
- package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
- package/lib/dist/resolution/js-builtins.js +48 -0
- package/lib/dist/resolution/js-builtins.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +101 -22
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
- package/lib/dist/resolution/name-matcher.js +8267 -287
- package/lib/dist/resolution/name-matcher.js.map +1 -1
- package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
- package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/next-router-synthesizer.js +113 -0
- package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts +35 -0
- package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/react-router-synthesizer.js +197 -0
- package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/resolver-pool.d.ts +22 -1
- package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/lib/dist/resolution/resolver-pool.js +35 -5
- package/lib/dist/resolution/resolver-pool.js.map +1 -1
- package/lib/dist/resolution/resolver-worker.js +3 -0
- package/lib/dist/resolution/resolver-worker.js.map +1 -1
- package/lib/dist/resolution/strip-comments.d.ts +6 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
- package/lib/dist/resolution/strip-comments.js +58 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -1
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
- package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
- package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
- package/lib/dist/resolution/swift-type-visibility.d.ts +68 -0
- package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -0
- package/lib/dist/resolution/swift-type-visibility.js +454 -0
- package/lib/dist/resolution/swift-type-visibility.js.map +1 -0
- package/lib/dist/resolution/synth-utils.d.ts +26 -0
- package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
- package/lib/dist/resolution/synth-utils.js +75 -0
- package/lib/dist/resolution/synth-utils.js.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
- package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts +54 -0
- package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/tier-synthesizer.js +1294 -0
- package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
- package/lib/dist/resolution/type-parameters.d.ts +11 -0
- package/lib/dist/resolution/type-parameters.d.ts.map +1 -0
- package/lib/dist/resolution/type-parameters.js +287 -0
- package/lib/dist/resolution/type-parameters.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +105 -2
- package/lib/dist/resolution/types.d.ts.map +1 -1
- package/lib/dist/resolution/types.js +64 -0
- package/lib/dist/resolution/types.js.map +1 -1
- package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
- package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
- package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
- package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
- package/lib/dist/search/query-paths.d.ts +50 -1
- package/lib/dist/search/query-paths.d.ts.map +1 -1
- package/lib/dist/search/query-paths.js +227 -12
- package/lib/dist/search/query-paths.js.map +1 -1
- package/lib/dist/search/query-utils.d.ts +15 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -1
- package/lib/dist/search/query-utils.js +35 -7
- package/lib/dist/search/query-utils.js.map +1 -1
- package/lib/dist/sync/watch-policy.d.ts +14 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -1
- package/lib/dist/sync/watch-policy.js +19 -0
- package/lib/dist/sync/watch-policy.js.map +1 -1
- package/lib/dist/sync/watcher.d.ts +52 -35
- package/lib/dist/sync/watcher.d.ts.map +1 -1
- package/lib/dist/sync/watcher.js +236 -100
- package/lib/dist/sync/watcher.js.map +1 -1
- package/lib/dist/sync/worktree.d.ts +22 -0
- package/lib/dist/sync/worktree.d.ts.map +1 -1
- package/lib/dist/sync/worktree.js +54 -0
- package/lib/dist/sync/worktree.js.map +1 -1
- package/lib/dist/telemetry/index.d.ts +4 -2
- package/lib/dist/telemetry/index.d.ts.map +1 -1
- package/lib/dist/telemetry/index.js +159 -66
- package/lib/dist/telemetry/index.js.map +1 -1
- package/lib/dist/types.d.ts +1 -1
- package/lib/dist/types.d.ts.map +1 -1
- package/lib/dist/types.js +1 -0
- package/lib/dist/types.js.map +1 -1
- package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
- package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/deadcode.js +136 -0
- package/lib/dist/ui-server/api/deadcode.js.map +1 -0
- package/lib/dist/ui-server/api/effects.d.ts +94 -0
- package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
- package/lib/dist/ui-server/api/effects.js +527 -0
- package/lib/dist/ui-server/api/effects.js.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts +92 -0
- package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
- package/lib/dist/ui-server/api/entrypoints.js +364 -0
- package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
- package/lib/dist/ui-server/api/events.d.ts +183 -0
- package/lib/dist/ui-server/api/events.d.ts.map +1 -0
- package/lib/dist/ui-server/api/events.js +430 -0
- package/lib/dist/ui-server/api/events.js.map +1 -0
- package/lib/dist/ui-server/api/file.d.ts +66 -0
- package/lib/dist/ui-server/api/file.d.ts.map +1 -0
- package/lib/dist/ui-server/api/file.js +235 -0
- package/lib/dist/ui-server/api/file.js.map +1 -0
- package/lib/dist/ui-server/api/filecode.d.ts +126 -0
- package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
- package/lib/dist/ui-server/api/filecode.js +205 -0
- package/lib/dist/ui-server/api/filecode.js.map +1 -0
- package/lib/dist/ui-server/api/flow.d.ts +226 -0
- package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
- package/lib/dist/ui-server/api/flow.js +612 -0
- package/lib/dist/ui-server/api/flow.js.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
- package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
- package/lib/dist/ui-server/api/hierarchy.js +92 -0
- package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
- package/lib/dist/ui-server/api/index.d.ts +90 -0
- package/lib/dist/ui-server/api/index.d.ts.map +1 -0
- package/lib/dist/ui-server/api/index.js +332 -0
- package/lib/dist/ui-server/api/index.js.map +1 -0
- package/lib/dist/ui-server/api/map.d.ts +273 -0
- package/lib/dist/ui-server/api/map.d.ts.map +1 -0
- package/lib/dist/ui-server/api/map.js +781 -0
- package/lib/dist/ui-server/api/map.js.map +1 -0
- package/lib/dist/ui-server/api/node.d.ts +81 -0
- package/lib/dist/ui-server/api/node.d.ts.map +1 -0
- package/lib/dist/ui-server/api/node.js +394 -0
- package/lib/dist/ui-server/api/node.js.map +1 -0
- package/lib/dist/ui-server/api/nodes.d.ts +25 -0
- package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/nodes.js +45 -0
- package/lib/dist/ui-server/api/nodes.js.map +1 -0
- package/lib/dist/ui-server/api/program.d.ts +139 -0
- package/lib/dist/ui-server/api/program.d.ts.map +1 -0
- package/lib/dist/ui-server/api/program.js +315 -0
- package/lib/dist/ui-server/api/program.js.map +1 -0
- package/lib/dist/ui-server/api/respond.d.ts +76 -0
- package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
- package/lib/dist/ui-server/api/respond.js +186 -0
- package/lib/dist/ui-server/api/respond.js.map +1 -0
- package/lib/dist/ui-server/api/route-roots.d.ts +45 -0
- package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
- package/lib/dist/ui-server/api/route-roots.js +117 -0
- package/lib/dist/ui-server/api/route-roots.js.map +1 -0
- package/lib/dist/ui-server/api/routes.d.ts +61 -0
- package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
- package/lib/dist/ui-server/api/routes.js +164 -0
- package/lib/dist/ui-server/api/routes.js.map +1 -0
- package/lib/dist/ui-server/api/screens.d.ts +117 -0
- package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
- package/lib/dist/ui-server/api/screens.js +626 -0
- package/lib/dist/ui-server/api/screens.js.map +1 -0
- package/lib/dist/ui-server/api/search.d.ts +29 -0
- package/lib/dist/ui-server/api/search.d.ts.map +1 -0
- package/lib/dist/ui-server/api/search.js +232 -0
- package/lib/dist/ui-server/api/search.js.map +1 -0
- package/lib/dist/ui-server/api/session.d.ts +52 -0
- package/lib/dist/ui-server/api/session.d.ts.map +1 -0
- package/lib/dist/ui-server/api/session.js +196 -0
- package/lib/dist/ui-server/api/session.js.map +1 -0
- package/lib/dist/ui-server/api/source.d.ts +200 -0
- package/lib/dist/ui-server/api/source.d.ts.map +1 -0
- package/lib/dist/ui-server/api/source.js +422 -0
- package/lib/dist/ui-server/api/source.js.map +1 -0
- package/lib/dist/ui-server/api/stats.d.ts +27 -0
- package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
- package/lib/dist/ui-server/api/stats.js +164 -0
- package/lib/dist/ui-server/api/stats.js.map +1 -0
- package/lib/dist/ui-server/api/steps.d.ts +274 -0
- package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
- package/lib/dist/ui-server/api/steps.js +1554 -0
- package/lib/dist/ui-server/api/steps.js.map +1 -0
- package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
- package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trail-store.js +323 -0
- package/lib/dist/ui-server/api/trail-store.js.map +1 -0
- package/lib/dist/ui-server/api/trails.d.ts +163 -0
- package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
- package/lib/dist/ui-server/api/trails.js +370 -0
- package/lib/dist/ui-server/api/trails.js.map +1 -0
- package/lib/dist/ui-server/api/when.d.ts +133 -0
- package/lib/dist/ui-server/api/when.d.ts.map +1 -0
- package/lib/dist/ui-server/api/when.js +275 -0
- package/lib/dist/ui-server/api/when.js.map +1 -0
- package/lib/dist/ui-server/api/wire.d.ts +179 -0
- package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
- package/lib/dist/ui-server/api/wire.js +231 -0
- package/lib/dist/ui-server/api/wire.js.map +1 -0
- package/lib/dist/ui-server/assets.d.ts +40 -0
- package/lib/dist/ui-server/assets.d.ts.map +1 -0
- package/lib/dist/ui-server/assets.js +110 -0
- package/lib/dist/ui-server/assets.js.map +1 -0
- package/lib/dist/ui-server/constants.d.ts +32 -0
- package/lib/dist/ui-server/constants.d.ts.map +1 -0
- package/lib/dist/ui-server/constants.js +35 -0
- package/lib/dist/ui-server/constants.js.map +1 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts +28 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.js +139 -0
- package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -0
- package/lib/dist/ui-server/highlight/index.d.ts +113 -0
- package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/index.js +312 -0
- package/lib/dist/ui-server/highlight/index.js.map +1 -0
- package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
- package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/languages.js +50 -0
- package/lib/dist/ui-server/highlight/languages.js.map +1 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.d.ts +7 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.d.ts.map +1 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.js +20 -0
- package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -0
- package/lib/dist/ui-server/index.d.ts +92 -0
- package/lib/dist/ui-server/index.d.ts.map +1 -0
- package/lib/dist/ui-server/index.js +399 -0
- package/lib/dist/ui-server/index.js.map +1 -0
- package/lib/dist/ui-server/open-browser.d.ts +31 -0
- package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
- package/lib/dist/ui-server/open-browser.js +79 -0
- package/lib/dist/ui-server/open-browser.js.map +1 -0
- package/lib/dist/ui-server/security.d.ts +127 -0
- package/lib/dist/ui-server/security.d.ts.map +1 -0
- package/lib/dist/ui-server/security.js +332 -0
- package/lib/dist/ui-server/security.js.map +1 -0
- package/lib/dist/ui-server/static.d.ts +45 -0
- package/lib/dist/ui-server/static.d.ts.map +1 -0
- package/lib/dist/ui-server/static.js +165 -0
- package/lib/dist/ui-server/static.js.map +1 -0
- package/lib/dist/upgrade/index.d.ts +43 -5
- package/lib/dist/upgrade/index.d.ts.map +1 -1
- package/lib/dist/upgrade/index.js +157 -35
- package/lib/dist/upgrade/index.js.map +1 -1
- package/lib/dist/utils.d.ts +14 -2
- package/lib/dist/utils.d.ts.map +1 -1
- package/lib/dist/utils.js +25 -10
- package/lib/dist/utils.js.map +1 -1
- package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
- package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- package/lib/dist/viewer/assets/index-BSGpxBr9.js +99 -0
- package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
- package/lib/dist/viewer/index.html +16 -0
- package/lib/dist/worker-teardown.d.ts +48 -0
- package/lib/dist/worker-teardown.d.ts.map +1 -0
- package/lib/dist/worker-teardown.js +100 -0
- package/lib/dist/worker-teardown.js.map +1 -0
- package/lib/kernel/codegraph-kernel.node +2 -2
- package/lib/node_modules/.package-lock.json +4 -4
- package/lib/node_modules/picomatch/README.md +56 -51
- package/lib/node_modules/picomatch/lib/constants.js +4 -0
- package/lib/node_modules/picomatch/lib/parse.js +341 -1
- package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
- package/lib/node_modules/picomatch/lib/scan.js +30 -18
- package/lib/node_modules/picomatch/package.json +4 -4
- package/lib/package.json +9 -2
- package/package.json +1 -1
|
@@ -41,6 +41,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
exports.isNixPathImportRef = isNixPathImportRef;
|
|
42
42
|
exports.clearImportResolverMemos = clearImportResolverMemos;
|
|
43
43
|
exports.resolveImportPath = resolveImportPath;
|
|
44
|
+
exports.isExternalImport = isExternalImport;
|
|
44
45
|
exports.clearCppIncludeDirCache = clearCppIncludeDirCache;
|
|
45
46
|
exports.loadCppIncludeDirs = loadCppIncludeDirs;
|
|
46
47
|
exports.isPhpIncludePathRef = isPhpIncludePathRef;
|
|
@@ -49,11 +50,17 @@ exports.extractImportMappings = extractImportMappings;
|
|
|
49
50
|
exports.clearImportMappingCache = clearImportMappingCache;
|
|
50
51
|
exports.extractReExports = extractReExports;
|
|
51
52
|
exports.resolveJvmImport = resolveJvmImport;
|
|
53
|
+
exports.resolvePhpImportedStaticCall = resolvePhpImportedStaticCall;
|
|
54
|
+
exports.isJsPathImportRef = isJsPathImportRef;
|
|
55
|
+
exports.resolvePhpQualifiedClassRef = resolvePhpQualifiedClassRef;
|
|
52
56
|
exports.resolveViaImport = resolveViaImport;
|
|
57
|
+
exports.isBoundToOutOfRepoImport = isBoundToOutOfRepoImport;
|
|
53
58
|
const fs = __importStar(require("fs"));
|
|
54
59
|
const path = __importStar(require("path"));
|
|
55
60
|
const path_aliases_1 = require("./path-aliases");
|
|
61
|
+
const alias_binding_1 = require("./alias-binding");
|
|
56
62
|
const workspace_packages_1 = require("./workspace-packages");
|
|
63
|
+
const strip_comments_1 = require("./strip-comments");
|
|
57
64
|
const name_matcher_1 = require("./name-matcher");
|
|
58
65
|
/**
|
|
59
66
|
* Extension resolution order by language
|
|
@@ -102,7 +109,38 @@ function isNixPathImportRef(ref) {
|
|
|
102
109
|
// there, so the staleness discipline matches the resolver's own caches.
|
|
103
110
|
const importPathMemos = new WeakMap();
|
|
104
111
|
const exportedSymbolMemos = new WeakMap();
|
|
112
|
+
const DEFAULT_BINDING_KINDS = new Set(['function', 'class', 'component', 'constant', 'variable']);
|
|
113
|
+
const DEFAULT_EXPORT_BINDING_RE = /^[ \t]*export\s+default\s+([A-Za-z_$][\w$]*)\s*;?[ \t]*$/m;
|
|
114
|
+
const JS_FAMILY_FILE = /\.(?:[cm]?[jt]sx?)$/;
|
|
115
|
+
/** The identifier `export default NAME` names in a JS-family file, or null. */
|
|
116
|
+
function defaultExportBinding(filePath, context) {
|
|
117
|
+
if (!JS_FAMILY_FILE.test(filePath))
|
|
118
|
+
return null;
|
|
119
|
+
const source = context.readFile(filePath);
|
|
120
|
+
if (!source || !source.includes('export default'))
|
|
121
|
+
return null;
|
|
122
|
+
return source.match(DEFAULT_EXPORT_BINDING_RE)?.[1] ?? null;
|
|
123
|
+
}
|
|
105
124
|
const fileExportIndexes = new WeakMap();
|
|
125
|
+
/**
|
|
126
|
+
* `module.exports = …` (also `exports = module.exports = …`): the name it
|
|
127
|
+
* binds (`createApplication`, `function name(`, `class Name`) or the module
|
|
128
|
+
* it forwards (`require('./lib/express')`), or null.
|
|
129
|
+
*/
|
|
130
|
+
const COMMONJS_DEFAULT_EXPORT = /^[ \t]*(?:exports\s*=\s*)?module\.exports\s*=\s*(?:exports\s*=\s*)?(?:require\(\s*['"]([^'"]+)['"]\s*\)\s*;?[ \t]*$|(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)\s*\(|class\s+([A-Za-z_$][\w$]*)|([A-Za-z_$][\w$]*)\s*;?[ \t]*$)/m;
|
|
131
|
+
function commonJsDefaultExport(filePath, context) {
|
|
132
|
+
if (!JS_FAMILY_FILE.test(filePath))
|
|
133
|
+
return null;
|
|
134
|
+
if (context.fileContains && !context.fileContains(filePath, 'module.exports'))
|
|
135
|
+
return null;
|
|
136
|
+
const source = context.readFile(filePath);
|
|
137
|
+
if (!source || !source.includes('module.exports'))
|
|
138
|
+
return null;
|
|
139
|
+
const m = COMMONJS_DEFAULT_EXPORT.exec(source);
|
|
140
|
+
if (!m)
|
|
141
|
+
return null;
|
|
142
|
+
return m[1] ? { source: m[1] } : { name: m[2] ?? m[3] ?? m[4] };
|
|
143
|
+
}
|
|
106
144
|
function getFileExportIndex(filePath, context) {
|
|
107
145
|
let perFile = fileExportIndexes.get(context);
|
|
108
146
|
if (!perFile) {
|
|
@@ -112,9 +150,8 @@ function getFileExportIndex(filePath, context) {
|
|
|
112
150
|
let idx = perFile.get(filePath);
|
|
113
151
|
if (!idx) {
|
|
114
152
|
idx = { byName: new Map(), defaultComponent: undefined, defaultFnClass: undefined };
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
continue;
|
|
153
|
+
const exported = context.getExportedNodesInFile?.(filePath) ?? context.getNodesInFile(filePath).filter((n) => n.isExported);
|
|
154
|
+
for (const n of exported) {
|
|
118
155
|
if (!idx.byName.has(n.name))
|
|
119
156
|
idx.byName.set(n.name, n);
|
|
120
157
|
if (idx.defaultComponent === undefined && n.kind === 'component')
|
|
@@ -126,6 +163,47 @@ function getFileExportIndex(filePath, context) {
|
|
|
126
163
|
}
|
|
127
164
|
return idx;
|
|
128
165
|
}
|
|
166
|
+
/** The file's nodes named `name`, in `getNodesInFile` order. */
|
|
167
|
+
function nodesInFileNamed(filePath, name, context) {
|
|
168
|
+
return context.getNodesInFileNamed?.(filePath, name) ?? context.getNodesInFile(filePath).filter((n) => n.name === name);
|
|
169
|
+
}
|
|
170
|
+
/** The declaration `export default NAME` names in this file (see FileExportIndex.defaultBinding). */
|
|
171
|
+
function defaultExportBindingNode(filePath, idx, context) {
|
|
172
|
+
if (idx.defaultBinding === undefined) {
|
|
173
|
+
const bound = defaultExportBinding(filePath, context);
|
|
174
|
+
idx.defaultBinding =
|
|
175
|
+
bound === null
|
|
176
|
+
? null
|
|
177
|
+
: (nodesInFileNamed(filePath, bound, context)
|
|
178
|
+
.filter((n) => DEFAULT_BINDING_KINDS.has(n.kind))
|
|
179
|
+
.sort((a, b) => a.startLine - b.startLine || a.startColumn - b.startColumn)[0] ?? null);
|
|
180
|
+
}
|
|
181
|
+
return idx.defaultBinding ?? undefined;
|
|
182
|
+
}
|
|
183
|
+
/** What this file exports as `name`: an exported declaration, else a local export clause's binding. */
|
|
184
|
+
function exportedByName(filePath, idx, name, context) {
|
|
185
|
+
const direct = idx.byName.get(name);
|
|
186
|
+
if (direct)
|
|
187
|
+
return direct;
|
|
188
|
+
if (idx.clauseAliases === undefined) {
|
|
189
|
+
// Bind names introduced by a local export clause to their declarations, so
|
|
190
|
+
// an importer asking for the renamed name gets the real symbol instead of
|
|
191
|
+
// falling through to the name-matcher (which cannot cross the rename).
|
|
192
|
+
// The declaration is the file's first node of that name, exported or not.
|
|
193
|
+
idx.clauseAliases = new Map();
|
|
194
|
+
const content = context.readFile(filePath);
|
|
195
|
+
if (content && content.includes('export')) {
|
|
196
|
+
for (const { exportedName, localName } of (0, alias_binding_1.extractLocalExportAliases)(content)) {
|
|
197
|
+
if (idx.byName.has(exportedName) || idx.clauseAliases.has(exportedName))
|
|
198
|
+
continue;
|
|
199
|
+
const decl = nodesInFileNamed(filePath, localName, context)[0];
|
|
200
|
+
if (decl)
|
|
201
|
+
idx.clauseAliases.set(exportedName, decl);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return idx.clauseAliases.get(name);
|
|
206
|
+
}
|
|
129
207
|
/** Drop the per-context memo tables (see ReferenceResolver.clearCaches). */
|
|
130
208
|
function clearImportResolverMemos(context) {
|
|
131
209
|
importPathMemos.delete(context);
|
|
@@ -133,6 +211,8 @@ function clearImportResolverMemos(context) {
|
|
|
133
211
|
fileExportIndexes.delete(context);
|
|
134
212
|
luaFileBasenameIndexes.delete(context);
|
|
135
213
|
cobolCopybookIndexes.delete(context);
|
|
214
|
+
pythonModuleFileMemos.delete(context);
|
|
215
|
+
PY_MODULE_SYMBOLS.delete(context);
|
|
136
216
|
}
|
|
137
217
|
function resolveImportPath(importPath, fromFile, language, context) {
|
|
138
218
|
let memo = importPathMemos.get(context);
|
|
@@ -170,7 +250,7 @@ function resolveImportPathUncached(importPath, fromFile, language, context) {
|
|
|
170
250
|
return resolveRelativeImport(importPath, fromDir, language, context);
|
|
171
251
|
}
|
|
172
252
|
// Handle absolute/aliased imports (like @/ or src/)
|
|
173
|
-
const aliased = resolveAliasedImport(importPath, projectRoot, language, context);
|
|
253
|
+
const aliased = resolveAliasedImport(importPath, projectRoot, language, context, fromFile);
|
|
174
254
|
if (aliased)
|
|
175
255
|
return aliased;
|
|
176
256
|
// C/C++ include directory search: when neither relative nor aliased
|
|
@@ -292,6 +372,19 @@ const C_CPP_STDLIB_HEADERS = new Set([
|
|
|
292
372
|
'unordered_set', 'utility', 'valarray', 'variant', 'vector',
|
|
293
373
|
'version',
|
|
294
374
|
]);
|
|
375
|
+
/**
|
|
376
|
+
* Languages whose imports are ES-module specifiers, extracted by
|
|
377
|
+
* `extractJSImports` and therefore classified by the same bare-specifier /
|
|
378
|
+
* alias / workspace rules. Svelte, Vue and Astro belong here: an SFC imports
|
|
379
|
+
* inside its `<script>` block (Astro: the `---` frontmatter) with exactly the
|
|
380
|
+
* same syntax, and leaving them out made `isExternalImport` answer "not
|
|
381
|
+
* external" for every npm specifier in an SFC.
|
|
382
|
+
*/
|
|
383
|
+
const ESM_IMPORT_LANGUAGES = new Set([
|
|
384
|
+
'typescript', 'tsx', 'javascript', 'jsx', 'arkts', 'svelte', 'vue', 'astro',
|
|
385
|
+
]);
|
|
386
|
+
/** Rust path roots that always name a standard-library crate. */
|
|
387
|
+
const RUST_STDLIB_ROOTS = new Set(['std', 'core', 'alloc', 'proc_macro']);
|
|
295
388
|
/**
|
|
296
389
|
* Check if an import is external (npm package, etc.)
|
|
297
390
|
*
|
|
@@ -314,7 +407,7 @@ function isExternalImport(importPath, language, context) {
|
|
|
314
407
|
return false;
|
|
315
408
|
}
|
|
316
409
|
// Common external patterns
|
|
317
|
-
if (language
|
|
410
|
+
if (ESM_IMPORT_LANGUAGES.has(language)) {
|
|
318
411
|
// Node built-ins
|
|
319
412
|
if (['fs', 'path', 'os', 'crypto', 'http', 'https', 'url', 'util', 'events', 'stream', 'child_process', 'buffer'].includes(importPath)) {
|
|
320
413
|
return true;
|
|
@@ -401,9 +494,11 @@ function resolveRelativeImport(importPath, fromDir, language, context) {
|
|
|
401
494
|
// Try the path as-is first
|
|
402
495
|
const basePath = path.resolve(fromDir, importPath);
|
|
403
496
|
const relativePath = path.relative(projectRoot, basePath).replace(/\\/g, '/');
|
|
404
|
-
// Try each extension
|
|
497
|
+
// Try each extension. `require('..')` up to the project root is its `index.js`.
|
|
405
498
|
for (const ext of extensions) {
|
|
406
|
-
|
|
499
|
+
if (relativePath === '' && !ext.startsWith('/'))
|
|
500
|
+
continue;
|
|
501
|
+
const candidatePath = relativePath === '' ? ext.slice(1) : relativePath + ext;
|
|
407
502
|
if (context.fileExists(candidatePath)) {
|
|
408
503
|
return candidatePath;
|
|
409
504
|
}
|
|
@@ -412,8 +507,44 @@ function resolveRelativeImport(importPath, fromDir, language, context) {
|
|
|
412
507
|
if (context.fileExists(relativePath)) {
|
|
413
508
|
return relativePath;
|
|
414
509
|
}
|
|
510
|
+
return findSourceForEmittedSpecifier(relativePath, language, context);
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* TypeScript under `moduleResolution: node16 | nodenext | bundler` writes the
|
|
514
|
+
* EMITTED extension in the specifier (`import x from './util.js'` for
|
|
515
|
+
* `util.ts`, `.mjs` for `.mts`, `.cjs` for `.cts`), and the source file with that
|
|
516
|
+
* exact name never exists in the repo. Without this remap the import resolver
|
|
517
|
+
* returned null for every such import, so each imported name fell through to
|
|
518
|
+
* bare-name matching: a method wrapping the same-named helper it imports
|
|
519
|
+
* (`renderDockStyles() { return renderDockStyles() }`) resolved to ITSELF, and
|
|
520
|
+
* any repo-wide same-named symbol could win the cross-module edge.
|
|
521
|
+
*/
|
|
522
|
+
const EMITTED_TO_SOURCE_EXTENSIONS = [
|
|
523
|
+
[/\.js$/, ['.ts', '.tsx', '.d.ts']],
|
|
524
|
+
[/\.jsx$/, ['.tsx']],
|
|
525
|
+
[/\.mjs$/, ['.mts', '.d.mts']],
|
|
526
|
+
[/\.cjs$/, ['.cts', '.d.cts']],
|
|
527
|
+
];
|
|
528
|
+
function findSourceForEmittedSpecifier(relativePath, language, context) {
|
|
529
|
+
if (!EMITTED_SPECIFIER_LANGUAGES.has(language))
|
|
530
|
+
return null;
|
|
531
|
+
for (const [emitted, sources] of EMITTED_TO_SOURCE_EXTENSIONS) {
|
|
532
|
+
if (!emitted.test(relativePath))
|
|
533
|
+
continue;
|
|
534
|
+
const stem = relativePath.replace(emitted, '');
|
|
535
|
+
for (const ext of sources) {
|
|
536
|
+
const candidate = stem + ext;
|
|
537
|
+
if (context.fileExists(candidate))
|
|
538
|
+
return candidate;
|
|
539
|
+
}
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
415
542
|
return null;
|
|
416
543
|
}
|
|
544
|
+
/** Languages whose import specifiers can name the emitted `.js` of a `.ts` source. */
|
|
545
|
+
const EMITTED_SPECIFIER_LANGUAGES = new Set([
|
|
546
|
+
'typescript', 'tsx', 'javascript', 'jsx', 'vue', 'svelte', 'astro', 'arkts',
|
|
547
|
+
]);
|
|
417
548
|
/**
|
|
418
549
|
* Resolve an aliased/absolute import.
|
|
419
550
|
*
|
|
@@ -425,7 +556,7 @@ function resolveRelativeImport(importPath, fromDir, language, context) {
|
|
|
425
556
|
* for projects that have aliases but no tsconfig paths block.
|
|
426
557
|
* 3. Direct path lookup (with extensions).
|
|
427
558
|
*/
|
|
428
|
-
function resolveAliasedImport(importPath, projectRoot, language, context) {
|
|
559
|
+
function resolveAliasedImport(importPath, projectRoot, language, context, fromFile) {
|
|
429
560
|
const extensions = EXTENSION_RESOLUTION[language] || [];
|
|
430
561
|
const tryWithExt = (basePath) => {
|
|
431
562
|
for (const ext of extensions) {
|
|
@@ -435,11 +566,15 @@ function resolveAliasedImport(importPath, projectRoot, language, context) {
|
|
|
435
566
|
}
|
|
436
567
|
if (context.fileExists(basePath))
|
|
437
568
|
return basePath;
|
|
438
|
-
return
|
|
569
|
+
return findSourceForEmittedSpecifier(basePath, language, context);
|
|
439
570
|
};
|
|
440
|
-
// 1.
|
|
441
|
-
|
|
442
|
-
|
|
571
|
+
// 1. tsconfig/jsconfig paths: the config nearest the importing file (an
|
|
572
|
+
// app of a monorepo keeps its own `@/*`), then the project root's.
|
|
573
|
+
const nearest = fromFile ? context.getNearestAliases?.(fromFile) : null;
|
|
574
|
+
const rootMap = context.getProjectAliases?.();
|
|
575
|
+
for (const aliasMap of nearest && nearest !== rootMap ? [nearest, rootMap] : [rootMap]) {
|
|
576
|
+
if (!aliasMap)
|
|
577
|
+
continue;
|
|
443
578
|
const candidates = (0, path_aliases_1.applyAliases)(importPath, aliasMap, projectRoot);
|
|
444
579
|
for (const c of candidates) {
|
|
445
580
|
const hit = tryWithExt(c);
|
|
@@ -752,7 +887,7 @@ function extractImportMappings(_filePath, content, language) {
|
|
|
752
887
|
mappings.push(...extractJSImports(content));
|
|
753
888
|
}
|
|
754
889
|
else if (language === 'python') {
|
|
755
|
-
mappings.push(...extractPythonImports(content));
|
|
890
|
+
mappings.push(...extractPythonImports((0, strip_comments_1.stripCommentsForRegex)(content, 'python')));
|
|
756
891
|
}
|
|
757
892
|
else if (language === 'go') {
|
|
758
893
|
mappings.push(...extractGoImports(content));
|
|
@@ -773,8 +908,11 @@ function extractImportMappings(_filePath, content, language) {
|
|
|
773
908
|
*/
|
|
774
909
|
function extractJSImports(content) {
|
|
775
910
|
const mappings = [];
|
|
776
|
-
// ES6 imports
|
|
777
|
-
|
|
911
|
+
// ES6 imports. `import type { X }` / `import type * as ns` is TypeScript's
|
|
912
|
+
// type-only form, not a default import named `type` — which every such
|
|
913
|
+
// line used to add, making `type.innerType()` a call on an import.
|
|
914
|
+
// (`import type from './x'` still binds `type`: backtracking gives it back.)
|
|
915
|
+
const importRegex = /import\s+(?:type\s+(?=[{*]|(?!from\b)\w))?(?:(\w+)\s*,?\s*)?(?:\{([^}]+)\})?\s*(?:(\*)\s+as\s+(\w+))?\s*from\s*['"]([^'"]+)['"]/g;
|
|
778
916
|
let match;
|
|
779
917
|
while ((match = importRegex.exec(content)) !== null) {
|
|
780
918
|
const [, defaultImport, namedImports, star, namespaceAlias, source] = match;
|
|
@@ -790,7 +928,8 @@ function extractJSImports(content) {
|
|
|
790
928
|
}
|
|
791
929
|
// Named imports
|
|
792
930
|
if (namedImports) {
|
|
793
|
-
|
|
931
|
+
// `{ util, type objectUtil }`: an inline `type` modifier is not part of the name.
|
|
932
|
+
const names = namedImports.split(',').map((s) => s.trim().replace(/^type\s+(?=\w)/, ''));
|
|
794
933
|
for (const name of names) {
|
|
795
934
|
const aliasMatch = name.match(/(\w+)\s+as\s+(\w+)/);
|
|
796
935
|
if (aliasMatch) {
|
|
@@ -824,16 +963,17 @@ function extractJSImports(content) {
|
|
|
824
963
|
});
|
|
825
964
|
}
|
|
826
965
|
}
|
|
827
|
-
// Require statements
|
|
828
|
-
|
|
966
|
+
// Require statements — each declarator of a list too (`var express = require('../'),
|
|
967
|
+
// request = require('supertest')`), and a member of the module (`require('./utils').methods`).
|
|
968
|
+
const requireRegex = /(?:\b(?:const|let|var)\s+|,\s*)(?:([A-Za-z_$][\w$]*)|{([^}]+)})\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)(?:\s*\.\s*([A-Za-z_$][\w$]*))?/g;
|
|
829
969
|
while ((match = requireRegex.exec(content)) !== null) {
|
|
830
|
-
const [, defaultName, destructured, source] = match;
|
|
970
|
+
const [, defaultName, destructured, source, member] = match;
|
|
831
971
|
if (defaultName) {
|
|
832
972
|
mappings.push({
|
|
833
973
|
localName: defaultName,
|
|
834
|
-
exportedName: 'default',
|
|
974
|
+
exportedName: member ?? 'default',
|
|
835
975
|
source: source,
|
|
836
|
-
isDefault:
|
|
976
|
+
isDefault: member === undefined,
|
|
837
977
|
isNamespace: false,
|
|
838
978
|
});
|
|
839
979
|
}
|
|
@@ -869,12 +1009,13 @@ function extractJSImports(content) {
|
|
|
869
1009
|
*/
|
|
870
1010
|
function extractPythonImports(content) {
|
|
871
1011
|
const mappings = [];
|
|
872
|
-
// from X import Y
|
|
873
|
-
const fromImportRegex = /from\s+([\w.]+)\s+import\s+([^#\n]+)/g;
|
|
1012
|
+
// from X import Y, and the parenthesized form `from X import (\n Y,\n Z,\n)`
|
|
1013
|
+
const fromImportRegex = /from\s+([\w.]+)\s+import\s+(\([^)]*\)|[^#\n]+)/g;
|
|
874
1014
|
let match;
|
|
875
1015
|
while ((match = fromImportRegex.exec(content)) !== null) {
|
|
876
1016
|
const [, source, imports] = match;
|
|
877
|
-
const names = imports.
|
|
1017
|
+
const names = imports.trim().replace(/^\(|\)$/g, '')
|
|
1018
|
+
.split(',').map((s) => s.trim());
|
|
878
1019
|
for (const name of names) {
|
|
879
1020
|
const aliasMatch = name.match(/(\w+)\s+as\s+(\w+)/);
|
|
880
1021
|
if (aliasMatch) {
|
|
@@ -971,8 +1112,8 @@ function extractJavaImports(content) {
|
|
|
971
1112
|
const stripped = content
|
|
972
1113
|
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
973
1114
|
.replace(/\/\/[^\n]*/g, '');
|
|
974
|
-
// `import [static] <fqn>[.*];`
|
|
975
|
-
const re = /^\s*import\s+(static\s+)?([\w.]+(?:\.\*)?)\s
|
|
1115
|
+
// `import [static] <fqn>[.*];` — and Kotlin's `import <fqn> [as Alias]`, with no `;`.
|
|
1116
|
+
const re = /^\s*import\s+(static\s+)?([\w.]+(?:\.\*)?)(?:\s+as\s+([\w]+))?\s*(?:;|$)/gm;
|
|
976
1117
|
let match;
|
|
977
1118
|
while ((match = re.exec(stripped)) !== null) {
|
|
978
1119
|
const fqn = match[2];
|
|
@@ -982,12 +1123,12 @@ function extractJavaImports(content) {
|
|
|
982
1123
|
if (fqn.endsWith('.*'))
|
|
983
1124
|
continue;
|
|
984
1125
|
const parts = fqn.split('.');
|
|
985
|
-
const localName = parts[parts.length - 1];
|
|
1126
|
+
const localName = match[3] ?? parts[parts.length - 1];
|
|
986
1127
|
if (!localName)
|
|
987
1128
|
continue;
|
|
988
1129
|
mappings.push({
|
|
989
1130
|
localName,
|
|
990
|
-
exportedName:
|
|
1131
|
+
exportedName: parts[parts.length - 1],
|
|
991
1132
|
source: fqn,
|
|
992
1133
|
isDefault: false,
|
|
993
1134
|
isNamespace: false,
|
|
@@ -1136,11 +1277,11 @@ function extractReExports(content, language) {
|
|
|
1136
1277
|
// a project that builds export statements as runtime strings is
|
|
1137
1278
|
// out of scope.)
|
|
1138
1279
|
const cleaned = stripJsComments(content);
|
|
1139
|
-
// Wildcard: `export * from '...'
|
|
1140
|
-
const wildcardRe = /export\s*\*(?:\s+as\s
|
|
1280
|
+
// Wildcard: `export * from '...'`; `export * as ns from '...'` exports `ns` alone.
|
|
1281
|
+
const wildcardRe = /export\s*\*(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*from\s*['"]([^'"]+)['"]/g;
|
|
1141
1282
|
let m;
|
|
1142
1283
|
while ((m = wildcardRe.exec(cleaned)) !== null) {
|
|
1143
|
-
out.push({ kind: 'wildcard', source: m[
|
|
1284
|
+
out.push(m[1] ? { kind: 'namespace', exportedName: m[1], source: m[2] } : { kind: 'wildcard', source: m[2] });
|
|
1144
1285
|
}
|
|
1145
1286
|
// Named: `export { a, b as c } from '...'`
|
|
1146
1287
|
const namedRe = /export\s*\{([^}]+)\}\s*from\s*['"]([^'"]+)['"]/g;
|
|
@@ -1216,6 +1357,29 @@ function resolveJvmImport(ref, context) {
|
|
|
1216
1357
|
resolvedBy: 'import',
|
|
1217
1358
|
};
|
|
1218
1359
|
}
|
|
1360
|
+
/** `Alias` / `Alias.member` through a renaming Kotlin import, by the imported FQN. */
|
|
1361
|
+
function resolveJvmAlias(ref, imports, context) {
|
|
1362
|
+
const dot = ref.referenceName.indexOf('.');
|
|
1363
|
+
const root = dot < 0 ? ref.referenceName : ref.referenceName.slice(0, dot);
|
|
1364
|
+
const imp = imports.find((m) => m.localName === root && m.localName !== m.exportedName);
|
|
1365
|
+
if (!imp)
|
|
1366
|
+
return null;
|
|
1367
|
+
const parts = imp.source.split('.');
|
|
1368
|
+
// The package is some prefix of the FQN; the rest is the type path (`Outer::Inner`).
|
|
1369
|
+
for (let i = parts.length - 1; i > 0; i--) {
|
|
1370
|
+
const target = context.getNodesByQualifiedName(`${parts.slice(0, i).join('.')}::${parts.slice(i).join('::')}`)[0];
|
|
1371
|
+
if (!target)
|
|
1372
|
+
continue;
|
|
1373
|
+
const member = dot < 0 ? null : ref.referenceName.slice(dot + 1);
|
|
1374
|
+
if (member === null)
|
|
1375
|
+
return { original: ref, targetNodeId: target.id, confidence: 0.9, resolvedBy: 'import' };
|
|
1376
|
+
if (member.includes('.'))
|
|
1377
|
+
return null;
|
|
1378
|
+
const found = context.getNodesByQualifiedName(`${target.qualifiedName}::${member}`)[0];
|
|
1379
|
+
return found ? { original: ref, targetNodeId: found.id, confidence: 0.9, resolvedBy: 'import' } : null;
|
|
1380
|
+
}
|
|
1381
|
+
return null;
|
|
1382
|
+
}
|
|
1219
1383
|
/**
|
|
1220
1384
|
* Pick the same-FQN candidate closest to `fromPath` by shared directory
|
|
1221
1385
|
* prefix, preferring an `expect` declaration on a tie. Used to keep a Kotlin
|
|
@@ -1248,7 +1412,146 @@ function pickClosestJvmCandidate(candidates, fromPath) {
|
|
|
1248
1412
|
}
|
|
1249
1413
|
return best;
|
|
1250
1414
|
}
|
|
1415
|
+
/**
|
|
1416
|
+
* PHP scoped calls are encoded as "Alias.method" by both extractors. A use
|
|
1417
|
+
* mapping names a namespace, not a filesystem path, so resolve the receiver
|
|
1418
|
+
* through its localName and look up the method on that exact imported type.
|
|
1419
|
+
* undefined means this is not an imported static call; null means the import
|
|
1420
|
+
* owns the call but its method is unavailable, so name fallbacks must not guess.
|
|
1421
|
+
*/
|
|
1422
|
+
function resolvePhpImportedStaticCall(ref, context) {
|
|
1423
|
+
if (ref.language !== 'php' || ref.referenceKind !== 'calls')
|
|
1424
|
+
return undefined;
|
|
1425
|
+
const call = /^(\w+)\.(\w+)$/.exec(ref.referenceName);
|
|
1426
|
+
if (!call)
|
|
1427
|
+
return undefined;
|
|
1428
|
+
const [, receiver, member] = call;
|
|
1429
|
+
const imp = context.getImportMappings(ref.filePath, ref.language)
|
|
1430
|
+
.find((i) => i.localName === receiver);
|
|
1431
|
+
if (!imp)
|
|
1432
|
+
return undefined;
|
|
1433
|
+
// PHP variables occupy a different namespace from class imports. Extraction
|
|
1434
|
+
// strips the leading "$" from "$Alias->method()" too; leave that receiver to
|
|
1435
|
+
// local type inference even when a class import has the same local name.
|
|
1436
|
+
const lines = context.getFileLines?.(ref.filePath) ?? context.readFile(ref.filePath)?.split('\n');
|
|
1437
|
+
const line = lines?.[ref.line - 1];
|
|
1438
|
+
if (line?.slice(ref.column).startsWith('$'))
|
|
1439
|
+
return undefined;
|
|
1440
|
+
const fqn = imp.source.replace(/^\\/, '');
|
|
1441
|
+
const separator = fqn.lastIndexOf('\\');
|
|
1442
|
+
const typeName = separator < 0
|
|
1443
|
+
? fqn
|
|
1444
|
+
: `${fqn.slice(0, separator)}::${fqn.slice(separator + 1)}`;
|
|
1445
|
+
const owners = context.getNodesByQualifiedName(typeName)
|
|
1446
|
+
.filter((n) => n.language === 'php' && STATIC_MEMBER_CONTAINERS.has(n.kind));
|
|
1447
|
+
if (owners.length !== 1)
|
|
1448
|
+
return null;
|
|
1449
|
+
const owner = owners[0];
|
|
1450
|
+
const methods = context.getNodesByQualifiedName(`${owner.qualifiedName}::${member}`)
|
|
1451
|
+
.filter((n) => n.language === 'php' && n.kind === 'method' && n.filePath === owner.filePath);
|
|
1452
|
+
if (methods.length !== 1)
|
|
1453
|
+
return null;
|
|
1454
|
+
return { original: ref, targetNodeId: methods[0].id, confidence: 0.95, resolvedBy: 'import' };
|
|
1455
|
+
}
|
|
1456
|
+
const JS_MODULE_LANGUAGES = new Set(['javascript', 'jsx', 'typescript', 'tsx', 'arkts']);
|
|
1457
|
+
/**
|
|
1458
|
+
* A module specifier written as a path — relative (`./x`, `../x`), rooted, or
|
|
1459
|
+
* an alias with a folder in it (`@/lib/x`, `~/x`, `$lib/x`) — rather than an
|
|
1460
|
+
* imported binding's name or a bare package (`react`, `lodash`).
|
|
1461
|
+
*/
|
|
1462
|
+
function isJsPathSpecifier(name) {
|
|
1463
|
+
return name.startsWith('./') || name.startsWith('../') || name === '.' || name === '..' ||
|
|
1464
|
+
(name.includes('/') && !/\s/.test(name) && !/^@[\w.-]+\/[\w.-]+$/.test(name));
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* A JS/TS `imports` reference that names a module by path. It names a FILE, not
|
|
1468
|
+
* a symbol, so it skips the resolver's name-exists pre-filter — a CommonJS
|
|
1469
|
+
* `require('./x')` has no import node of that name to pass it.
|
|
1470
|
+
*/
|
|
1471
|
+
function isJsPathImportRef(ref) {
|
|
1472
|
+
return ref.referenceKind === 'imports' && JS_MODULE_LANGUAGES.has(ref.language) && isJsPathSpecifier(ref.referenceName);
|
|
1473
|
+
}
|
|
1474
|
+
/** PHP reference kinds whose name is a class name, written as in the source. */
|
|
1475
|
+
const PHP_CLASS_NAME_REFS = new Set(['instantiates', 'extends', 'implements', 'references']);
|
|
1476
|
+
/**
|
|
1477
|
+
* A PHP class name written with a namespace in it (#2256). `use App\Fields as
|
|
1478
|
+
* Field;` aliases a namespace, so `new Field\FirstName()`, `extends Field\Base`
|
|
1479
|
+
* and `Field\FirstName::make()` all name `App\Fields\FirstName`. PHP reads a
|
|
1480
|
+
* qualified name one way: a leading `\` makes it absolute; otherwise a first
|
|
1481
|
+
* segment a `use` imports is replaced by what it imports, and any other name is
|
|
1482
|
+
* relative to the current namespace. Both extractors emit the written name
|
|
1483
|
+
* verbatim, and with no `.` or `::` in it the pre-filter would drop it.
|
|
1484
|
+
* undefined means the ref is not a qualified class name (or names a method the
|
|
1485
|
+
* class inherits); null means it is but no single project class has that name
|
|
1486
|
+
* — it lives outside the project — so name fallbacks must not guess.
|
|
1487
|
+
*/
|
|
1488
|
+
function resolvePhpQualifiedClassRef(ref, context) {
|
|
1489
|
+
if (ref.language !== 'php')
|
|
1490
|
+
return undefined;
|
|
1491
|
+
let name = ref.referenceName;
|
|
1492
|
+
let member = null;
|
|
1493
|
+
if (ref.referenceKind === 'calls') {
|
|
1494
|
+
// A static call on the class: `Field\FirstName::make()` is written `Field\FirstName.make`.
|
|
1495
|
+
const call = /^(.*\\[^\\.:]+)(?:\.|::)(\w+)$/.exec(name);
|
|
1496
|
+
if (!call)
|
|
1497
|
+
return undefined;
|
|
1498
|
+
name = call[1];
|
|
1499
|
+
member = call[2];
|
|
1500
|
+
}
|
|
1501
|
+
else if (!PHP_CLASS_NAME_REFS.has(ref.referenceKind)) {
|
|
1502
|
+
return undefined;
|
|
1503
|
+
}
|
|
1504
|
+
const separator = name.indexOf('\\');
|
|
1505
|
+
if (separator < 0)
|
|
1506
|
+
return undefined;
|
|
1507
|
+
let fqn;
|
|
1508
|
+
if (separator === 0) {
|
|
1509
|
+
fqn = name.slice(1);
|
|
1510
|
+
}
|
|
1511
|
+
else {
|
|
1512
|
+
const head = name.slice(0, separator);
|
|
1513
|
+
const imp = context.getImportMappings(ref.filePath, ref.language).find((i) => i.localName === head);
|
|
1514
|
+
if (imp) {
|
|
1515
|
+
fqn = imp.source.replace(/^\\/, '') + name.slice(separator);
|
|
1516
|
+
}
|
|
1517
|
+
else {
|
|
1518
|
+
// `namespace App;` applies until the next namespace statement.
|
|
1519
|
+
const namespace = context.getNodesInFile(ref.filePath)
|
|
1520
|
+
.filter((n) => n.kind === 'namespace' && n.startLine <= ref.line)
|
|
1521
|
+
.sort((a, b) => b.startLine - a.startLine)[0];
|
|
1522
|
+
fqn = namespace ? `${namespace.qualifiedName}\\${name}` : name;
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
const cut = fqn.lastIndexOf('\\');
|
|
1526
|
+
const qualifiedName = cut < 0 ? fqn : `${fqn.slice(0, cut)}::${fqn.slice(cut + 1)}`;
|
|
1527
|
+
const classes = context.getNodesByQualifiedName(qualifiedName)
|
|
1528
|
+
.filter((n) => n.language === 'php' && STATIC_MEMBER_CONTAINERS.has(n.kind));
|
|
1529
|
+
// A type mention can name something other than a class (a namespaced
|
|
1530
|
+
// constant or function), so it keeps the ordinary strategies.
|
|
1531
|
+
if (classes.length !== 1)
|
|
1532
|
+
return ref.referenceKind === 'references' ? undefined : null;
|
|
1533
|
+
const owner = classes[0];
|
|
1534
|
+
if (!member)
|
|
1535
|
+
return { original: ref, targetNodeId: owner.id, confidence: 0.95, resolvedBy: 'import' };
|
|
1536
|
+
const methods = context.getNodesByQualifiedName(`${owner.qualifiedName}::${member}`)
|
|
1537
|
+
.filter((n) => n.language === 'php' && n.kind === 'method' && n.filePath === owner.filePath);
|
|
1538
|
+
// A method the class inherits is left to the strategies that walk supertypes.
|
|
1539
|
+
if (methods.length !== 1)
|
|
1540
|
+
return undefined;
|
|
1541
|
+
return { original: ref, targetNodeId: methods[0].id, confidence: 0.95, resolvedBy: 'import' };
|
|
1542
|
+
}
|
|
1251
1543
|
function resolveViaImport(ref, context) {
|
|
1544
|
+
// A JS/TS module specifier — `import './polyfills'`, the module of `import x
|
|
1545
|
+
// from '../lib/a'`, a CommonJS `require('./application')` — names a FILE,
|
|
1546
|
+
// found the way the runtime finds it: extensions, `index` files, path
|
|
1547
|
+
// aliases. Matching the basename instead missed every extensionless one
|
|
1548
|
+
// (the common spelling) and could land on a same-named file elsewhere.
|
|
1549
|
+
if (isJsPathImportRef(ref)) {
|
|
1550
|
+
const file = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
|
|
1551
|
+
const fileNode = file && file !== ref.filePath ? context.getNodesInFile(file).find((n) => n.kind === 'file') : undefined;
|
|
1552
|
+
if (fileNode)
|
|
1553
|
+
return { original: ref, targetNodeId: fileNode.id, confidence: 0.9, resolvedBy: 'import' };
|
|
1554
|
+
}
|
|
1252
1555
|
// C/C++ #include references — resolve directly to the included file
|
|
1253
1556
|
// (file→file edge), bypassing symbol lookup. The extractor emits these
|
|
1254
1557
|
// with `referenceKind: 'imports'` and `referenceName: <include path>`
|
|
@@ -1438,17 +1741,31 @@ function resolveViaImport(ref, context) {
|
|
|
1438
1741
|
if (moduleFile)
|
|
1439
1742
|
return moduleFile;
|
|
1440
1743
|
}
|
|
1744
|
+
// Kotlin's `import app.model.Outer.Inner as Made`: `Made.create()` is the
|
|
1745
|
+
// aliased class's member, found by its FQN — nothing else binds the alias.
|
|
1746
|
+
if (ref.language === 'kotlin' && ref.referenceKind !== 'imports') {
|
|
1747
|
+
const aliased = resolveJvmAlias(ref, imports, context);
|
|
1748
|
+
if (aliased)
|
|
1749
|
+
return aliased;
|
|
1750
|
+
}
|
|
1441
1751
|
// Check if the reference name matches any import
|
|
1442
1752
|
for (const imp of imports) {
|
|
1443
1753
|
if (imp.localName === ref.referenceName || ref.referenceName.startsWith(imp.localName + '.')) {
|
|
1444
1754
|
// Resolve the import path
|
|
1445
|
-
|
|
1755
|
+
let resolvedPath = resolveImportPath(imp.source, ref.filePath, ref.language, context);
|
|
1756
|
+
// Named Python imports need the same absolute-module lookup as namespace
|
|
1757
|
+
// imports, including aliases used as receiver types (#1820).
|
|
1758
|
+
if (!resolvedPath && ref.language === 'python') {
|
|
1759
|
+
resolvedPath = findPythonModuleFile(imp.source, context, ref.filePath)?.filePath ?? null;
|
|
1760
|
+
}
|
|
1446
1761
|
if (resolvedPath) {
|
|
1447
1762
|
const exportedName = imp.isDefault ? 'default' : imp.exportedName;
|
|
1448
1763
|
const memberName = imp.isNamespace
|
|
1449
1764
|
? ref.referenceName.replace(imp.localName + '.', '')
|
|
1450
1765
|
: null;
|
|
1451
|
-
const targetNode = findExportedSymbol(resolvedPath, { isDefault: imp.isDefault, isNamespace: imp.isNamespace, exportedName, memberName }, ref.language, context, new Set())
|
|
1766
|
+
const targetNode = findExportedSymbol(resolvedPath, { isDefault: imp.isDefault, isNamespace: imp.isNamespace, exportedName, memberName }, ref.language, context, new Set()) ?? (ref.language === 'python'
|
|
1767
|
+
? pythonModuleSymbol(resolvedPath, memberName ?? exportedName, context, 0)
|
|
1768
|
+
: undefined);
|
|
1452
1769
|
if (targetNode) {
|
|
1453
1770
|
// `Foo.bar()` / `Foo.CONST` — a NAMED (non-namespace) class import
|
|
1454
1771
|
// accessed through a member. `findExportedSymbol` resolved `Foo` to
|
|
@@ -1480,6 +1797,9 @@ function resolveViaImport(ref, context) {
|
|
|
1480
1797
|
const literalMember = (0, name_matcher_1.resolveObjectLiteralMember)(targetNode, member, ref, context, 0.9, 'import');
|
|
1481
1798
|
if (literalMember)
|
|
1482
1799
|
return literalMember;
|
|
1800
|
+
const aliasMember = resolveObjectLiteralAlias(targetNode, member, ref, context);
|
|
1801
|
+
if (aliasMember)
|
|
1802
|
+
return aliasMember;
|
|
1483
1803
|
}
|
|
1484
1804
|
}
|
|
1485
1805
|
// An imported VALUE (singleton constant / shared instance) called
|
|
@@ -1495,6 +1815,13 @@ function resolveViaImport(ref, context) {
|
|
|
1495
1815
|
const instanceMember = resolveImportedInstanceMember(targetNode, ref, imp.localName, context);
|
|
1496
1816
|
if (instanceMember)
|
|
1497
1817
|
return instanceMember;
|
|
1818
|
+
// Finding a named Python import proves the receiver exists, not
|
|
1819
|
+
// its requested attribute. In particular, task.delay() enqueues
|
|
1820
|
+
// work; it does not call the imported task function directly.
|
|
1821
|
+
// Keep unknown members unresolved (including callback values)
|
|
1822
|
+
// instead of falling back to the receiver as their target.
|
|
1823
|
+
if (ref.language === 'python')
|
|
1824
|
+
return null;
|
|
1498
1825
|
}
|
|
1499
1826
|
return {
|
|
1500
1827
|
original: ref,
|
|
@@ -1539,11 +1866,19 @@ function resolvePythonModuleMember(ref, imports, context) {
|
|
|
1539
1866
|
// `import mod` / `import numpy as np` bind the module at `source` itself;
|
|
1540
1867
|
// `from . import certs` / `from pkg import mod` bind a SUBMODULE whose
|
|
1541
1868
|
// dotted path is the source joined with the imported name.
|
|
1869
|
+
//
|
|
1870
|
+
// Join with the EXPORTED name, not the local one: under
|
|
1871
|
+
// `from pkg import mod as alias` the receiver is `alias` but the module on
|
|
1872
|
+
// disk is `pkg.mod`, and building `pkg.alias` looked for a file that does
|
|
1873
|
+
// not exist — so the aliased form dropped its `calls` edge while the plain
|
|
1874
|
+
// form (where the two names coincide) worked (#1626). For an unaliased
|
|
1875
|
+
// import the two are identical, so this changes nothing there.
|
|
1876
|
+
const moduleName = imp.exportedName === '*' ? imp.localName : imp.exportedName;
|
|
1542
1877
|
const modulePath = imp.isNamespace
|
|
1543
1878
|
? imp.source
|
|
1544
1879
|
: imp.source.endsWith('.')
|
|
1545
|
-
? imp.source +
|
|
1546
|
-
: imp.source + '.' +
|
|
1880
|
+
? imp.source + moduleName
|
|
1881
|
+
: imp.source + '.' + moduleName;
|
|
1547
1882
|
// resolveImportPath only maps RELATIVE dotted paths (`.mod`, `..pkg.mod`); an
|
|
1548
1883
|
// ABSOLUTE package path (`pkg.module` from `from pkg import module`, or a bare
|
|
1549
1884
|
// `import pkg.mod`) resolves to null there, so fall back to the dotted-module
|
|
@@ -1557,13 +1892,10 @@ function resolvePythonModuleMember(ref, imports, context) {
|
|
|
1557
1892
|
}
|
|
1558
1893
|
if (!resolvedPath || resolvedPath === ref.filePath)
|
|
1559
1894
|
continue;
|
|
1560
|
-
// Find the member as a top-level definition in the module file
|
|
1561
|
-
// `method` so `mod.foo`
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
n.kind === 'class' ||
|
|
1565
|
-
n.kind === 'variable' ||
|
|
1566
|
-
n.kind === 'constant'));
|
|
1895
|
+
// Find the member as a top-level definition in the module file, or one it
|
|
1896
|
+
// re-exports (a package's `__init__.py`). Exclude `method` so `mod.foo`
|
|
1897
|
+
// never lands on a same-named class method.
|
|
1898
|
+
const target = pythonModuleSymbol(resolvedPath, member, context, 0);
|
|
1567
1899
|
if (target) {
|
|
1568
1900
|
return { original: ref, targetNodeId: target.id, confidence: 0.85, resolvedBy: 'import' };
|
|
1569
1901
|
}
|
|
@@ -1632,6 +1964,30 @@ function resolveLuaRequire(ref, context) {
|
|
|
1632
1964
|
}
|
|
1633
1965
|
return null;
|
|
1634
1966
|
}
|
|
1967
|
+
/**
|
|
1968
|
+
* `UploadApi.uploadARCapture()` where `UploadApi` is a NAMESPACE OBJECT — the
|
|
1969
|
+
* default-export façade most React Native API layers are written as:
|
|
1970
|
+
*
|
|
1971
|
+
* import { uploadARCapture } from './frames'
|
|
1972
|
+
* const UploadApi = { uploadARCapture, createFolder }
|
|
1973
|
+
* export default UploadApi
|
|
1974
|
+
*
|
|
1975
|
+
* The member is a shorthand (or `key: ident`) property whose value is a
|
|
1976
|
+
* binding of the object's file, not a function defined inside the literal,
|
|
1977
|
+
* so containment (`resolveObjectLiteralMember`) finds nothing and the call
|
|
1978
|
+
* landed on the constant — every cross-file caller of the API function went
|
|
1979
|
+
* missing. Read the literal's source, take the binding the member names, and
|
|
1980
|
+
* resolve it where the object's file would: a symbol declared there, else
|
|
1981
|
+
* through its own imports. Calls accept callable targets only.
|
|
1982
|
+
*/
|
|
1983
|
+
function resolveObjectLiteralAlias(container, member, ref, context) {
|
|
1984
|
+
if (container.kind !== 'constant' && container.kind !== 'variable')
|
|
1985
|
+
return null;
|
|
1986
|
+
if (!JS_FAMILY_FILE.test(container.filePath))
|
|
1987
|
+
return null;
|
|
1988
|
+
const resolved = (0, name_matcher_1.resolveObjectLiteralBinding)(container, member, ref, context);
|
|
1989
|
+
return resolved ? { ...resolved, confidence: 0.9, resolvedBy: 'import' } : null;
|
|
1990
|
+
}
|
|
1635
1991
|
function resolveModuleImportToFile(ref, imports, context) {
|
|
1636
1992
|
if (ref.referenceKind !== 'imports')
|
|
1637
1993
|
return null;
|
|
@@ -1653,9 +2009,12 @@ function resolveModuleImportToFile(ref, imports, context) {
|
|
|
1653
2009
|
}
|
|
1654
2010
|
else if (ref.language === 'python') {
|
|
1655
2011
|
// `from . import certs` — the imported NAME is a submodule of the source.
|
|
2012
|
+
// As in resolvePythonModuleMember, use the exported name so an alias
|
|
2013
|
+
// still links to the real module file (#1626).
|
|
2014
|
+
const moduleName = imp.exportedName === '*' ? imp.localName : imp.exportedName;
|
|
1656
2015
|
modulePath = imp.source.endsWith('.')
|
|
1657
|
-
? imp.source +
|
|
1658
|
-
: imp.source + '.' +
|
|
2016
|
+
? imp.source + moduleName
|
|
2017
|
+
: imp.source + '.' + moduleName;
|
|
1659
2018
|
}
|
|
1660
2019
|
else {
|
|
1661
2020
|
// A named TS/JS import binds a symbol, not a module — leave it alone.
|
|
@@ -1689,21 +2048,86 @@ function resolveModuleImportToFile(ref, imports, context) {
|
|
|
1689
2048
|
* no edge. Shared by absolute `import a.b.c` and absolute `from a.b import c`
|
|
1690
2049
|
* (where `c` is a submodule) resolution.
|
|
1691
2050
|
*/
|
|
2051
|
+
/**
|
|
2052
|
+
* Per-context memo for findPythonModuleFile: module path → the `<mod>.py` and
|
|
2053
|
+
* `<mod>/__init__.py` file nodes whose path ends with it, in name-lookup
|
|
2054
|
+
* order. Only the importing file's own path is excluded per call, so taking
|
|
2055
|
+
* the first survivor returns the node the unmemoized scan found. Without it,
|
|
2056
|
+
* every ref naming a module outside the project (`from unittest import mock`)
|
|
2057
|
+
* rescanned every `__init__.py` in the tree. Same stable window as the name
|
|
2058
|
+
* caches; dropped by clearImportResolverMemos.
|
|
2059
|
+
*/
|
|
2060
|
+
const pythonModuleFileMemos = new WeakMap();
|
|
2061
|
+
/**
|
|
2062
|
+
* A top-level class / function / value named `name` in a Python module, or
|
|
2063
|
+
* one the module re-exports — `from .users import *`, `from .users import
|
|
2064
|
+
* User` — a few packages deep. netbox's `from users.models import User` names
|
|
2065
|
+
* `users/models/__init__.py`, which star-imports `.users`, where `User` is.
|
|
2066
|
+
*/
|
|
2067
|
+
const PY_MODULE_SYMBOLS = new WeakMap();
|
|
2068
|
+
function pythonModuleSymbol(file, name, context, depth) {
|
|
2069
|
+
let memo = PY_MODULE_SYMBOLS.get(context);
|
|
2070
|
+
if (!memo)
|
|
2071
|
+
PY_MODULE_SYMBOLS.set(context, (memo = new Map()));
|
|
2072
|
+
const key = `${file}\0${name}`;
|
|
2073
|
+
const hit = memo.get(key);
|
|
2074
|
+
if (hit !== undefined)
|
|
2075
|
+
return hit ?? undefined;
|
|
2076
|
+
// (A cycle of star imports reads as "not here" while it is being walked.)
|
|
2077
|
+
memo.set(key, null);
|
|
2078
|
+
const found = pythonModuleSymbolUncached(file, name, context, depth);
|
|
2079
|
+
memo.set(key, found ?? null);
|
|
2080
|
+
return found;
|
|
2081
|
+
}
|
|
2082
|
+
function pythonModuleSymbolUncached(file, name, context, depth) {
|
|
2083
|
+
const own = context.getNodesInFile(file).find((n) => n.name === name && !n.qualifiedName.includes('::') &&
|
|
2084
|
+
(n.kind === 'class' || n.kind === 'function' || n.kind === 'variable' || n.kind === 'constant'));
|
|
2085
|
+
if (own || depth >= 3)
|
|
2086
|
+
return own;
|
|
2087
|
+
// Re-exported by name (`from .users import User`), else through a star import
|
|
2088
|
+
// (`from .users import *` — not among the import mappings, so read here).
|
|
2089
|
+
const sources = context.getImportMappings(file, 'python')
|
|
2090
|
+
.filter((imp) => !imp.isNamespace && imp.localName === name)
|
|
2091
|
+
.map((imp) => ({ source: imp.source, exported: imp.exportedName }));
|
|
2092
|
+
for (const m of (context.readFile(file) ?? '').matchAll(/^\s*from\s+([\w.]+)\s+import\s+\*/gm)) {
|
|
2093
|
+
sources.push({ source: m[1], exported: name });
|
|
2094
|
+
}
|
|
2095
|
+
for (const { source, exported } of sources) {
|
|
2096
|
+
const target = resolveImportPath(source, file, 'python', context) ?? findPythonModuleFile(source, context, file)?.filePath ?? null;
|
|
2097
|
+
if (!target || target === file)
|
|
2098
|
+
continue;
|
|
2099
|
+
const found = pythonModuleSymbol(target, exported, context, depth + 1);
|
|
2100
|
+
if (found)
|
|
2101
|
+
return found;
|
|
2102
|
+
}
|
|
2103
|
+
return undefined;
|
|
2104
|
+
}
|
|
1692
2105
|
function findPythonModuleFile(mod, context, excludeFilePath) {
|
|
1693
2106
|
if (!mod || mod.startsWith('.'))
|
|
1694
2107
|
return null; // relative imports handled elsewhere
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
.
|
|
1705
|
-
|
|
1706
|
-
|
|
2108
|
+
let memo = pythonModuleFileMemos.get(context);
|
|
2109
|
+
if (!memo) {
|
|
2110
|
+
memo = new Map();
|
|
2111
|
+
pythonModuleFileMemos.set(context, memo);
|
|
2112
|
+
}
|
|
2113
|
+
let files = memo.get(mod);
|
|
2114
|
+
if (!files) {
|
|
2115
|
+
const rel = mod.replace(/\./g, '/');
|
|
2116
|
+
const lastSeg = mod.split('.').pop();
|
|
2117
|
+
const endsWith = (p, want) => p === want || p.endsWith('/' + want);
|
|
2118
|
+
files = {
|
|
2119
|
+
module: context
|
|
2120
|
+
.getNodesByName(`${lastSeg}.py`)
|
|
2121
|
+
.filter((n) => n.kind === 'file' && endsWith(n.filePath, `${rel}.py`)),
|
|
2122
|
+
pkg: context
|
|
2123
|
+
.getNodesByName('__init__.py')
|
|
2124
|
+
.filter((n) => n.kind === 'file' && endsWith(n.filePath, `${rel}/__init__.py`)),
|
|
2125
|
+
};
|
|
2126
|
+
memo.set(mod, files);
|
|
2127
|
+
}
|
|
2128
|
+
return (files.module.find((n) => n.filePath !== excludeFilePath) ??
|
|
2129
|
+
files.pkg.find((n) => n.filePath !== excludeFilePath) ??
|
|
2130
|
+
null);
|
|
1707
2131
|
}
|
|
1708
2132
|
/**
|
|
1709
2133
|
* Resolve a Python ABSOLUTE dotted module import (`import a.b.c`) to its file —
|
|
@@ -2016,17 +2440,33 @@ function findExportedSymbolWalk(filePath, want, language, context, visited, dept
|
|
|
2016
2440
|
// `.ts`/`.tsx` `export default fn`/`class` case. Without the component
|
|
2017
2441
|
// branch, an `export { default as X } from './X.svelte'` barrel never
|
|
2018
2442
|
// resolves and the component shows a false 0 callers (#629).
|
|
2019
|
-
|
|
2443
|
+
// A component file IS its default export; otherwise the statement that
|
|
2444
|
+
// names the binding beats the first-exported-function guess.
|
|
2445
|
+
const direct = exportIndex.defaultComponent ?? defaultExportBindingNode(filePath, exportIndex, context) ?? exportIndex.defaultFnClass;
|
|
2020
2446
|
if (direct)
|
|
2021
2447
|
return direct;
|
|
2448
|
+
// CommonJS: `module.exports = createApplication`, or `= require('./lib/express')`.
|
|
2449
|
+
const commonJs = commonJsDefaultExport(filePath, context);
|
|
2450
|
+
if (commonJs?.source) {
|
|
2451
|
+
const next = resolveImportPath(commonJs.source, filePath, language, context);
|
|
2452
|
+
if (next)
|
|
2453
|
+
return findExportedSymbol(next, want, language, context, visited, depth + 1);
|
|
2454
|
+
}
|
|
2455
|
+
else if (commonJs?.name) {
|
|
2456
|
+
const bound = nodesInFileNamed(filePath, commonJs.name, context)
|
|
2457
|
+
.filter((n) => DEFAULT_BINDING_KINDS.has(n.kind))
|
|
2458
|
+
.sort((a, b) => a.startLine - b.startLine || a.startColumn - b.startColumn)[0];
|
|
2459
|
+
if (bound)
|
|
2460
|
+
return bound;
|
|
2461
|
+
}
|
|
2022
2462
|
}
|
|
2023
2463
|
else if (want.isNamespace && want.memberName) {
|
|
2024
|
-
const direct = exportIndex
|
|
2464
|
+
const direct = exportedByName(filePath, exportIndex, want.memberName, context);
|
|
2025
2465
|
if (direct)
|
|
2026
2466
|
return direct;
|
|
2027
2467
|
}
|
|
2028
2468
|
else {
|
|
2029
|
-
const direct = exportIndex
|
|
2469
|
+
const direct = exportedByName(filePath, exportIndex, want.exportedName, context);
|
|
2030
2470
|
if (direct)
|
|
2031
2471
|
return direct;
|
|
2032
2472
|
}
|
|
@@ -2034,8 +2474,9 @@ function findExportedSymbolWalk(filePath, want, language, context, visited, dept
|
|
|
2034
2474
|
const reExports = context.getReExports?.(filePath, language) ?? [];
|
|
2035
2475
|
if (reExports.length === 0)
|
|
2036
2476
|
return undefined;
|
|
2037
|
-
// Look for explicit `export { want } from './other'` (with optional rename)
|
|
2038
|
-
|
|
2477
|
+
// Look for explicit `export { want } from './other'` (with optional rename) — for
|
|
2478
|
+
// `ns.member` through `import * as ns`, the member is the name wanted.
|
|
2479
|
+
const targetName = want.isDefault ? 'default' : want.isNamespace && want.memberName ? want.memberName : want.exportedName;
|
|
2039
2480
|
for (const rex of reExports) {
|
|
2040
2481
|
if (rex.kind === 'named' && rex.exportedName === targetName) {
|
|
2041
2482
|
const next = resolveImportPath(rex.source, filePath, language, context);
|
|
@@ -2053,6 +2494,19 @@ function findExportedSymbolWalk(filePath, want, language, context, visited, dept
|
|
|
2053
2494
|
return chained;
|
|
2054
2495
|
}
|
|
2055
2496
|
}
|
|
2497
|
+
// `z.core.util.fn` through `export * as core from './core'`: the member continues in that module.
|
|
2498
|
+
if (want.isNamespace && want.memberName) {
|
|
2499
|
+
const dot = want.memberName.indexOf('.');
|
|
2500
|
+
const head = dot < 0 ? want.memberName : want.memberName.slice(0, dot);
|
|
2501
|
+
const rex = dot < 0 ? undefined : reExports.find((r) => r.kind === 'namespace' && r.exportedName === head);
|
|
2502
|
+
if (rex) {
|
|
2503
|
+
const next = resolveImportPath(rex.source, filePath, language, context);
|
|
2504
|
+
const rest = want.memberName.slice(dot + 1);
|
|
2505
|
+
return next
|
|
2506
|
+
? findExportedSymbol(next, { ...want, exportedName: rest.split('.')[0], memberName: rest }, language, context, visited, depth + 1)
|
|
2507
|
+
: undefined;
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2056
2510
|
// 3. Wildcard re-export: `export * from './other'` — try every
|
|
2057
2511
|
// forwarding source. This is the barrel-of-barrels case.
|
|
2058
2512
|
for (const rex of reExports) {
|
|
@@ -2146,4 +2600,132 @@ function resolveStaticMember(container, ref, localName, context) {
|
|
|
2146
2600
|
}
|
|
2147
2601
|
return candidates[0];
|
|
2148
2602
|
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Rust `use` declarations, flattened to `localName → full path`.
|
|
2605
|
+
*
|
|
2606
|
+
* Rust is the one supported language with NO `ImportMapping` extraction (see
|
|
2607
|
+
* `extractImportMappings`), so this is the only channel that can tell whether
|
|
2608
|
+
* a bare type name in a Rust file was brought in by a `use`. Handles nested
|
|
2609
|
+
* groups (`use a::{b::C, d as E}`), globs (skipped — they bind no single
|
|
2610
|
+
* name), and `as` aliases.
|
|
2611
|
+
*/
|
|
2612
|
+
function collectRustUseBindings(content) {
|
|
2613
|
+
const out = new Map();
|
|
2614
|
+
// Expand one level of `{...}` at a time so `a::{b::{C, D}, E}` flattens.
|
|
2615
|
+
const expand = (spec) => {
|
|
2616
|
+
const open = spec.indexOf('{');
|
|
2617
|
+
if (open === -1)
|
|
2618
|
+
return [spec.trim()];
|
|
2619
|
+
const prefix = spec.slice(0, open);
|
|
2620
|
+
let depth = 0;
|
|
2621
|
+
let close = -1;
|
|
2622
|
+
for (let i = open; i < spec.length; i++) {
|
|
2623
|
+
if (spec[i] === '{')
|
|
2624
|
+
depth++;
|
|
2625
|
+
else if (spec[i] === '}') {
|
|
2626
|
+
depth--;
|
|
2627
|
+
if (depth === 0) {
|
|
2628
|
+
close = i;
|
|
2629
|
+
break;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
if (close === -1)
|
|
2634
|
+
return [];
|
|
2635
|
+
const suffix = spec.slice(close + 1);
|
|
2636
|
+
const inner = spec.slice(open + 1, close);
|
|
2637
|
+
const parts = [];
|
|
2638
|
+
let depth2 = 0;
|
|
2639
|
+
let start = 0;
|
|
2640
|
+
for (let i = 0; i <= inner.length; i++) {
|
|
2641
|
+
const ch = inner[i];
|
|
2642
|
+
if (ch === '{')
|
|
2643
|
+
depth2++;
|
|
2644
|
+
else if (ch === '}')
|
|
2645
|
+
depth2--;
|
|
2646
|
+
if (i === inner.length || (ch === ',' && depth2 === 0)) {
|
|
2647
|
+
const seg = inner.slice(start, i).trim();
|
|
2648
|
+
if (seg)
|
|
2649
|
+
parts.push(seg);
|
|
2650
|
+
start = i + 1;
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
return parts.flatMap((p) => expand(prefix + p + suffix));
|
|
2654
|
+
};
|
|
2655
|
+
// `use` items end at the first `;`. Attributes/visibility (`pub use`) are
|
|
2656
|
+
// irrelevant to the binding itself.
|
|
2657
|
+
const useRe = /(^|\n)\s*(?:pub(?:\([^)]*\))?\s+)?use\s+([^;]+);/g;
|
|
2658
|
+
let m;
|
|
2659
|
+
while ((m = useRe.exec(content)) !== null) {
|
|
2660
|
+
for (const spec of expand(m[2].replace(/\s+/g, ' '))) {
|
|
2661
|
+
const aliasMatch = /^(.*?)\s+as\s+([A-Za-z_]\w*)$/.exec(spec);
|
|
2662
|
+
const rawPath = (aliasMatch ? aliasMatch[1] : spec).trim();
|
|
2663
|
+
if (!rawPath || rawPath.endsWith('*'))
|
|
2664
|
+
continue;
|
|
2665
|
+
const segments = rawPath.split('::').map((s) => s.trim()).filter(Boolean);
|
|
2666
|
+
const leaf = segments[segments.length - 1];
|
|
2667
|
+
if (!leaf)
|
|
2668
|
+
continue;
|
|
2669
|
+
const local = aliasMatch ? aliasMatch[2] : leaf;
|
|
2670
|
+
out.set(local, segments.join('::'));
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
return out;
|
|
2674
|
+
}
|
|
2675
|
+
/**
|
|
2676
|
+
* Is `name`, as used in `ref`'s file, bound by an import whose module lives
|
|
2677
|
+
* OUTSIDE the repository?
|
|
2678
|
+
*
|
|
2679
|
+
* When it is, no in-repo node can be the referent: the symbol is defined in a
|
|
2680
|
+
* third-party crate/package, and any same-named local symbol the name-matcher
|
|
2681
|
+
* finds is a coincidence. Rust `use std::error::Error;` + `impl Error for
|
|
2682
|
+
* MapperError {}` bound to a local `MapperError::Error` variant, and once
|
|
2683
|
+
* non-type kinds were filtered out it simply moved to an unrelated local
|
|
2684
|
+
* `type Error` alias — restricting kinds alone RELOCATES the false edge
|
|
2685
|
+
* instead of removing it, so locality has to be checked too.
|
|
2686
|
+
*
|
|
2687
|
+
* Answers only when it can be CERTAIN, because a false "yes" deletes a real
|
|
2688
|
+
* edge. Two languages qualify, each with an oracle that cannot be wrong:
|
|
2689
|
+
*
|
|
2690
|
+
* - **Rust** — the `use` path is rooted at a standard-library crate
|
|
2691
|
+
* (`std`/`core`/`alloc`/`proc_macro`), which by definition ships outside
|
|
2692
|
+
* any repository. Deliberately NOT generalized to "the module path doesn't
|
|
2693
|
+
* resolve to a file": a crate can re-export another workspace crate's
|
|
2694
|
+
* modules (`pub use pupil_core::{ports, domain};`), so `crate::ports::X`
|
|
2695
|
+
* has no `src/ports/` directory to walk yet is entirely in-repo — that
|
|
2696
|
+
* generalization measured 13 real trait implementations deleted.
|
|
2697
|
+
* - **ES modules** — `isExternalImport`, which already accounts for tsconfig
|
|
2698
|
+
* path aliases and monorepo workspace packages.
|
|
2699
|
+
*
|
|
2700
|
+
* Everything else returns false and resolves exactly as before. JVM and Python
|
|
2701
|
+
* imports notably do NOT go through `resolveImportPath` (they have dedicated
|
|
2702
|
+
* FQN/module matchers), so there is no trustworthy oracle to consult here.
|
|
2703
|
+
*/
|
|
2704
|
+
function isBoundToOutOfRepoImport(ref, context) {
|
|
2705
|
+
const name = ref.referenceName;
|
|
2706
|
+
if (name.includes('::') || name.includes('.'))
|
|
2707
|
+
return false; // qualified refs resolve by path
|
|
2708
|
+
if (ref.language === 'rust') {
|
|
2709
|
+
const content = context.readFile(ref.filePath);
|
|
2710
|
+
if (!content)
|
|
2711
|
+
return false;
|
|
2712
|
+
const usePath = collectRustUseBindings(content).get(name);
|
|
2713
|
+
if (!usePath)
|
|
2714
|
+
return false;
|
|
2715
|
+
const segments = usePath.split('::');
|
|
2716
|
+
if (segments.length < 2 || !RUST_STDLIB_ROOTS.has(segments[0]))
|
|
2717
|
+
return false;
|
|
2718
|
+
// 2015-edition crate-relative paths can shadow a stdlib root with a local
|
|
2719
|
+
// module of the same name — if the path walks to a real file, it's local.
|
|
2720
|
+
return resolveRustModuleFile(segments.slice(0, -1), ref.filePath, context) === null;
|
|
2721
|
+
}
|
|
2722
|
+
if (!ESM_IMPORT_LANGUAGES.has(ref.language))
|
|
2723
|
+
return false;
|
|
2724
|
+
for (const imp of context.getImportMappings(ref.filePath, ref.language)) {
|
|
2725
|
+
if (imp.localName !== name)
|
|
2726
|
+
continue;
|
|
2727
|
+
return isExternalImport(imp.source, ref.language, context);
|
|
2728
|
+
}
|
|
2729
|
+
return false;
|
|
2730
|
+
}
|
|
2149
2731
|
//# sourceMappingURL=import-resolver.js.map
|