@lzehrung/codegraph 2.3.31 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -141
- package/codegraph-skill/codegraph/SKILL.md +8 -6
- package/dist/agent/artifact.d.ts +2 -0
- package/dist/agent/artifact.d.ts.map +1 -1
- package/dist/agent/artifact.js.map +1 -1
- package/dist/agent/call-hierarchy.js +2 -4
- package/dist/agent/call-hierarchy.js.map +1 -1
- package/dist/agent/explore.d.ts +1 -1
- package/dist/agent/explore.d.ts.map +1 -1
- package/dist/agent/explore.js +3 -2
- package/dist/agent/explore.js.map +1 -1
- package/dist/agent/refactor-plan.js +2 -4
- package/dist/agent/refactor-plan.js.map +1 -1
- package/dist/agent/rename-preview.d.ts.map +1 -1
- package/dist/agent/rename-preview.js +4 -3
- package/dist/agent/rename-preview.js.map +1 -1
- package/dist/agent/search.d.ts.map +1 -1
- package/dist/agent/search.js +5 -3
- package/dist/agent/search.js.map +1 -1
- package/dist/agent/semantic-symbols.d.ts.map +1 -1
- package/dist/agent/semantic-symbols.js +2 -3
- package/dist/agent/semantic-symbols.js.map +1 -1
- package/dist/agent/session.d.ts +3 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +10 -2
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/type-hierarchy.js +2 -4
- package/dist/agent/type-hierarchy.js.map +1 -1
- package/dist/agent/workspace-symbols.d.ts.map +1 -1
- package/dist/agent/workspace-symbols.js +2 -3
- package/dist/agent/workspace-symbols.js.map +1 -1
- package/dist/agent-tools.d.ts +0 -4
- package/dist/agent-tools.d.ts.map +1 -1
- package/dist/agent-tools.js +3 -6
- package/dist/agent-tools.js.map +1 -1
- package/dist/analysis-summary.d.ts +8 -4
- package/dist/analysis-summary.d.ts.map +1 -1
- package/dist/analysis-summary.js +15 -66
- package/dist/analysis-summary.js.map +1 -1
- package/dist/bin/cli.js +51145 -41770
- package/dist/bin/query-index-worker.js +122 -82
- package/dist/cli/affected.d.ts.map +1 -1
- package/dist/cli/affected.js +4 -1
- package/dist/cli/affected.js.map +1 -1
- package/dist/cli/command-catalog.js +1 -1
- package/dist/cli/command-catalog.js.map +1 -1
- package/dist/cli/command-table.d.ts.map +1 -1
- package/dist/cli/command-table.js +9 -17
- package/dist/cli/command-table.js.map +1 -1
- package/dist/cli/context.js +10 -10
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/drift.d.ts +0 -2
- package/dist/cli/drift.d.ts.map +1 -1
- package/dist/cli/drift.js +0 -1
- package/dist/cli/drift.js.map +1 -1
- package/dist/cli/graph-delta.d.ts +0 -2
- package/dist/cli/graph-delta.d.ts.map +1 -1
- package/dist/cli/graph-delta.js +0 -4
- package/dist/cli/graph-delta.js.map +1 -1
- package/dist/cli/graph-queries.d.ts.map +1 -1
- package/dist/cli/graph-queries.js +27 -1
- package/dist/cli/graph-queries.js.map +1 -1
- package/dist/cli/graph.d.ts +0 -3
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +4 -14
- package/dist/cli/graph.js.map +1 -1
- package/dist/cli/help.d.ts +34 -34
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +9 -14
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/impact.d.ts +0 -2
- package/dist/cli/impact.d.ts.map +1 -1
- package/dist/cli/impact.js +0 -1
- package/dist/cli/impact.js.map +1 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +5 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/inspect.d.ts +0 -2
- package/dist/cli/inspect.d.ts.map +1 -1
- package/dist/cli/inspect.js +5 -8
- package/dist/cli/inspect.js.map +1 -1
- package/dist/cli/invocation-context.d.ts +0 -3
- package/dist/cli/invocation-context.d.ts.map +1 -1
- package/dist/cli/invocation-context.js +4 -16
- package/dist/cli/invocation-context.js.map +1 -1
- package/dist/cli/navigation.d.ts +0 -2
- package/dist/cli/navigation.d.ts.map +1 -1
- package/dist/cli/navigation.js +0 -1
- package/dist/cli/navigation.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +4 -14
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/review.d.ts +0 -2
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +0 -5
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/root-policy.d.ts +0 -2
- package/dist/cli/root-policy.d.ts.map +1 -1
- package/dist/cli/root-policy.js +0 -8
- package/dist/cli/root-policy.js.map +1 -1
- package/dist/cli/server.d.ts.map +1 -1
- package/dist/cli/server.js +0 -2
- package/dist/cli/server.js.map +1 -1
- package/dist/drift/artifact.d.ts.map +1 -1
- package/dist/drift/artifact.js +15 -18
- package/dist/drift/artifact.js.map +1 -1
- package/dist/drift/compare.js +1 -1
- package/dist/drift/compare.js.map +1 -1
- package/dist/drift/git.d.ts.map +1 -1
- package/dist/drift/git.js +0 -1
- package/dist/drift/git.js.map +1 -1
- package/dist/drift/snapshot.d.ts.map +1 -1
- package/dist/drift/snapshot.js +5 -7
- package/dist/drift/snapshot.js.map +1 -1
- package/dist/drift/types.d.ts +2 -2
- package/dist/drift/types.d.ts.map +1 -1
- package/dist/drift/types.js.map +1 -1
- package/dist/duplicates/unit-cache.d.ts +0 -1
- package/dist/duplicates/unit-cache.d.ts.map +1 -1
- package/dist/duplicates/unit-cache.js +3 -11
- package/dist/duplicates/unit-cache.js.map +1 -1
- package/dist/duplicates/units.d.ts +5 -5
- package/dist/duplicates/units.d.ts.map +1 -1
- package/dist/duplicates/units.js +25 -88
- package/dist/duplicates/units.js.map +1 -1
- package/dist/graph-builder.d.ts +0 -6
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +6 -11
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-edge-collector.d.ts +4 -6
- package/dist/graph-edge-collector.d.ts.map +1 -1
- package/dist/graph-edge-collector.js +31 -26
- package/dist/graph-edge-collector.js.map +1 -1
- package/dist/graphs/angularjs.d.ts.map +1 -1
- package/dist/graphs/angularjs.js +2 -1
- package/dist/graphs/angularjs.js.map +1 -1
- package/dist/graphs/edge-resolution.d.ts +4 -1
- package/dist/graphs/edge-resolution.d.ts.map +1 -1
- package/dist/graphs/edge-resolution.js +24 -76
- package/dist/graphs/edge-resolution.js.map +1 -1
- package/dist/graphs/specifiers.d.ts +4 -13
- package/dist/graphs/specifiers.d.ts.map +1 -1
- package/dist/graphs/specifiers.js +80 -173
- package/dist/graphs/specifiers.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/ast.d.ts +20 -0
- package/dist/graphs/symbol-graph-detailed/ast.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/ast.js +154 -15
- package/dist/graphs/symbol-graph-detailed/ast.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts +60 -8
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.js +997 -168
- package/dist/graphs/symbol-graph-detailed/edge-passes.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/import-aliases.d.ts +2 -1
- package/dist/graphs/symbol-graph-detailed/import-aliases.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/import-aliases.js +150 -7
- package/dist/graphs/symbol-graph-detailed/import-aliases.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/member-chains.d.ts +1 -0
- package/dist/graphs/symbol-graph-detailed/member-chains.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/member-chains.js +3 -1
- package/dist/graphs/symbol-graph-detailed/member-chains.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts +141 -25
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.js +1015 -166
- package/dist/graphs/symbol-graph-detailed/receiver-calls.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed.js +449 -46
- package/dist/graphs/symbol-graph-detailed.js.map +1 -1
- package/dist/graphs/symbol-graph.d.ts +2 -0
- package/dist/graphs/symbol-graph.d.ts.map +1 -1
- package/dist/graphs/symbol-graph.js +34 -16
- package/dist/graphs/symbol-graph.js.map +1 -1
- package/dist/graphs/types.d.ts +0 -4
- package/dist/graphs/types.d.ts.map +1 -1
- package/dist/graphs.d.ts +1 -1
- package/dist/graphs.d.ts.map +1 -1
- package/dist/impact/call-compatibility/providers/index.d.ts +4 -4
- package/dist/impact/call-compatibility/providers/index.d.ts.map +1 -1
- package/dist/impact/call-compatibility/providers/index.js +6 -6
- package/dist/impact/call-compatibility/providers/index.js.map +1 -1
- package/dist/impact/call-compatibility/providers/types.d.ts +2 -0
- package/dist/impact/call-compatibility/providers/types.d.ts.map +1 -1
- package/dist/impact/call-compatibility/types.d.ts +6 -0
- package/dist/impact/call-compatibility/types.d.ts.map +1 -1
- package/dist/impact/call-compatibility.d.ts.map +1 -1
- package/dist/impact/call-compatibility.js +316 -526
- package/dist/impact/call-compatibility.js.map +1 -1
- package/dist/impact/map.js +1 -0
- package/dist/impact/map.js.map +1 -1
- package/dist/impact/reference-cache.d.ts.map +1 -1
- package/dist/impact/reference-cache.js +2 -2
- package/dist/impact/reference-cache.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexer/ambiguous-resolution.d.ts +11 -0
- package/dist/indexer/ambiguous-resolution.d.ts.map +1 -0
- package/dist/indexer/ambiguous-resolution.js +19 -0
- package/dist/indexer/ambiguous-resolution.js.map +1 -0
- package/dist/indexer/build-cache/module-cache.d.ts +39 -1
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache/module-cache.js +218 -21
- package/dist/indexer/build-cache/module-cache.js.map +1 -1
- package/dist/indexer/build-cache/options.d.ts +30 -44
- package/dist/indexer/build-cache/options.d.ts.map +1 -1
- package/dist/indexer/build-cache/options.js +32 -71
- package/dist/indexer/build-cache/options.js.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.d.ts +3 -3
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.js +164 -84
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
- package/dist/indexer/build-cache/reports.d.ts +0 -2
- package/dist/indexer/build-cache/reports.d.ts.map +1 -1
- package/dist/indexer/build-cache/reports.js +0 -97
- package/dist/indexer/build-cache/reports.js.map +1 -1
- package/dist/indexer/build-cache/resolver-environment.d.ts.map +1 -1
- package/dist/indexer/build-cache/resolver-environment.js +32 -2
- package/dist/indexer/build-cache/resolver-environment.js.map +1 -1
- package/dist/indexer/build-cache.d.ts +2 -2
- package/dist/indexer/build-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache.js +2 -2
- package/dist/indexer/build-cache.js.map +1 -1
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +656 -71
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/build-workers.d.ts.map +1 -1
- package/dist/indexer/build-workers.js +9 -9
- package/dist/indexer/build-workers.js.map +1 -1
- package/dist/indexer/call-hierarchy.js +1 -1
- package/dist/indexer/call-hierarchy.js.map +1 -1
- package/dist/indexer/callable-identity.d.ts +24 -0
- package/dist/indexer/callable-identity.d.ts.map +1 -0
- package/dist/indexer/callable-identity.js +111 -0
- package/dist/indexer/callable-identity.js.map +1 -0
- package/dist/indexer/compilation-units.d.ts +103 -0
- package/dist/indexer/compilation-units.d.ts.map +1 -0
- package/dist/indexer/compilation-units.js +607 -0
- package/dist/indexer/compilation-units.js.map +1 -0
- package/dist/indexer/cpp-callables.d.ts +25 -0
- package/dist/indexer/cpp-callables.d.ts.map +1 -0
- package/dist/indexer/cpp-callables.js +562 -0
- package/dist/indexer/cpp-callables.js.map +1 -0
- package/dist/indexer/declaration-visibility.d.ts +43 -2
- package/dist/indexer/declaration-visibility.d.ts.map +1 -1
- package/dist/indexer/declaration-visibility.js +158 -2
- package/dist/indexer/declaration-visibility.js.map +1 -1
- package/dist/indexer/expand-star-imports.d.ts +6 -1
- package/dist/indexer/expand-star-imports.d.ts.map +1 -1
- package/dist/indexer/expand-star-imports.js +131 -37
- package/dist/indexer/expand-star-imports.js.map +1 -1
- package/dist/indexer/finalize.d.ts.map +1 -1
- package/dist/indexer/finalize.js +0 -1
- package/dist/indexer/finalize.js.map +1 -1
- package/dist/indexer/import-resolution-tables.d.ts +72 -0
- package/dist/indexer/import-resolution-tables.d.ts.map +1 -0
- package/dist/indexer/import-resolution-tables.js +137 -0
- package/dist/indexer/import-resolution-tables.js.map +1 -0
- package/dist/indexer/import-types.d.ts +54 -0
- package/dist/indexer/import-types.d.ts.map +1 -1
- package/dist/indexer/import-types.js +24 -1
- package/dist/indexer/import-types.js.map +1 -1
- package/dist/indexer/imports/context.d.ts +16 -1
- package/dist/indexer/imports/context.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.d.ts +13 -1
- package/dist/indexer/imports/import-binding-tables.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.js +149 -30
- package/dist/indexer/imports/import-binding-tables.js.map +1 -1
- package/dist/indexer/imports/js-text-imports.js +4 -4
- package/dist/indexer/imports/js-text-imports.js.map +1 -1
- package/dist/indexer/imports/native-captures.d.ts.map +1 -1
- package/dist/indexer/imports/native-captures.js +24 -6
- package/dist/indexer/imports/native-captures.js.map +1 -1
- package/dist/indexer/imports/python.d.ts +10 -2
- package/dist/indexer/imports/python.d.ts.map +1 -1
- package/dist/indexer/imports/python.js +128 -112
- package/dist/indexer/imports/python.js.map +1 -1
- package/dist/indexer/imports/text-import-extractors.d.ts.map +1 -1
- package/dist/indexer/imports/text-import-extractors.js +68 -19
- package/dist/indexer/imports/text-import-extractors.js.map +1 -1
- package/dist/indexer/imports.d.ts +3 -4
- package/dist/indexer/imports.d.ts.map +1 -1
- package/dist/indexer/imports.js +116 -72
- package/dist/indexer/imports.js.map +1 -1
- package/dist/indexer/incremental-plan.d.ts +33 -0
- package/dist/indexer/incremental-plan.d.ts.map +1 -1
- package/dist/indexer/incremental-plan.js +203 -1
- package/dist/indexer/incremental-plan.js.map +1 -1
- package/dist/indexer/locals-and-exports.d.ts +3 -2
- package/dist/indexer/locals-and-exports.d.ts.map +1 -1
- package/dist/indexer/locals-and-exports.js +659 -78
- package/dist/indexer/locals-and-exports.js.map +1 -1
- package/dist/indexer/member-selection.d.ts +46 -0
- package/dist/indexer/member-selection.d.ts.map +1 -0
- package/dist/indexer/member-selection.js +169 -0
- package/dist/indexer/member-selection.js.map +1 -0
- package/dist/indexer/name-lookup-policies/c-family.d.ts +7 -0
- package/dist/indexer/name-lookup-policies/c-family.d.ts.map +1 -0
- package/dist/indexer/name-lookup-policies/c-family.js +137 -0
- package/dist/indexer/name-lookup-policies/c-family.js.map +1 -0
- package/dist/indexer/name-lookup-policies/csharp-using-static.d.ts +11 -0
- package/dist/indexer/name-lookup-policies/csharp-using-static.d.ts.map +1 -0
- package/dist/indexer/name-lookup-policies/csharp-using-static.js +136 -0
- package/dist/indexer/name-lookup-policies/csharp-using-static.js.map +1 -0
- package/dist/indexer/name-lookup-policies/implicit-self.d.ts +10 -0
- package/dist/indexer/name-lookup-policies/implicit-self.d.ts.map +1 -0
- package/dist/indexer/name-lookup-policies/implicit-self.js +119 -0
- package/dist/indexer/name-lookup-policies/implicit-self.js.map +1 -0
- package/dist/indexer/name-lookup-policies/index.d.ts +3 -0
- package/dist/indexer/name-lookup-policies/index.d.ts.map +1 -0
- package/dist/indexer/name-lookup-policies/index.js +132 -0
- package/dist/indexer/name-lookup-policies/index.js.map +1 -0
- package/dist/indexer/name-lookup-policies/php.d.ts +3 -0
- package/dist/indexer/name-lookup-policies/php.d.ts.map +1 -0
- package/dist/indexer/name-lookup-policies/php.js +82 -0
- package/dist/indexer/name-lookup-policies/php.js.map +1 -0
- package/dist/indexer/name-resolution-types.d.ts +101 -0
- package/dist/indexer/name-resolution-types.d.ts.map +1 -0
- package/dist/indexer/name-resolution-types.js +2 -0
- package/dist/indexer/name-resolution-types.js.map +1 -0
- package/dist/indexer/name-resolution.d.ts +57 -0
- package/dist/indexer/name-resolution.d.ts.map +1 -0
- package/dist/indexer/name-resolution.js +204 -0
- package/dist/indexer/name-resolution.js.map +1 -0
- package/dist/indexer/navigation-cpp.d.ts +58 -0
- package/dist/indexer/navigation-cpp.d.ts.map +1 -0
- package/dist/indexer/navigation-cpp.js +935 -0
- package/dist/indexer/navigation-cpp.js.map +1 -0
- package/dist/indexer/navigation-goto.d.ts +115 -3
- package/dist/indexer/navigation-goto.d.ts.map +1 -1
- package/dist/indexer/navigation-goto.js +2469 -190
- package/dist/indexer/navigation-goto.js.map +1 -1
- package/dist/indexer/navigation-local.d.ts +21 -2
- package/dist/indexer/navigation-local.d.ts.map +1 -1
- package/dist/indexer/navigation-local.js +520 -63
- package/dist/indexer/navigation-local.js.map +1 -1
- package/dist/indexer/navigation-php.d.ts +66 -0
- package/dist/indexer/navigation-php.d.ts.map +1 -1
- package/dist/indexer/navigation-php.js +287 -4
- package/dist/indexer/navigation-php.js.map +1 -1
- package/dist/indexer/navigation-provenance.d.ts +1 -1
- package/dist/indexer/navigation-provenance.d.ts.map +1 -1
- package/dist/indexer/navigation-provenance.js +4 -13
- package/dist/indexer/navigation-provenance.js.map +1 -1
- package/dist/indexer/navigation-references.d.ts +73 -6
- package/dist/indexer/navigation-references.d.ts.map +1 -1
- package/dist/indexer/navigation-references.js +661 -67
- package/dist/indexer/navigation-references.js.map +1 -1
- package/dist/indexer/navigation-resolve.d.ts +46 -2
- package/dist/indexer/navigation-resolve.d.ts.map +1 -1
- package/dist/indexer/navigation-resolve.js +599 -193
- package/dist/indexer/navigation-resolve.js.map +1 -1
- package/dist/indexer/navigation.d.ts +29 -2
- package/dist/indexer/navigation.d.ts.map +1 -1
- package/dist/indexer/navigation.js +1092 -153
- package/dist/indexer/navigation.js.map +1 -1
- package/dist/indexer/parse-context.d.ts +2 -3
- package/dist/indexer/parse-context.d.ts.map +1 -1
- package/dist/indexer/parse-context.js +8 -21
- package/dist/indexer/parse-context.js.map +1 -1
- package/dist/indexer/php-namespace-symbols.d.ts +66 -0
- package/dist/indexer/php-namespace-symbols.d.ts.map +1 -0
- package/dist/indexer/php-namespace-symbols.js +342 -0
- package/dist/indexer/php-namespace-symbols.js.map +1 -0
- package/dist/indexer/reference-candidates.d.ts.map +1 -1
- package/dist/indexer/reference-candidates.js +13 -7
- package/dist/indexer/reference-candidates.js.map +1 -1
- package/dist/indexer/reference-context.d.ts +2 -0
- package/dist/indexer/reference-context.d.ts.map +1 -1
- package/dist/indexer/reference-context.js +4 -0
- package/dist/indexer/reference-context.js.map +1 -1
- package/dist/indexer/scope-nodes.d.ts +92 -13
- package/dist/indexer/scope-nodes.d.ts.map +1 -1
- package/dist/indexer/scope-nodes.js +212 -20
- package/dist/indexer/scope-nodes.js.map +1 -1
- package/dist/indexer/scope-types.d.ts +29 -1
- package/dist/indexer/scope-types.d.ts.map +1 -1
- package/dist/indexer/scope.d.ts +2 -3
- package/dist/indexer/scope.d.ts.map +1 -1
- package/dist/indexer/scope.js +968 -47
- package/dist/indexer/scope.js.map +1 -1
- package/dist/indexer/shared-owner-identity.d.ts +53 -0
- package/dist/indexer/shared-owner-identity.d.ts.map +1 -0
- package/dist/indexer/shared-owner-identity.js +460 -0
- package/dist/indexer/shared-owner-identity.js.map +1 -0
- package/dist/indexer/shared.d.ts +1 -1
- package/dist/indexer/shared.d.ts.map +1 -1
- package/dist/indexer/shared.js +1 -1
- package/dist/indexer/shared.js.map +1 -1
- package/dist/indexer/star-import-precedence.d.ts +113 -0
- package/dist/indexer/star-import-precedence.d.ts.map +1 -0
- package/dist/indexer/star-import-precedence.js +402 -0
- package/dist/indexer/star-import-precedence.js.map +1 -0
- package/dist/indexer/symbols.d.ts +3 -1
- package/dist/indexer/symbols.d.ts.map +1 -1
- package/dist/indexer/symbols.js +58 -18
- package/dist/indexer/symbols.js.map +1 -1
- package/dist/indexer/ts-callables.d.ts +42 -0
- package/dist/indexer/ts-callables.d.ts.map +1 -0
- package/dist/indexer/ts-callables.js +233 -0
- package/dist/indexer/ts-callables.js.map +1 -0
- package/dist/indexer/types.d.ts +41 -26
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/indexer/unused-exports.d.ts +13 -0
- package/dist/indexer/unused-exports.d.ts.map +1 -0
- package/dist/indexer/unused-exports.js +159 -0
- package/dist/indexer/unused-exports.js.map +1 -0
- package/dist/indexer/workspace-symbols.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.js +3 -2
- package/dist/indexer/workspace-symbols.js.map +1 -1
- package/dist/indexer.d.ts +3 -8
- package/dist/indexer.d.ts.map +1 -1
- package/dist/indexer.js +1 -1
- package/dist/indexer.js.map +1 -1
- package/dist/languages/callable-arity.d.ts +223 -0
- package/dist/languages/callable-arity.d.ts.map +1 -0
- package/dist/languages/callable-arity.js +1199 -0
- package/dist/languages/callable-arity.js.map +1 -0
- package/dist/languages/definitions/c-family.d.ts.map +1 -1
- package/dist/languages/definitions/c-family.js +30 -1
- package/dist/languages/definitions/c-family.js.map +1 -1
- package/dist/languages/definitions/c.d.ts +4 -0
- package/dist/languages/definitions/c.d.ts.map +1 -1
- package/dist/languages/definitions/c.js +19 -0
- package/dist/languages/definitions/c.js.map +1 -1
- package/dist/languages/definitions/cpp.d.ts.map +1 -1
- package/dist/languages/definitions/cpp.js +12 -0
- package/dist/languages/definitions/cpp.js.map +1 -1
- package/dist/languages/definitions/csharp.d.ts.map +1 -1
- package/dist/languages/definitions/csharp.js +2 -8
- package/dist/languages/definitions/csharp.js.map +1 -1
- package/dist/languages/definitions/go.d.ts.map +1 -1
- package/dist/languages/definitions/go.js +3 -0
- package/dist/languages/definitions/go.js.map +1 -1
- package/dist/languages/definitions/javascript.d.ts.map +1 -1
- package/dist/languages/definitions/javascript.js +10 -1
- package/dist/languages/definitions/javascript.js.map +1 -1
- package/dist/languages/definitions/js-family.d.ts +1 -1
- package/dist/languages/definitions/js-family.d.ts.map +1 -1
- package/dist/languages/definitions/js-family.js +7 -1
- package/dist/languages/definitions/js-family.js.map +1 -1
- package/dist/languages/definitions/php.d.ts.map +1 -1
- package/dist/languages/definitions/php.js +5 -1
- package/dist/languages/definitions/php.js.map +1 -1
- package/dist/languages/definitions/typescript.d.ts.map +1 -1
- package/dist/languages/definitions/typescript.js +8 -1
- package/dist/languages/definitions/typescript.js.map +1 -1
- package/dist/languages/definitions/zig.d.ts.map +1 -1
- package/dist/languages/definitions/zig.js +8 -0
- package/dist/languages/definitions/zig.js.map +1 -1
- package/dist/lifecycle/manifest.d.ts.map +1 -1
- package/dist/lifecycle/manifest.js +0 -1
- package/dist/lifecycle/manifest.js.map +1 -1
- package/dist/mcp/handlers.js +14 -7
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/native/byte-index.d.ts +6 -0
- package/dist/native/byte-index.d.ts.map +1 -1
- package/dist/native/byte-index.js +11 -6
- package/dist/native/byte-index.js.map +1 -1
- package/dist/native/contracts.d.ts +2 -3
- package/dist/native/contracts.d.ts.map +1 -1
- package/dist/native/execution.d.ts +9 -9
- package/dist/native/execution.d.ts.map +1 -1
- package/dist/native/execution.js +37 -77
- package/dist/native/execution.js.map +1 -1
- package/dist/native/js-bridge.d.ts +2 -15
- package/dist/native/js-bridge.d.ts.map +1 -1
- package/dist/native/js-bridge.js +2 -15
- package/dist/native/js-bridge.js.map +1 -1
- package/dist/native/query-results.js +2 -2
- package/dist/native/query-results.js.map +1 -1
- package/dist/native/runtime.d.ts +12 -12
- package/dist/native/runtime.d.ts.map +1 -1
- package/dist/native/runtime.js +24 -69
- package/dist/native/runtime.js.map +1 -1
- package/dist/native/tree-sitter-native.d.ts +3 -3
- package/dist/native/tree-sitter-native.d.ts.map +1 -1
- package/dist/native/tree-sitter-native.js +2 -2
- package/dist/native/tree-sitter-native.js.map +1 -1
- package/dist/presets.d.ts.map +1 -1
- package/dist/presets.js +0 -4
- package/dist/presets.js.map +1 -1
- package/dist/review/candidates.d.ts.map +1 -1
- package/dist/review/candidates.js +1 -1
- package/dist/review/candidates.js.map +1 -1
- package/dist/review/deleted.d.ts +3 -3
- package/dist/review/deleted.d.ts.map +1 -1
- package/dist/review/deleted.js +82 -32
- package/dist/review/deleted.js.map +1 -1
- package/dist/review/report.d.ts +1 -0
- package/dist/review/report.d.ts.map +1 -1
- package/dist/review/report.js +1 -1
- package/dist/review/report.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +3 -20
- package/dist/review.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +0 -5
- package/dist/session.js.map +1 -1
- package/dist/sql/navigation.d.ts.map +1 -1
- package/dist/sql/navigation.js +2 -1
- package/dist/sql/navigation.js.map +1 -1
- package/dist/sql/source-graph.d.ts.map +1 -1
- package/dist/sql/source-graph.js +2 -2
- package/dist/sql/source-graph.js.map +1 -1
- package/dist/sqlite/schema.d.ts +1 -1
- package/dist/sqlite/schema.d.ts.map +1 -1
- package/dist/sqlite/schema.js +8 -2
- package/dist/sqlite/schema.js.map +1 -1
- package/dist/sqlite/write.js +2 -2
- package/dist/sqlite/write.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/util/bloom-filter.d.ts +8 -1
- package/dist/util/bloom-filter.d.ts.map +1 -1
- package/dist/util/bloom-filter.js +15 -2
- package/dist/util/bloom-filter.js.map +1 -1
- package/dist/util/glob.d.ts +32 -0
- package/dist/util/glob.d.ts.map +1 -0
- package/dist/util/glob.js +137 -0
- package/dist/util/glob.js.map +1 -0
- package/dist/util/graph-edges.d.ts +19 -1
- package/dist/util/graph-edges.d.ts.map +1 -1
- package/dist/util/graph-edges.js +30 -4
- package/dist/util/graph-edges.js.map +1 -1
- package/dist/util/identifiers.d.ts +15 -0
- package/dist/util/identifiers.d.ts.map +1 -1
- package/dist/util/identifiers.js +35 -0
- package/dist/util/identifiers.js.map +1 -1
- package/dist/util/member-access-tables.d.ts +61 -4
- package/dist/util/member-access-tables.d.ts.map +1 -1
- package/dist/util/member-access-tables.js +139 -19
- package/dist/util/member-access-tables.js.map +1 -1
- package/dist/util/member-access.d.ts +17 -0
- package/dist/util/member-access.d.ts.map +1 -1
- package/dist/util/member-access.js +98 -3
- package/dist/util/member-access.js.map +1 -1
- package/dist/util/project-files.d.ts +2 -10
- package/dist/util/project-files.d.ts.map +1 -1
- package/dist/util/project-files.js +29 -51
- package/dist/util/project-files.js.map +1 -1
- package/dist/util/python-type-checking.d.ts +18 -0
- package/dist/util/python-type-checking.d.ts.map +1 -0
- package/dist/util/python-type-checking.js +160 -0
- package/dist/util/python-type-checking.js.map +1 -0
- package/dist/util/resolution/cargo-targets.d.ts +11 -0
- package/dist/util/resolution/cargo-targets.d.ts.map +1 -1
- package/dist/util/resolution/cargo-targets.js +174 -13
- package/dist/util/resolution/cargo-targets.js.map +1 -1
- package/dist/util/resolution/csharp.d.ts +33 -1
- package/dist/util/resolution/csharp.d.ts.map +1 -1
- package/dist/util/resolution/csharp.js +145 -30
- package/dist/util/resolution/csharp.js.map +1 -1
- package/dist/util/resolution/jvm.d.ts +7 -3
- package/dist/util/resolution/jvm.d.ts.map +1 -1
- package/dist/util/resolution/jvm.js +56 -38
- package/dist/util/resolution/jvm.js.map +1 -1
- package/dist/util/resolution/php.d.ts.map +1 -1
- package/dist/util/resolution/php.js +35 -8
- package/dist/util/resolution/php.js.map +1 -1
- package/dist/util/resolution/python.d.ts +9 -0
- package/dist/util/resolution/python.d.ts.map +1 -1
- package/dist/util/resolution/python.js +46 -0
- package/dist/util/resolution/python.js.map +1 -1
- package/dist/util/resolution/rust.d.ts +0 -1
- package/dist/util/resolution/rust.d.ts.map +1 -1
- package/dist/util/resolution/rust.js +95 -35
- package/dist/util/resolution/rust.js.map +1 -1
- package/dist/util/resolution/specifier-targets.d.ts +44 -0
- package/dist/util/resolution/specifier-targets.d.ts.map +1 -0
- package/dist/util/resolution/specifier-targets.js +152 -0
- package/dist/util/resolution/specifier-targets.js.map +1 -0
- package/dist/util/resolution-candidates.d.ts +5 -0
- package/dist/util/resolution-candidates.d.ts.map +1 -1
- package/dist/util/resolution-candidates.js +16 -3
- package/dist/util/resolution-candidates.js.map +1 -1
- package/dist/util/resolution.d.ts +2 -1
- package/dist/util/resolution.d.ts.map +1 -1
- package/dist/util/resolution.js +101 -15
- package/dist/util/resolution.js.map +1 -1
- package/dist/util/specifiers.d.ts +29 -1
- package/dist/util/specifiers.d.ts.map +1 -1
- package/dist/util/specifiers.js +56 -8
- package/dist/util/specifiers.js.map +1 -1
- package/dist/util/trivia.d.ts.map +1 -1
- package/dist/util/trivia.js +49 -30
- package/dist/util/trivia.js.map +1 -1
- package/dist/util/workspace.d.ts.map +1 -1
- package/dist/util/workspace.js +32 -4
- package/dist/util/workspace.js.map +1 -1
- package/docs/mcp.md +3 -2
- package/package.json +5 -7
- package/dist/impact/call-compatibility/providers/profiles.d.ts +0 -80
- package/dist/impact/call-compatibility/providers/profiles.d.ts.map +0 -1
- package/dist/impact/call-compatibility/providers/profiles.js +0 -164
- package/dist/impact/call-compatibility/providers/profiles.js.map +0 -1
|
@@ -1,19 +1,108 @@
|
|
|
1
|
+
import { getCallArgumentCount } from "../languages/callable-arity.js";
|
|
1
2
|
import { fileIdentityKey, normalizePath } from "../util/paths.js";
|
|
2
3
|
import { okGoToResult } from "./navigation-provenance.js";
|
|
4
|
+
import { cppSelectCallableBinding } from "./cpp-callables.js";
|
|
5
|
+
import { typescriptCallableCandidatesInContainer, typescriptSelectOverloadCandidate } from "./ts-callables.js";
|
|
6
|
+
import { cScopeName, cTagRole } from "../languages/definitions/c.js";
|
|
7
|
+
import { bindingCoversUse, fileScopeDefinitionCoversUse, isExplicitMethodCall, laterLocalBlocksOuterUse, scopeAllowsUse, scopeIdentifierKey, scopeNodesFor, closestContainingScope, } from "./scope-nodes.js";
|
|
3
8
|
import { buildScopeIndexFromSource } from "./scope.js";
|
|
4
|
-
import { resolveExport, resolveImported } from "./navigation-resolve.js";
|
|
5
|
-
import {
|
|
9
|
+
import { cjsRequireValueBinding, resolveExport, resolveImported } from "./navigation-resolve.js";
|
|
10
|
+
import { phpNamedImportRole } from "./import-types.js";
|
|
11
|
+
import { resolvePhpExplicitImport } from "./php-namespace-symbols.js";
|
|
12
|
+
import { AMBIGUOUS_STAR_IMPORT_REASON } from "./ambiguous-resolution.js";
|
|
13
|
+
import { decideStarImportCandidates, effectiveExplicitOrLocalBinding, isExpandedStarBinding, resolveStarImportedDefinition, starImportPrecedence, } from "./star-import-precedence.js";
|
|
14
|
+
import { SymbolKind, } from "./types.js";
|
|
15
|
+
/** Follow a C# name token through generic arguments and qualified-name segments. */
|
|
16
|
+
export function csharpQualifiedNameNode(node) {
|
|
17
|
+
let qualified = node;
|
|
18
|
+
while (qualified.parent) {
|
|
19
|
+
const parent = qualified.parent;
|
|
20
|
+
if (parent.type === "generic_name") {
|
|
21
|
+
const name = parent.childForFieldName("name") ?? parent.namedChildren[0];
|
|
22
|
+
if (name && name.startIndex === qualified.startIndex && name.endIndex === qualified.endIndex) {
|
|
23
|
+
qualified = parent;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if ((parent.type === "qualified_name" || parent.type === "alias_qualified_name") &&
|
|
28
|
+
parent.endIndex === qualified.endIndex) {
|
|
29
|
+
qualified = parent;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return qualified.type === "qualified_name" || qualified.type === "alias_qualified_name" ? qualified : null;
|
|
35
|
+
}
|
|
36
|
+
/** Preserve the full C# namespace or alias path, excluding generic type arguments. */
|
|
37
|
+
export function csharpLookupName(node, source, fallback) {
|
|
38
|
+
const qualified = csharpQualifiedNameNode(node);
|
|
39
|
+
if (!qualified)
|
|
40
|
+
return fallback;
|
|
41
|
+
const text = source.slice(qualified.startIndex, qualified.endIndex);
|
|
42
|
+
if (!text.includes("<"))
|
|
43
|
+
return text.replace(/\s+/gu, "");
|
|
44
|
+
const argumentsNodes = [];
|
|
45
|
+
const collect = (current) => {
|
|
46
|
+
if (current.type === "generic_name") {
|
|
47
|
+
const argumentsNode = (current.namedChildren ?? []).find((child) => child.type === "type_argument_list");
|
|
48
|
+
if (argumentsNode)
|
|
49
|
+
argumentsNodes.push(argumentsNode);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
for (const child of current.namedChildren ?? []) {
|
|
53
|
+
if (child.type === "generic_name" || child.type === "qualified_name" || child.type === "alias_qualified_name") {
|
|
54
|
+
collect(child);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
collect(qualified);
|
|
59
|
+
let result = "";
|
|
60
|
+
let from = qualified.startIndex;
|
|
61
|
+
for (const argumentsNode of argumentsNodes) {
|
|
62
|
+
result += source.slice(from, argumentsNode.startIndex);
|
|
63
|
+
from = argumentsNode.endIndex;
|
|
64
|
+
}
|
|
65
|
+
return (result + source.slice(from, qualified.endIndex)).replace(/\s+/gu, "");
|
|
66
|
+
}
|
|
67
|
+
const FALLBACK_DECLARATION_TYPES = new Set([
|
|
68
|
+
"function_declaration",
|
|
69
|
+
"class_declaration",
|
|
70
|
+
"variable_declarator",
|
|
71
|
+
"interface_declaration",
|
|
72
|
+
"type_alias_declaration",
|
|
73
|
+
"function_definition",
|
|
74
|
+
"class_definition",
|
|
75
|
+
"assignment",
|
|
76
|
+
]);
|
|
77
|
+
const FALLBACK_CLASS_TYPES = new Set(["class_declaration", "class_definition"]);
|
|
78
|
+
/** Ordinary JavaScript functions rebind `this`; arrow functions and class methods do not. */
|
|
79
|
+
const DYNAMIC_THIS_FUNCTION_TYPES = new Set([
|
|
80
|
+
"function_declaration",
|
|
81
|
+
"function_expression",
|
|
82
|
+
"function",
|
|
83
|
+
"generator_function",
|
|
84
|
+
"generator_function_declaration",
|
|
85
|
+
]);
|
|
86
|
+
/**
|
|
87
|
+
* The declared name for a position on a declaration's own header (its keywords, name, or the
|
|
88
|
+
* space between them), and the enclosing class name for a JavaScript/TypeScript `this` whose
|
|
89
|
+
* value is lexically that class (not inside an ordinary nested function).
|
|
90
|
+
*
|
|
91
|
+
* A position inside the body or initializer is a use, not the declaration: `trim` in
|
|
92
|
+
* `const handle = value?.trim()` must never resolve to `handle`.
|
|
93
|
+
*/
|
|
6
94
|
export function findDeclarationNameNode(sup, currentNode) {
|
|
95
|
+
if (!currentNode)
|
|
96
|
+
return null;
|
|
97
|
+
const isThis = currentNode.type === "this";
|
|
7
98
|
let current = currentNode;
|
|
8
99
|
while (current) {
|
|
9
|
-
if (current
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
current.type === "class_definition" ||
|
|
16
|
-
current.type === "assignment") {
|
|
100
|
+
if (isThis && current !== currentNode && DYNAMIC_THIS_FUNCTION_TYPES.has(current.type))
|
|
101
|
+
return null;
|
|
102
|
+
// An object-literal method binds `this` to that object, not to the enclosing class.
|
|
103
|
+
if (isThis && current.type === "method_definition" && current.parent?.type !== "class_body")
|
|
104
|
+
return null;
|
|
105
|
+
if (FALLBACK_DECLARATION_TYPES.has(current.type)) {
|
|
17
106
|
let named = current.childForFieldName("name");
|
|
18
107
|
if (!named && current.type === "assignment") {
|
|
19
108
|
const left = current.child(0);
|
|
@@ -21,7 +110,13 @@ export function findDeclarationNameNode(sup, currentNode) {
|
|
|
21
110
|
named = left;
|
|
22
111
|
}
|
|
23
112
|
}
|
|
24
|
-
|
|
113
|
+
const tail = current.childForFieldName("body") ??
|
|
114
|
+
current.childForFieldName("value") ??
|
|
115
|
+
(current.type === "assignment" ? current.childForFieldName("right") : null);
|
|
116
|
+
const headerEnd = tail ? tail.startIndex : current.endIndex;
|
|
117
|
+
const onHeader = currentNode === current || currentNode.endIndex <= headerEnd;
|
|
118
|
+
const ownClass = isThis && FALLBACK_CLASS_TYPES.has(current.type);
|
|
119
|
+
if (named && sup.nodeTypes.identifier.includes(named.type) && (onHeader || ownClass)) {
|
|
25
120
|
return named;
|
|
26
121
|
}
|
|
27
122
|
}
|
|
@@ -34,41 +129,165 @@ export function getOrBuildScopeIndex(index, file, source, sup, mod, tree) {
|
|
|
34
129
|
let scopeIndex = index.scopeCache.get(fileKey);
|
|
35
130
|
if (scopeIndex)
|
|
36
131
|
return scopeIndex;
|
|
37
|
-
scopeIndex = buildScopeIndexFromSource(file, source, sup, mod.imports, { tree });
|
|
132
|
+
scopeIndex = buildScopeIndexFromSource(file, source, sup, mod.imports, { tree, locals: mod.locals });
|
|
38
133
|
index.scopeCache.set(fileKey, scopeIndex);
|
|
39
134
|
return scopeIndex;
|
|
40
135
|
}
|
|
136
|
+
/** Python function bodies resolve module names when called, after module initialization. */
|
|
137
|
+
function pythonModuleLookupUsesRuntimeBindings(scope, node) {
|
|
138
|
+
for (let current = scope; current; current = current.parent) {
|
|
139
|
+
if (current.kind !== "function")
|
|
140
|
+
continue;
|
|
141
|
+
const body = current.node.childForFieldName("body");
|
|
142
|
+
if (!body)
|
|
143
|
+
return false;
|
|
144
|
+
return node.startIndex >= body.startIndex && node.endIndex <= body.endIndex;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
function effectivePythonModuleScopeBinding(binding, useStartIndex, moduleLookupAtRuntime) {
|
|
149
|
+
let importBinding;
|
|
150
|
+
let importSource;
|
|
151
|
+
let localBinding;
|
|
152
|
+
let latestLocalStart = -1;
|
|
153
|
+
for (let candidate = binding; candidate; candidate = candidate.earlierSameScope) {
|
|
154
|
+
const localStart = candidate.def?.start.index;
|
|
155
|
+
if (localStart !== undefined &&
|
|
156
|
+
(moduleLookupAtRuntime || localStart <= useStartIndex) &&
|
|
157
|
+
localStart > latestLocalStart) {
|
|
158
|
+
localBinding = candidate;
|
|
159
|
+
latestLocalStart = localStart;
|
|
160
|
+
}
|
|
161
|
+
if (!importBinding && candidate.import) {
|
|
162
|
+
importBinding = candidate.import;
|
|
163
|
+
importSource = candidate;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const imports = importBinding ? [importBinding] : [];
|
|
167
|
+
const effective = effectiveExplicitOrLocalBinding(imports, "python", () => true, localBinding?.def?.start.index, useStartIndex, moduleLookupAtRuntime);
|
|
168
|
+
if (effective?.kind === "local")
|
|
169
|
+
return localBinding ?? null;
|
|
170
|
+
if (effective?.kind === "explicit")
|
|
171
|
+
return importSource ?? null;
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
41
174
|
export function findClosestScopeBinding(scopeIndex, bindingName, currentNode, support) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
scope.node.endIndex <= best.node.endIndex) {
|
|
55
|
-
best = scope;
|
|
56
|
-
}
|
|
175
|
+
if (support.id === "csharp" && bindingName.includes(".")) {
|
|
176
|
+
const names = bindingName.split(".");
|
|
177
|
+
const first = names.shift();
|
|
178
|
+
let owner = findClosestScopeBinding(scopeIndex, first, currentNode, support);
|
|
179
|
+
for (const name of names) {
|
|
180
|
+
if (owner?.kind !== "class")
|
|
181
|
+
return null;
|
|
182
|
+
const body = owner.node?.parent?.childForFieldName("body");
|
|
183
|
+
if (!body)
|
|
184
|
+
return null;
|
|
185
|
+
const bodyScope = scopeIndex.allScopes.find((scope) => scope.node.id === body.id);
|
|
186
|
+
owner = bodyScope?.map.get(support.normalizeIdentifier(name)) ?? null;
|
|
57
187
|
}
|
|
58
|
-
|
|
188
|
+
return owner;
|
|
59
189
|
}
|
|
190
|
+
const row = scopeNodesFor(support.id);
|
|
191
|
+
const canonicalName = scopeIdentifierKey(row, bindingName, currentNode, support.normalizeIdentifier);
|
|
192
|
+
const normalizedName = support.id === "c" && cTagRole(currentNode) ? cScopeName(canonicalName, "tag") : canonicalName;
|
|
193
|
+
let currentScope = closestContainingScope(scopeIndex, currentNode);
|
|
194
|
+
const methodCall = isExplicitMethodCall(row, currentNode);
|
|
195
|
+
const pythonModuleLookupAtRuntime = !!row.moduleBindingsAtFunctionRuntime && pythonModuleLookupUsesRuntimeBindings(currentScope, currentNode);
|
|
60
196
|
while (currentScope) {
|
|
61
|
-
|
|
197
|
+
if (!scopeAllowsUse(row, currentScope, currentNode)) {
|
|
198
|
+
currentScope = currentScope.parent;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
let binding = currentScope.map.get(normalizedName);
|
|
202
|
+
if (!pythonModuleLookupAtRuntime || currentScope.kind !== "module" || methodCall) {
|
|
203
|
+
while (binding &&
|
|
204
|
+
((methodCall && binding.kind === "local") ||
|
|
205
|
+
((!pythonModuleLookupAtRuntime || currentScope.kind !== "module") &&
|
|
206
|
+
!bindingCoversUse(row, currentScope.kind, binding, currentNode.startIndex)))) {
|
|
207
|
+
binding = binding.earlierSameScope;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (support.id === "python" && currentScope.kind === "module" && binding) {
|
|
211
|
+
const effectiveBinding = effectivePythonModuleScopeBinding(binding, currentNode.startIndex, pythonModuleLookupAtRuntime);
|
|
212
|
+
if (effectiveBinding)
|
|
213
|
+
return effectiveBinding;
|
|
214
|
+
currentScope = currentScope.parent;
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
62
217
|
if (binding)
|
|
63
218
|
return binding;
|
|
219
|
+
if (laterLocalBlocksOuterUse(row, currentScope, normalizedName, currentNode.startIndex))
|
|
220
|
+
return null;
|
|
64
221
|
currentScope = currentScope.parent;
|
|
65
222
|
}
|
|
66
223
|
return null;
|
|
67
224
|
}
|
|
68
|
-
|
|
225
|
+
/** A later C# local makes an earlier use invalid rather than binding to an outer member. */
|
|
226
|
+
export function laterLocalShadowsUse(scopeIndex, bindingName, currentNode, support) {
|
|
227
|
+
const row = scopeNodesFor(support.id);
|
|
228
|
+
if (!row.laterLocalBlocksOuterKinds)
|
|
229
|
+
return false;
|
|
230
|
+
const canonicalName = scopeIdentifierKey(row, bindingName, currentNode, support.normalizeIdentifier);
|
|
231
|
+
let scope = closestContainingScope(scopeIndex, currentNode);
|
|
232
|
+
while (scope) {
|
|
233
|
+
if (!scopeAllowsUse(row, scope, currentNode)) {
|
|
234
|
+
scope = scope.parent;
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (laterLocalBlocksOuterUse(row, scope, canonicalName, currentNode.startIndex))
|
|
238
|
+
return true;
|
|
239
|
+
let binding = scope.map.get(canonicalName);
|
|
240
|
+
while (binding && !bindingCoversUse(row, scope.kind, binding, currentNode.startIndex)) {
|
|
241
|
+
binding = binding.earlierSameScope;
|
|
242
|
+
}
|
|
243
|
+
if (binding)
|
|
244
|
+
return false;
|
|
245
|
+
scope = scope.parent;
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
function selectTypeScriptOverloadBinding(binding, currentNode, source, languageId) {
|
|
250
|
+
const call = currentNode.parent;
|
|
251
|
+
if (!call || call.type !== "call_expression")
|
|
252
|
+
return binding;
|
|
253
|
+
const candidates = typescriptCallableCandidatesInContainer(binding.sameScopeFunctionBindings ?? [binding], (candidate) => candidate.callable, binding.callable?.key);
|
|
254
|
+
const selected = typescriptSelectOverloadCandidate({
|
|
255
|
+
group: candidates,
|
|
256
|
+
identityOf: (candidate) => candidate.callable,
|
|
257
|
+
argumentCount: getCallArgumentCount({ languageId, source, call }),
|
|
258
|
+
});
|
|
259
|
+
return selected ?? null;
|
|
260
|
+
}
|
|
261
|
+
export function findClosestBinding(scopeIndex, file, bindingName, currentNode, support, source, tree) {
|
|
69
262
|
const binding = findClosestScopeBinding(scopeIndex, bindingName, currentNode, support);
|
|
70
|
-
|
|
263
|
+
return binding ? definitionForBinding(binding, file, currentNode, support, source, tree) : null;
|
|
264
|
+
}
|
|
265
|
+
/** The definition a scope binding names at a use, choosing C++ and TypeScript overloads by arity. */
|
|
266
|
+
export function definitionForBinding(closest, file, currentNode, support, source, tree) {
|
|
267
|
+
let binding = closest;
|
|
268
|
+
if (!binding.def)
|
|
71
269
|
return null;
|
|
270
|
+
if (support.id === "cpp" && binding.kind === "function" && source) {
|
|
271
|
+
const collisions = binding.sameScopeFunctionBindings ?? [binding];
|
|
272
|
+
if (collisions.length > 1 || binding.callable?.signature) {
|
|
273
|
+
const selected = cppSelectCallableBinding(collisions, currentNode, source, file, file);
|
|
274
|
+
if (!selected?.def)
|
|
275
|
+
return null;
|
|
276
|
+
return {
|
|
277
|
+
file,
|
|
278
|
+
localName: selected.name,
|
|
279
|
+
kind: SymbolKind.Function,
|
|
280
|
+
range: selected.def,
|
|
281
|
+
...(selected.callable ? { callable: selected.callable } : {}),
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if ((support.id === "ts" || support.id === "tsx") && binding.kind === "function" && source && tree) {
|
|
286
|
+
const selected = selectTypeScriptOverloadBinding(binding, currentNode, source, support.id);
|
|
287
|
+
if (!selected?.def)
|
|
288
|
+
return null;
|
|
289
|
+
binding = selected;
|
|
290
|
+
}
|
|
72
291
|
let kind = SymbolKind.Variable;
|
|
73
292
|
if (binding.kind === "function") {
|
|
74
293
|
kind = SymbolKind.Function;
|
|
@@ -79,11 +298,17 @@ export function findClosestBinding(scopeIndex, file, bindingName, currentNode, s
|
|
|
79
298
|
else if (binding.kind === "type") {
|
|
80
299
|
kind = SymbolKind.TypeAlias;
|
|
81
300
|
}
|
|
301
|
+
const range = binding.def;
|
|
302
|
+
if (!range)
|
|
303
|
+
return null;
|
|
304
|
+
const tagRole = support.id === "c" && binding.node ? cTagRole(binding.node) : undefined;
|
|
82
305
|
return {
|
|
83
306
|
file,
|
|
84
307
|
localName: binding.name,
|
|
85
308
|
kind,
|
|
86
|
-
range
|
|
309
|
+
range,
|
|
310
|
+
...(binding.callable ? { callable: binding.callable } : {}),
|
|
311
|
+
...(tagRole ? { cTag: tagRole } : {}),
|
|
87
312
|
};
|
|
88
313
|
}
|
|
89
314
|
export function toModuleRef(resolved) {
|
|
@@ -91,25 +316,117 @@ export function toModuleRef(resolved) {
|
|
|
91
316
|
return undefined;
|
|
92
317
|
return typeof resolved === "string" ? resolved : resolved.external;
|
|
93
318
|
}
|
|
94
|
-
|
|
319
|
+
function importBindingCoversIndex(imp, index) {
|
|
320
|
+
const ranges = [];
|
|
321
|
+
if ((imp.kind === "named" || imp.kind === "default" || imp.kind === "namespace") && imp.localRange) {
|
|
322
|
+
ranges.push(imp.localRange);
|
|
323
|
+
}
|
|
324
|
+
if (imp.kind === "named" && imp.importedRange)
|
|
325
|
+
ranges.push(imp.importedRange);
|
|
326
|
+
return ranges.some((range) => {
|
|
327
|
+
const start = range.start.index;
|
|
328
|
+
const end = range.end.index;
|
|
329
|
+
return start !== undefined && end !== undefined && index >= start && index < end;
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
function starImportGoTo(index, imp, def, name) {
|
|
333
|
+
return okGoToResult(index, def, {
|
|
334
|
+
via: {
|
|
335
|
+
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
336
|
+
exportedName: name,
|
|
337
|
+
},
|
|
338
|
+
resolution: "import-star",
|
|
339
|
+
confidence: "medium",
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
const CALL_ARGUMENT_PARENT_TYPES = new Set([
|
|
343
|
+
"call",
|
|
344
|
+
"call_expression",
|
|
345
|
+
"function_call_expression",
|
|
346
|
+
"invocation_expression",
|
|
347
|
+
"method_invocation",
|
|
348
|
+
"scoped_call_expression",
|
|
349
|
+
]);
|
|
350
|
+
/** Argument count when `node` is the callee of a call; undefined for every other use. */
|
|
351
|
+
function explicitCallArgumentCount(languageId, source, node) {
|
|
352
|
+
const call = node.parent;
|
|
353
|
+
if (!call || !CALL_ARGUMENT_PARENT_TYPES.has(call.type))
|
|
354
|
+
return undefined;
|
|
355
|
+
const callee = call.childForFieldName("name") ?? call.childForFieldName("function") ?? call.namedChildren[0] ?? null;
|
|
356
|
+
if (!callee || node.startIndex < callee.startIndex || node.endIndex > callee.endIndex)
|
|
357
|
+
return undefined;
|
|
358
|
+
const count = getCallArgumentCount({ languageId, source, call });
|
|
359
|
+
return count === null ? undefined : count;
|
|
360
|
+
}
|
|
361
|
+
export function resolveNamedDefinition(index, mod, file, support, name, cNamespace, referenceIndex, callSite) {
|
|
362
|
+
const argumentCount = callSite ? explicitCallArgumentCount(support.id, callSite.source, callSite.node) : undefined;
|
|
363
|
+
const arityOptions = argumentCount === undefined ? {} : { argumentCount };
|
|
95
364
|
const normalizedName = support.normalizeIdentifier(name);
|
|
96
365
|
const requiresExplicitReceiver = !support.membersAreImplicitlyInScope;
|
|
97
|
-
const directExport = requiresExplicitReceiver
|
|
366
|
+
const directExport = requiresExplicitReceiver && support.id !== "c"
|
|
98
367
|
? mod.exports.find((entry) => entry.type === "local" &&
|
|
99
368
|
support.normalizeIdentifier(entry.exportedAs) === normalizedName &&
|
|
100
369
|
!entry.target.isMember)
|
|
101
370
|
: undefined;
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
371
|
+
const suppressCppUnqualifiedLocalExport = support.id === "cpp" && !name.includes("::");
|
|
372
|
+
let hit = null;
|
|
373
|
+
const precedence = starImportPrecedence(support.id);
|
|
374
|
+
const matchesExplicitBinding = (imp) => {
|
|
375
|
+
if (isExpandedStarBinding(imp, mod.imports))
|
|
376
|
+
return false;
|
|
377
|
+
if (imp.kind === "default")
|
|
378
|
+
return support.normalizeIdentifier(imp.local) === normalizedName;
|
|
379
|
+
if (imp.kind === "named")
|
|
380
|
+
return !imp.cNamespace && support.normalizeIdentifier(imp.local) === normalizedName;
|
|
381
|
+
return imp.kind === "namespace" && support.normalizeIdentifier(imp.localNS) === normalizedName;
|
|
382
|
+
};
|
|
383
|
+
// Explicit-beats-star languages: an explicit import, then the compilation unit (Java and
|
|
384
|
+
// Kotlin same-package peers), then a wildcard. resolveExport's compilation-unit hit must wait
|
|
385
|
+
// until explicit imports have had a chance to win and must still beat star imports. In Rust a
|
|
386
|
+
// `use` and a same-named local item are a compile error, so the order changes nothing there.
|
|
387
|
+
const deferCompilationUnitPeers = precedence === "explicit-beats-star";
|
|
388
|
+
if (!suppressCppUnqualifiedLocalExport) {
|
|
389
|
+
if (directExport && directExport.type === "local") {
|
|
390
|
+
hit = { kind: "resolved", def: directExport.target };
|
|
391
|
+
}
|
|
392
|
+
else if (!deferCompilationUnitPeers) {
|
|
393
|
+
hit = resolveExport(index, file, name, {
|
|
394
|
+
allowLocalFallback: support.membersAreImplicitlyInScope,
|
|
395
|
+
...(cNamespace ? { cNamespace } : {}),
|
|
396
|
+
...(support.id === "csharp" && referenceIndex !== undefined ? { referenceIndex } : {}),
|
|
397
|
+
...arityOptions,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
const row = scopeNodesFor(support.id);
|
|
402
|
+
const moduleLookupAtRuntime = !!row.moduleBindingsAtFunctionRuntime &&
|
|
403
|
+
hit?.kind === "resolved" &&
|
|
404
|
+
referenceIndex !== undefined &&
|
|
405
|
+
fileIdentityKey(file) === fileIdentityKey(hit.def.file) &&
|
|
406
|
+
!!index.scopeCache.get(fileIdentityKey(file))?.allScopes.some((scope) => {
|
|
407
|
+
if (scope.kind !== "function")
|
|
408
|
+
return false;
|
|
409
|
+
const body = scope.node.childForFieldName("body");
|
|
410
|
+
return !!body && referenceIndex >= body.startIndex && referenceIndex < body.endIndex;
|
|
110
411
|
});
|
|
412
|
+
const effectiveBinding = effectiveExplicitOrLocalBinding(mod.imports, support.id, matchesExplicitBinding, hit?.kind === "resolved" ? hit.def.range.start.index : undefined, referenceIndex, moduleLookupAtRuntime);
|
|
413
|
+
const effectiveExplicitImport = effectiveBinding?.kind === "explicit" ? effectiveBinding.binding : undefined;
|
|
414
|
+
if (hit?.kind === "resolved" && (!requiresExplicitReceiver || !hit.def.isMember)) {
|
|
415
|
+
const sameFileFallback = referenceIndex !== undefined && fileIdentityKey(file) === fileIdentityKey(hit.def.file);
|
|
416
|
+
if (sameFileFallback &&
|
|
417
|
+
!fileScopeDefinitionCoversUse(support.id, hit.def.range, referenceIndex, hit.def.kind, moduleLookupAtRuntime)) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
if (support.id !== "python" || effectiveBinding?.kind === "local") {
|
|
421
|
+
const importedFrom = support.id === "c" && fileIdentityKey(file) !== fileIdentityKey(hit.def.file) ? hit.def.file : undefined;
|
|
422
|
+
return okGoToResult(index, hit.def, {
|
|
423
|
+
via: { exportedName: name, ...(importedFrom ? { importedFrom } : {}) },
|
|
424
|
+
resolution: importedFrom ? "import" : "exact",
|
|
425
|
+
confidence: "high",
|
|
426
|
+
});
|
|
427
|
+
}
|
|
111
428
|
}
|
|
112
|
-
if (hit?.kind === "namespace") {
|
|
429
|
+
if (hit?.kind === "namespace" && effectiveBinding?.kind !== "explicit") {
|
|
113
430
|
const targetMod = index.byFile.get(fileIdentityKey(hit.file));
|
|
114
431
|
const firstExport = targetMod?.exports.find((entry) => entry.type === "local");
|
|
115
432
|
if (firstExport) {
|
|
@@ -120,11 +437,32 @@ export function resolveNamedDefinition(index, mod, file, support, name) {
|
|
|
120
437
|
});
|
|
121
438
|
}
|
|
122
439
|
}
|
|
440
|
+
const starCandidates = [];
|
|
441
|
+
let lastWinsResult = null;
|
|
442
|
+
const acceptBinding = (result, imp) => {
|
|
443
|
+
// A click on the binding's own token names that import, not a later rebinding.
|
|
444
|
+
if (precedence === "last-wins" && referenceIndex !== undefined && importBindingCoversIndex(imp, referenceIndex)) {
|
|
445
|
+
return result;
|
|
446
|
+
}
|
|
447
|
+
if (precedence === "last-wins") {
|
|
448
|
+
lastWinsResult = result;
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
return result;
|
|
452
|
+
};
|
|
123
453
|
for (const imp of mod.imports) {
|
|
454
|
+
// Star expansion republishes the same names. Judging those copies as explicit
|
|
455
|
+
// imports would hide a second star import behind the first expanded binding.
|
|
456
|
+
if (isExpandedStarBinding(imp, mod.imports))
|
|
457
|
+
continue;
|
|
458
|
+
const matchesExplicit = matchesExplicitBinding(imp);
|
|
459
|
+
if (matchesExplicit && effectiveExplicitImport !== imp)
|
|
460
|
+
continue;
|
|
461
|
+
let matched = null;
|
|
124
462
|
if (imp.kind === "default" && support.normalizeIdentifier(imp.local) === normalizedName) {
|
|
125
|
-
const result = resolveImported(index, imp, "default");
|
|
463
|
+
const result = resolveImported(index, imp, "default", arityOptions);
|
|
126
464
|
if (result && !("namespace" in result)) {
|
|
127
|
-
|
|
465
|
+
matched = okGoToResult(index, result, {
|
|
128
466
|
via: {
|
|
129
467
|
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
130
468
|
exportedName: "default",
|
|
@@ -135,9 +473,29 @@ export function resolveNamedDefinition(index, mod, file, support, name) {
|
|
|
135
473
|
}
|
|
136
474
|
}
|
|
137
475
|
else if (imp.kind === "named" && support.normalizeIdentifier(imp.local) === normalizedName) {
|
|
138
|
-
const
|
|
476
|
+
const phpRole = phpNamedImportRole(imp);
|
|
477
|
+
let result;
|
|
478
|
+
if (phpRole) {
|
|
479
|
+
// This role-blind fallback cannot choose between PHP class, function, and constant aliases.
|
|
480
|
+
const hasPhpRoleCollision = mod.imports.some((candidate) => candidate !== imp &&
|
|
481
|
+
candidate.kind === "named" &&
|
|
482
|
+
phpNamedImportRole(candidate) !== undefined &&
|
|
483
|
+
support.normalizeIdentifier(candidate.local) === normalizedName);
|
|
484
|
+
if (hasPhpRoleCollision) {
|
|
485
|
+
result = null;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
result = resolvePhpExplicitImport(index, imp, phpRole);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
result = resolveImported(index, imp, imp.imported, {
|
|
493
|
+
...(cNamespace ? { cNamespace } : {}),
|
|
494
|
+
...arityOptions,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
139
497
|
if (result && !("namespace" in result)) {
|
|
140
|
-
|
|
498
|
+
matched = okGoToResult(index, result, {
|
|
141
499
|
via: {
|
|
142
500
|
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
143
501
|
exportedName: imp.imported,
|
|
@@ -148,32 +506,131 @@ export function resolveNamedDefinition(index, mod, file, support, name) {
|
|
|
148
506
|
}
|
|
149
507
|
}
|
|
150
508
|
else if (imp.kind === "star") {
|
|
151
|
-
const
|
|
509
|
+
const def = resolveStarImportedDefinition(index, imp, name, support.id, cNamespace, argumentCount);
|
|
510
|
+
if (def) {
|
|
511
|
+
const starResult = starImportGoTo(index, imp, def, name);
|
|
512
|
+
if (precedence === "last-wins") {
|
|
513
|
+
const taken = acceptBinding(starResult, imp);
|
|
514
|
+
if (taken)
|
|
515
|
+
return taken;
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
starCandidates.push({ imp, def });
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else if (imp.kind === "namespace" && support.normalizeIdentifier(imp.localNS) === normalizedName) {
|
|
523
|
+
const targetFile = typeof imp.resolved === "string" ? normalizePath(imp.resolved) : undefined;
|
|
524
|
+
if (imp.mechanism === "cjs" && targetFile) {
|
|
525
|
+
const classValue = cjsRequireValueBinding(index, targetFile);
|
|
526
|
+
if (classValue) {
|
|
527
|
+
matched = okGoToResult(index, classValue, {
|
|
528
|
+
via: {
|
|
529
|
+
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
530
|
+
exportedName: classValue.localName,
|
|
531
|
+
},
|
|
532
|
+
resolution: "import",
|
|
533
|
+
confidence: "high",
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (!matched) {
|
|
538
|
+
const targetMod = targetFile ? index.byFile.get(fileIdentityKey(targetFile)) : undefined;
|
|
539
|
+
const firstExport = targetMod?.exports.find((entry) => entry.type === "local");
|
|
540
|
+
if (firstExport) {
|
|
541
|
+
matched = okGoToResult(index, firstExport.target, {
|
|
542
|
+
via: {
|
|
543
|
+
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
544
|
+
exportedName: firstExport.exportedAs,
|
|
545
|
+
},
|
|
546
|
+
resolution: "namespace",
|
|
547
|
+
confidence: "medium",
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
if (!matched) {
|
|
553
|
+
if (matchesExplicit && effectiveExplicitImport === imp) {
|
|
554
|
+
if (precedence !== "last-wins")
|
|
555
|
+
return null;
|
|
556
|
+
lastWinsResult = null;
|
|
557
|
+
}
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
const taken = acceptBinding(matched, imp);
|
|
561
|
+
if (taken)
|
|
562
|
+
return taken;
|
|
563
|
+
}
|
|
564
|
+
// A local binding name always wins above so a grouped import's own aliases never collide with
|
|
565
|
+
// each other. An aliased import's source spelling is not itself a bound name anywhere in the
|
|
566
|
+
// file (Python: `from a import helper as h` binds only `h`; a bare `helper()` elsewhere is
|
|
567
|
+
// unbound and must stay not_found), so only resolve it when the click falls inside that exact
|
|
568
|
+
// import statement's own source-name token, never by re-matching the spelling anywhere else.
|
|
569
|
+
if (referenceIndex !== undefined) {
|
|
570
|
+
for (const imp of mod.imports) {
|
|
571
|
+
if (imp.kind !== "named" ||
|
|
572
|
+
imp.local === imp.imported ||
|
|
573
|
+
support.normalizeIdentifier(imp.imported) !== normalizedName ||
|
|
574
|
+
!imp.importedRange ||
|
|
575
|
+
imp.importedRange.start.index === undefined ||
|
|
576
|
+
imp.importedRange.end.index === undefined ||
|
|
577
|
+
referenceIndex < imp.importedRange.start.index ||
|
|
578
|
+
referenceIndex >= imp.importedRange.end.index) {
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
const result = resolveImported(index, imp, imp.imported, {
|
|
582
|
+
...(cNamespace ? { cNamespace } : {}),
|
|
583
|
+
...arityOptions,
|
|
584
|
+
});
|
|
152
585
|
if (result && !("namespace" in result)) {
|
|
153
586
|
return okGoToResult(index, result, {
|
|
154
587
|
via: {
|
|
155
588
|
...(toModuleRef(imp.resolved) ? { importedFrom: toModuleRef(imp.resolved) } : {}),
|
|
156
|
-
exportedName:
|
|
589
|
+
exportedName: imp.imported,
|
|
157
590
|
},
|
|
158
|
-
resolution: "import
|
|
159
|
-
confidence: "
|
|
591
|
+
resolution: "import",
|
|
592
|
+
confidence: "high",
|
|
160
593
|
});
|
|
161
594
|
}
|
|
162
595
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
596
|
+
}
|
|
597
|
+
if (precedence === "last-wins") {
|
|
598
|
+
if (lastWinsResult)
|
|
599
|
+
return lastWinsResult;
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
if (deferCompilationUnitPeers) {
|
|
603
|
+
const unitHit = resolveExport(index, file, name, {
|
|
604
|
+
allowLocalFallback: support.membersAreImplicitlyInScope,
|
|
605
|
+
...arityOptions,
|
|
606
|
+
});
|
|
607
|
+
if (unitHit?.kind === "resolved" && (!requiresExplicitReceiver || !unitHit.def.isMember)) {
|
|
608
|
+
return okGoToResult(index, unitHit.def, {
|
|
609
|
+
via: { exportedName: name },
|
|
610
|
+
resolution: "exact",
|
|
611
|
+
confidence: "high",
|
|
175
612
|
});
|
|
176
613
|
}
|
|
614
|
+
if (unitHit?.kind === "namespace") {
|
|
615
|
+
const targetMod = index.byFile.get(fileIdentityKey(unitHit.file));
|
|
616
|
+
const firstExport = targetMod?.exports.find((entry) => entry.type === "local");
|
|
617
|
+
if (firstExport) {
|
|
618
|
+
return okGoToResult(index, firstExport.target, {
|
|
619
|
+
via: { exportedName: name },
|
|
620
|
+
resolution: "namespace",
|
|
621
|
+
confidence: "medium",
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (!starCandidates.length)
|
|
627
|
+
return null;
|
|
628
|
+
const decision = decideStarImportCandidates(index, support.id, starCandidates, file);
|
|
629
|
+
if (decision.status === "ambiguous") {
|
|
630
|
+
return { status: "not_found", reason: AMBIGUOUS_STAR_IMPORT_REASON };
|
|
631
|
+
}
|
|
632
|
+
if (decision.status === "resolved") {
|
|
633
|
+
return starImportGoTo(index, decision.imp, decision.definition, name);
|
|
177
634
|
}
|
|
178
635
|
}
|
|
179
636
|
return null;
|