@lzehrung/codegraph 3.0.0 → 3.1.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 +19 -17
- package/codegraph-skill/codegraph/SKILL.md +3 -0
- package/dist/agent/artifact.d.ts.map +1 -1
- package/dist/agent/artifact.js +4 -9
- package/dist/agent/artifact.js.map +1 -1
- package/dist/agent/call-hierarchy.d.ts +4 -2
- package/dist/agent/call-hierarchy.d.ts.map +1 -1
- package/dist/agent/call-hierarchy.js +20 -29
- package/dist/agent/call-hierarchy.js.map +1 -1
- package/dist/agent/explain.d.ts.map +1 -1
- package/dist/agent/explain.js +12 -11
- package/dist/agent/explain.js.map +1 -1
- package/dist/agent/explore.d.ts.map +1 -1
- package/dist/agent/explore.js +2 -11
- package/dist/agent/explore.js.map +1 -1
- package/dist/agent/file-view.d.ts.map +1 -1
- package/dist/agent/file-view.js +4 -12
- package/dist/agent/file-view.js.map +1 -1
- package/dist/agent/normalize.d.ts +0 -3
- package/dist/agent/normalize.d.ts.map +1 -1
- package/dist/agent/normalize.js +1 -7
- package/dist/agent/normalize.js.map +1 -1
- package/dist/agent/orient.d.ts.map +1 -1
- package/dist/agent/orient.js +2 -6
- package/dist/agent/orient.js.map +1 -1
- package/dist/agent/packet.d.ts.map +1 -1
- package/dist/agent/packet.js +2 -5
- package/dist/agent/packet.js.map +1 -1
- package/dist/agent/query-index/content.d.ts.map +1 -1
- package/dist/agent/query-index/content.js +2 -6
- package/dist/agent/query-index/content.js.map +1 -1
- package/dist/agent/query-index/update.d.ts.map +1 -1
- package/dist/agent/query-index/update.js +8 -45
- package/dist/agent/query-index/update.js.map +1 -1
- package/dist/agent/query-index/worker-pool.d.ts.map +1 -1
- package/dist/agent/query-index/worker-pool.js +2 -1
- package/dist/agent/query-index/worker-pool.js.map +1 -1
- package/dist/agent/refactor-plan.d.ts +2 -2
- package/dist/agent/refactor-plan.d.ts.map +1 -1
- package/dist/agent/refactor-plan.js +11 -57
- 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 +218 -26
- package/dist/agent/rename-preview.js.map +1 -1
- package/dist/agent/search.d.ts.map +1 -1
- package/dist/agent/search.js +7 -22
- package/dist/agent/search.js.map +1 -1
- package/dist/agent/semantic-symbols.d.ts +1 -1
- package/dist/agent/semantic-symbols.d.ts.map +1 -1
- package/dist/agent/semantic-symbols.js +2 -5
- package/dist/agent/semantic-symbols.js.map +1 -1
- package/dist/agent/semantic.d.ts +5 -0
- package/dist/agent/semantic.d.ts.map +1 -1
- package/dist/agent/semantic.js +12 -1
- package/dist/agent/semantic.js.map +1 -1
- package/dist/agent/session.d.ts +9 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +59 -41
- package/dist/agent/session.js.map +1 -1
- package/dist/agent/type-hierarchy.d.ts +4 -2
- package/dist/agent/type-hierarchy.d.ts.map +1 -1
- package/dist/agent/type-hierarchy.js +19 -31
- package/dist/agent/type-hierarchy.js.map +1 -1
- package/dist/agent/workspace-symbols.d.ts +1 -1
- package/dist/agent/workspace-symbols.d.ts.map +1 -1
- package/dist/agent/workspace-symbols.js +7 -15
- package/dist/agent/workspace-symbols.js.map +1 -1
- package/dist/analysis-summary.d.ts +1 -4
- package/dist/analysis-summary.d.ts.map +1 -1
- package/dist/analysis-summary.js +58 -19
- package/dist/analysis-summary.js.map +1 -1
- package/dist/bin/cli.js +36572 -22925
- package/dist/bin/query-index-worker.js +440 -261
- package/dist/bootstrap/tree-sitter-languages.d.ts +2 -0
- package/dist/bootstrap/tree-sitter-languages.d.ts.map +1 -1
- package/dist/bootstrap/tree-sitter-languages.js +6 -19
- package/dist/bootstrap/tree-sitter-languages.js.map +1 -1
- package/dist/chunking/chunk-matches.d.ts.map +1 -1
- package/dist/chunking/chunk-matches.js +6 -42
- package/dist/chunking/chunk-matches.js.map +1 -1
- package/dist/chunking/chunk-split.d.ts +7 -0
- package/dist/chunking/chunk-split.d.ts.map +1 -1
- package/dist/chunking/chunk-split.js +3 -3
- package/dist/chunking/chunk-split.js.map +1 -1
- package/dist/chunking/chunk-text-file.js +2 -30
- package/dist/chunking/chunk-text-file.js.map +1 -1
- package/dist/cli/affected.d.ts.map +1 -1
- package/dist/cli/affected.js +1 -9
- package/dist/cli/affected.js.map +1 -1
- package/dist/cli/call-hierarchy.js +3 -6
- package/dist/cli/call-hierarchy.js.map +1 -1
- package/dist/cli/chunk.d.ts.map +1 -1
- package/dist/cli/chunk.js +4 -11
- package/dist/cli/chunk.js.map +1 -1
- package/dist/cli/command-table.d.ts.map +1 -1
- package/dist/cli/command-table.js +3 -0
- package/dist/cli/command-table.js.map +1 -1
- package/dist/cli/context.d.ts +1 -0
- package/dist/cli/context.d.ts.map +1 -1
- package/dist/cli/context.js +1 -1
- package/dist/cli/context.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +1 -11
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/graph.d.ts +4 -12
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +17 -8
- package/dist/cli/graph.js.map +1 -1
- package/dist/cli/help.d.ts +4 -4
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +7 -5
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/index.d.ts +2 -12
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/links.d.ts.map +1 -1
- package/dist/cli/links.js +4 -10
- package/dist/cli/links.js.map +1 -1
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +1 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/module-locals.d.ts +8 -0
- package/dist/cli/module-locals.d.ts.map +1 -0
- package/dist/cli/module-locals.js +9 -0
- package/dist/cli/module-locals.js.map +1 -0
- package/dist/cli/navigation.d.ts +2 -0
- package/dist/cli/navigation.d.ts.map +1 -1
- package/dist/cli/navigation.js +3 -5
- package/dist/cli/navigation.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +2 -1
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/pretty.d.ts +1 -0
- package/dist/cli/pretty.d.ts.map +1 -1
- package/dist/cli/pretty.js +6 -8
- package/dist/cli/pretty.js.map +1 -1
- package/dist/cli/refactor-plan.js +2 -5
- package/dist/cli/refactor-plan.js.map +1 -1
- package/dist/cli/rename-preview.js +2 -5
- package/dist/cli/rename-preview.js.map +1 -1
- package/dist/cli/review.d.ts +6 -16
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +2 -0
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/server.d.ts.map +1 -1
- package/dist/cli/server.js +7 -10
- package/dist/cli/server.js.map +1 -1
- package/dist/cli/type-hierarchy.js +8 -8
- package/dist/cli/type-hierarchy.js.map +1 -1
- package/dist/document-links/asciidoc.d.ts.map +1 -1
- package/dist/document-links/asciidoc.js +4 -16
- package/dist/document-links/asciidoc.js.map +1 -1
- package/dist/document-links/check.d.ts.map +1 -1
- package/dist/document-links/check.js +1 -3
- package/dist/document-links/check.js.map +1 -1
- package/dist/document-links/html.d.ts.map +1 -1
- package/dist/document-links/html.js +6 -44
- package/dist/document-links/html.js.map +1 -1
- package/dist/document-links/markdown.d.ts.map +1 -1
- package/dist/document-links/markdown.js +4 -13
- package/dist/document-links/markdown.js.map +1 -1
- package/dist/document-links/rst.d.ts.map +1 -1
- package/dist/document-links/rst.js +7 -31
- package/dist/document-links/rst.js.map +1 -1
- package/dist/document-links/sfc.d.ts.map +1 -1
- package/dist/document-links/sfc.js +2 -5
- package/dist/document-links/sfc.js.map +1 -1
- package/dist/document-links/shared.d.ts +2 -0
- package/dist/document-links/shared.d.ts.map +1 -1
- package/dist/document-links/shared.js +13 -0
- package/dist/document-links/shared.js.map +1 -1
- package/dist/drift/artifact.d.ts.map +1 -1
- package/dist/drift/artifact.js +4 -27
- package/dist/drift/artifact.js.map +1 -1
- package/dist/drift/graph-edges.d.ts +4 -0
- package/dist/drift/graph-edges.d.ts.map +1 -0
- package/dist/drift/graph-edges.js +15 -0
- package/dist/drift/graph-edges.js.map +1 -0
- package/dist/drift/snapshot.d.ts.map +1 -1
- package/dist/drift/snapshot.js +2 -17
- package/dist/drift/snapshot.js.map +1 -1
- package/dist/duplicates/unit-cache.d.ts +11 -1
- package/dist/duplicates/unit-cache.d.ts.map +1 -1
- package/dist/duplicates/unit-cache.js +20 -2
- package/dist/duplicates/unit-cache.js.map +1 -1
- package/dist/duplicates/units.d.ts +2 -1
- package/dist/duplicates/units.d.ts.map +1 -1
- package/dist/duplicates/units.js +23 -22
- package/dist/duplicates/units.js.map +1 -1
- package/dist/graph-builder.d.ts +1 -1
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +3 -2
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-edge-collector.d.ts +3 -1
- package/dist/graph-edge-collector.d.ts.map +1 -1
- package/dist/graph-edge-collector.js +38 -6
- package/dist/graph-edge-collector.js.map +1 -1
- package/dist/graphs/angularjs.d.ts.map +1 -1
- package/dist/graphs/angularjs.js +2 -9
- package/dist/graphs/angularjs.js.map +1 -1
- package/dist/graphs/edge-resolution.d.ts +4 -0
- package/dist/graphs/edge-resolution.d.ts.map +1 -1
- package/dist/graphs/edge-resolution.js +2 -0
- package/dist/graphs/edge-resolution.js.map +1 -1
- package/dist/graphs/external/manifests.d.ts.map +1 -1
- package/dist/graphs/external/manifests.js +1 -6
- package/dist/graphs/external/manifests.js.map +1 -1
- package/dist/graphs/specifiers.d.ts.map +1 -1
- package/dist/graphs/specifiers.js +47 -26
- package/dist/graphs/specifiers.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts +2 -0
- package/dist/graphs/symbol-graph-detailed/edge-passes.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/edge-passes.js +9 -3
- package/dist/graphs/symbol-graph-detailed/edge-passes.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts +3 -3
- package/dist/graphs/symbol-graph-detailed/receiver-calls.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed/receiver-calls.js +2 -26
- 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 +38 -1
- package/dist/graphs/symbol-graph-detailed.js.map +1 -1
- package/dist/graphs/symbol-graph.d.ts +1 -1
- package/dist/graphs/symbol-graph.d.ts.map +1 -1
- package/dist/graphs/symbol-graph.js +8 -0
- package/dist/graphs/symbol-graph.js.map +1 -1
- package/dist/impact/analyzer.d.ts.map +1 -1
- package/dist/impact/analyzer.js +116 -17
- package/dist/impact/analyzer.js.map +1 -1
- package/dist/impact/budgets.d.ts.map +1 -1
- package/dist/impact/budgets.js +3 -9
- package/dist/impact/budgets.js.map +1 -1
- package/dist/impact/call-compatibility.d.ts.map +1 -1
- package/dist/impact/call-compatibility.js +3 -12
- package/dist/impact/call-compatibility.js.map +1 -1
- package/dist/impact/context.d.ts +6 -0
- package/dist/impact/context.d.ts.map +1 -1
- package/dist/impact/context.js +2 -2
- package/dist/impact/context.js.map +1 -1
- package/dist/impact/direct.d.ts.map +1 -1
- package/dist/impact/direct.js +2 -6
- package/dist/impact/direct.js.map +1 -1
- package/dist/impact/map.d.ts +3 -1
- package/dist/impact/map.d.ts.map +1 -1
- package/dist/impact/map.js +12 -5
- package/dist/impact/map.js.map +1 -1
- package/dist/impact/reference-cache.d.ts.map +1 -1
- package/dist/impact/reference-cache.js +1 -24
- package/dist/impact/reference-cache.js.map +1 -1
- package/dist/impact/report-shared.d.ts +2 -1
- package/dist/impact/report-shared.d.ts.map +1 -1
- package/dist/impact/report-shared.js +10 -0
- package/dist/impact/report-shared.js.map +1 -1
- package/dist/impact/report-suggestions.d.ts.map +1 -1
- package/dist/impact/report-suggestions.js +2 -8
- package/dist/impact/report-suggestions.js.map +1 -1
- package/dist/impact/report.d.ts.map +1 -1
- package/dist/impact/report.js +2 -8
- package/dist/impact/report.js.map +1 -1
- package/dist/impact/streaming.d.ts.map +1 -1
- package/dist/impact/streaming.js +3 -8
- package/dist/impact/streaming.js.map +1 -1
- package/dist/impact/transitive.d.ts +6 -2
- package/dist/impact/transitive.d.ts.map +1 -1
- package/dist/impact/transitive.js +23 -11
- package/dist/impact/transitive.js.map +1 -1
- package/dist/indexer/build-cache/manifest.d.ts.map +1 -1
- package/dist/indexer/build-cache/manifest.js +10 -108
- package/dist/indexer/build-cache/manifest.js.map +1 -1
- package/dist/indexer/build-cache/module-cache.d.ts +6 -1
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache/module-cache.js +25 -2
- package/dist/indexer/build-cache/module-cache.js.map +1 -1
- package/dist/indexer/build-cache/options.d.ts +40 -1
- package/dist/indexer/build-cache/options.d.ts.map +1 -1
- package/dist/indexer/build-cache/options.js +40 -1
- package/dist/indexer/build-cache/options.js.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.js +52 -99
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
- package/dist/indexer/build-cache/reports.d.ts +1 -0
- package/dist/indexer/build-cache/reports.d.ts.map +1 -1
- package/dist/indexer/build-cache/reports.js +10 -0
- package/dist/indexer/build-cache/reports.js.map +1 -1
- package/dist/indexer/build-index.d.ts +2 -0
- package/dist/indexer/build-index.d.ts.map +1 -1
- package/dist/indexer/build-index.js +187 -57
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/build-workers.d.ts +7 -1
- package/dist/indexer/build-workers.d.ts.map +1 -1
- package/dist/indexer/build-workers.js +12 -0
- package/dist/indexer/build-workers.js.map +1 -1
- package/dist/indexer/call-hierarchy.d.ts.map +1 -1
- package/dist/indexer/call-hierarchy.js +5 -17
- package/dist/indexer/call-hierarchy.js.map +1 -1
- package/dist/indexer/compilation-units.d.ts +32 -20
- package/dist/indexer/compilation-units.d.ts.map +1 -1
- package/dist/indexer/compilation-units.js +139 -145
- package/dist/indexer/compilation-units.js.map +1 -1
- package/dist/indexer/cpp-callables.d.ts.map +1 -1
- package/dist/indexer/cpp-callables.js +2 -7
- package/dist/indexer/cpp-callables.js.map +1 -1
- package/dist/indexer/declarations.d.ts.map +1 -1
- package/dist/indexer/declarations.js +32 -7
- package/dist/indexer/declarations.js.map +1 -1
- package/dist/indexer/import-resolution-tables.d.ts.map +1 -1
- package/dist/indexer/import-resolution-tables.js +10 -0
- package/dist/indexer/import-resolution-tables.js.map +1 -1
- package/dist/indexer/import-types.d.ts +5 -0
- package/dist/indexer/import-types.d.ts.map +1 -1
- package/dist/indexer/import-types.js.map +1 -1
- package/dist/indexer/imports/binding-ranges.d.ts +5 -12
- package/dist/indexer/imports/binding-ranges.d.ts.map +1 -1
- package/dist/indexer/imports/binding-ranges.js +13 -19
- package/dist/indexer/imports/binding-ranges.js.map +1 -1
- package/dist/indexer/imports/context.d.ts +6 -0
- package/dist/indexer/imports/context.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.d.ts +28 -13
- package/dist/indexer/imports/import-binding-tables.d.ts.map +1 -1
- package/dist/indexer/imports/import-binding-tables.js +182 -178
- package/dist/indexer/imports/import-binding-tables.js.map +1 -1
- package/dist/indexer/imports/js-text-imports.d.ts +0 -1
- package/dist/indexer/imports/js-text-imports.d.ts.map +1 -1
- package/dist/indexer/imports/js-text-imports.js +0 -176
- package/dist/indexer/imports/js-text-imports.js.map +1 -1
- package/dist/indexer/imports/language-specific.d.ts.map +1 -1
- package/dist/indexer/imports/language-specific.js +4 -8
- package/dist/indexer/imports/language-specific.js.map +1 -1
- package/dist/indexer/imports/python.d.ts +0 -1
- package/dist/indexer/imports/python.d.ts.map +1 -1
- package/dist/indexer/imports/python.js +1 -29
- package/dist/indexer/imports/python.js.map +1 -1
- package/dist/indexer/imports/text-import-extractors.d.ts +2 -9
- package/dist/indexer/imports/text-import-extractors.d.ts.map +1 -1
- package/dist/indexer/imports/text-import-extractors.js +0 -284
- package/dist/indexer/imports/text-import-extractors.js.map +1 -1
- package/dist/indexer/imports.d.ts +15 -0
- package/dist/indexer/imports.d.ts.map +1 -1
- package/dist/indexer/imports.js +82 -44
- package/dist/indexer/imports.js.map +1 -1
- package/dist/indexer/incremental-plan.d.ts +0 -1
- package/dist/indexer/incremental-plan.d.ts.map +1 -1
- package/dist/indexer/incremental-plan.js +6 -12
- package/dist/indexer/incremental-plan.js.map +1 -1
- package/dist/indexer/locals-and-exports.d.ts.map +1 -1
- package/dist/indexer/locals-and-exports.js +8 -0
- package/dist/indexer/locals-and-exports.js.map +1 -1
- package/dist/indexer/name-lookup-policies/implicit-self.d.ts.map +1 -1
- package/dist/indexer/name-lookup-policies/implicit-self.js +25 -4
- package/dist/indexer/name-lookup-policies/implicit-self.js.map +1 -1
- package/dist/indexer/name-resolution-types.d.ts +5 -0
- package/dist/indexer/name-resolution-types.d.ts.map +1 -1
- package/dist/indexer/name-resolution.d.ts.map +1 -1
- package/dist/indexer/name-resolution.js +2 -0
- package/dist/indexer/name-resolution.js.map +1 -1
- package/dist/indexer/navigation-cpp.d.ts.map +1 -1
- package/dist/indexer/navigation-cpp.js +3 -5
- package/dist/indexer/navigation-cpp.js.map +1 -1
- package/dist/indexer/navigation-goto.d.ts +49 -3
- package/dist/indexer/navigation-goto.d.ts.map +1 -1
- package/dist/indexer/navigation-goto.js +500 -106
- package/dist/indexer/navigation-goto.js.map +1 -1
- package/dist/indexer/navigation-local.d.ts +7 -0
- package/dist/indexer/navigation-local.d.ts.map +1 -1
- package/dist/indexer/navigation-local.js +22 -2
- package/dist/indexer/navigation-local.js.map +1 -1
- package/dist/indexer/navigation-php.d.ts +0 -1
- package/dist/indexer/navigation-php.d.ts.map +1 -1
- package/dist/indexer/navigation-php.js +1 -7
- package/dist/indexer/navigation-php.js.map +1 -1
- package/dist/indexer/navigation-references.d.ts +1 -0
- package/dist/indexer/navigation-references.d.ts.map +1 -1
- package/dist/indexer/navigation-references.js +134 -23
- package/dist/indexer/navigation-references.js.map +1 -1
- package/dist/indexer/navigation-resolve.d.ts +22 -0
- package/dist/indexer/navigation-resolve.d.ts.map +1 -1
- package/dist/indexer/navigation-resolve.js +73 -8
- package/dist/indexer/navigation-resolve.js.map +1 -1
- package/dist/indexer/navigation.d.ts +4 -1
- package/dist/indexer/navigation.d.ts.map +1 -1
- package/dist/indexer/navigation.js +429 -109
- package/dist/indexer/navigation.js.map +1 -1
- package/dist/indexer/python-property-decorator.d.ts +11 -0
- package/dist/indexer/python-property-decorator.d.ts.map +1 -0
- package/dist/indexer/python-property-decorator.js +30 -0
- package/dist/indexer/python-property-decorator.js.map +1 -0
- package/dist/indexer/reference-context.d.ts.map +1 -1
- package/dist/indexer/reference-context.js +4 -1
- package/dist/indexer/reference-context.js.map +1 -1
- package/dist/indexer/scope-nodes.d.ts.map +1 -1
- package/dist/indexer/scope-nodes.js +5 -0
- package/dist/indexer/scope-nodes.js.map +1 -1
- package/dist/indexer/shared-owner-identity.d.ts +3 -1
- package/dist/indexer/shared-owner-identity.d.ts.map +1 -1
- package/dist/indexer/shared-owner-identity.js +40 -12
- package/dist/indexer/shared-owner-identity.js.map +1 -1
- package/dist/indexer/shared.d.ts +10 -0
- package/dist/indexer/shared.d.ts.map +1 -1
- package/dist/indexer/shared.js +8 -0
- package/dist/indexer/shared.js.map +1 -1
- package/dist/indexer/star-import-precedence.d.ts +5 -1
- package/dist/indexer/star-import-precedence.d.ts.map +1 -1
- package/dist/indexer/star-import-precedence.js +12 -19
- package/dist/indexer/star-import-precedence.js.map +1 -1
- package/dist/indexer/type-hierarchy.d.ts.map +1 -1
- package/dist/indexer/type-hierarchy.js +8 -9
- package/dist/indexer/type-hierarchy.js.map +1 -1
- package/dist/indexer/types.d.ts +54 -2
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/indexer/types.js +4 -0
- package/dist/indexer/types.js.map +1 -1
- package/dist/indexer/workspace-symbols.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.js +3 -13
- package/dist/indexer/workspace-symbols.js.map +1 -1
- package/dist/installer/locks.d.ts +1 -0
- package/dist/installer/locks.d.ts.map +1 -1
- package/dist/installer/locks.js +4 -8
- package/dist/installer/locks.js.map +1 -1
- package/dist/installer/registry.d.ts.map +1 -1
- package/dist/installer/registry.js +9 -15
- package/dist/installer/registry.js.map +1 -1
- package/dist/languages/all.d.ts +1 -0
- package/dist/languages/all.d.ts.map +1 -1
- package/dist/languages/all.js +1 -0
- package/dist/languages/all.js.map +1 -1
- package/dist/languages/callable-arity.d.ts.map +1 -1
- package/dist/languages/callable-arity.js +1 -38
- package/dist/languages/callable-arity.js.map +1 -1
- package/dist/languages/definitions/csharp.d.ts.map +1 -1
- package/dist/languages/definitions/csharp.js +5 -13
- package/dist/languages/definitions/csharp.js.map +1 -1
- package/dist/languages/definitions/java.d.ts.map +1 -1
- package/dist/languages/definitions/java.js +4 -13
- package/dist/languages/definitions/java.js.map +1 -1
- package/dist/languages/definitions/kotlin.d.ts.map +1 -1
- package/dist/languages/definitions/kotlin.js +4 -8
- package/dist/languages/definitions/kotlin.js.map +1 -1
- package/dist/languages/definitions/python.d.ts.map +1 -1
- package/dist/languages/definitions/python.js +5 -3
- package/dist/languages/definitions/python.js.map +1 -1
- package/dist/languages/definitions/terraform.d.ts +9 -0
- package/dist/languages/definitions/terraform.d.ts.map +1 -0
- package/dist/languages/definitions/terraform.js +84 -0
- package/dist/languages/definitions/terraform.js.map +1 -0
- package/dist/languages/import-statement-parsers.d.ts +0 -30
- package/dist/languages/import-statement-parsers.d.ts.map +1 -1
- package/dist/languages/import-statement-parsers.js +1 -81
- package/dist/languages/import-statement-parsers.js.map +1 -1
- package/dist/languages/sfc.d.ts.map +1 -1
- package/dist/languages/sfc.js +8 -43
- package/dist/languages/sfc.js.map +1 -1
- package/dist/languages.d.ts +1 -0
- package/dist/languages.d.ts.map +1 -1
- package/dist/languages.js +1 -0
- package/dist/languages.js.map +1 -1
- package/dist/lifecycle/manifest.d.ts.map +1 -1
- package/dist/lifecycle/manifest.js +11 -29
- package/dist/lifecycle/manifest.js.map +1 -1
- package/dist/mcp/handlers.d.ts +21 -0
- package/dist/mcp/handlers.d.ts.map +1 -1
- package/dist/mcp/handlers.js +66 -20
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/mcp/http-transport.d.ts.map +1 -1
- package/dist/mcp/http-transport.js +5 -1
- package/dist/mcp/http-transport.js.map +1 -1
- package/dist/mcp/project-watcher.d.ts +125 -0
- package/dist/mcp/project-watcher.d.ts.map +1 -0
- package/dist/mcp/project-watcher.js +643 -0
- package/dist/mcp/project-watcher.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +5 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/native/byte-index.d.ts +1 -0
- package/dist/native/byte-index.d.ts.map +1 -1
- package/dist/native/byte-index.js +1 -1
- package/dist/native/byte-index.js.map +1 -1
- package/dist/native/contracts.d.ts +1 -0
- package/dist/native/contracts.d.ts.map +1 -1
- package/dist/native/native-backend-report.d.ts +2 -1
- package/dist/native/native-backend-report.d.ts.map +1 -1
- package/dist/native/native-backend-report.js +23 -0
- package/dist/native/native-backend-report.js.map +1 -1
- package/dist/native/tree-shape.d.ts +5 -7
- package/dist/native/tree-shape.d.ts.map +1 -1
- package/dist/native/tree-shape.js +11 -10
- package/dist/native/tree-shape.js.map +1 -1
- package/dist/presentation/bounds.d.ts +2 -0
- package/dist/presentation/bounds.d.ts.map +1 -1
- package/dist/presentation/bounds.js +8 -0
- package/dist/presentation/bounds.js.map +1 -1
- package/dist/review/candidates.d.ts.map +1 -1
- package/dist/review/candidates.js +4 -25
- package/dist/review/candidates.js.map +1 -1
- package/dist/review/report.d.ts.map +1 -1
- package/dist/review/report.js +4 -2
- package/dist/review/report.js.map +1 -1
- package/dist/review/summaries.d.ts.map +1 -1
- package/dist/review/summaries.js +14 -35
- package/dist/review/summaries.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +4 -5
- package/dist/review.js.map +1 -1
- package/dist/scss/navigation.d.ts +13 -0
- package/dist/scss/navigation.d.ts.map +1 -0
- package/dist/scss/navigation.js +150 -0
- package/dist/scss/navigation.js.map +1 -0
- package/dist/scss/resolution.d.ts +190 -0
- package/dist/scss/resolution.d.ts.map +1 -0
- package/dist/scss/resolution.js +1802 -0
- package/dist/scss/resolution.js.map +1 -0
- package/dist/scss/syntax.d.ts +181 -0
- package/dist/scss/syntax.d.ts.map +1 -0
- package/dist/scss/syntax.js +1436 -0
- package/dist/scss/syntax.js.map +1 -0
- package/dist/sql/classify-sql-file.d.ts +7 -0
- package/dist/sql/classify-sql-file.d.ts.map +1 -1
- package/dist/sql/classify-sql-file.js +9 -0
- package/dist/sql/classify-sql-file.js.map +1 -1
- package/dist/sql/extract-facts.d.ts.map +1 -1
- package/dist/sql/extract-facts.js +517 -77
- package/dist/sql/extract-facts.js.map +1 -1
- package/dist/sql/lex.d.ts +100 -1
- package/dist/sql/lex.d.ts.map +1 -1
- package/dist/sql/lex.js +473 -11
- package/dist/sql/lex.js.map +1 -1
- package/dist/sql/lookup.d.ts +17 -0
- package/dist/sql/lookup.d.ts.map +1 -1
- package/dist/sql/lookup.js +21 -0
- package/dist/sql/lookup.js.map +1 -1
- package/dist/sql/navigation.d.ts +28 -1
- package/dist/sql/navigation.d.ts.map +1 -1
- package/dist/sql/navigation.js +474 -84
- package/dist/sql/navigation.js.map +1 -1
- package/dist/sql/object-mentions.d.ts +24 -0
- package/dist/sql/object-mentions.d.ts.map +1 -0
- package/dist/sql/object-mentions.js +233 -0
- package/dist/sql/object-mentions.js.map +1 -0
- package/dist/sql/review.d.ts +3 -0
- package/dist/sql/review.d.ts.map +1 -1
- package/dist/sql/review.js +15 -14
- package/dist/sql/review.js.map +1 -1
- package/dist/sql/routine-mentions.d.ts +61 -0
- package/dist/sql/routine-mentions.d.ts.map +1 -0
- package/dist/sql/routine-mentions.js +868 -0
- package/dist/sql/routine-mentions.js.map +1 -0
- package/dist/sql/source-graph.d.ts +18 -3
- package/dist/sql/source-graph.d.ts.map +1 -1
- package/dist/sql/source-graph.js +109 -32
- package/dist/sql/source-graph.js.map +1 -1
- package/dist/sqlite/raw-query-worker-pool.d.ts.map +1 -1
- package/dist/sqlite/raw-query-worker-pool.js +2 -0
- package/dist/sqlite/raw-query-worker-pool.js.map +1 -1
- package/dist/sqlite/types.d.ts +6 -5
- package/dist/sqlite/types.d.ts.map +1 -1
- package/dist/sqlite/write.d.ts.map +1 -1
- package/dist/sqlite/write.js.map +1 -1
- package/dist/sqlite-driver.d.ts +0 -1
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +0 -11
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/terraform/navigation.d.ts +20 -0
- package/dist/terraform/navigation.d.ts.map +1 -0
- package/dist/terraform/navigation.js +140 -0
- package/dist/terraform/navigation.js.map +1 -0
- package/dist/terraform/resolution.d.ts +82 -0
- package/dist/terraform/resolution.d.ts.map +1 -0
- package/dist/terraform/resolution.js +324 -0
- package/dist/terraform/resolution.js.map +1 -0
- package/dist/terraform/syntax.d.ts +109 -0
- package/dist/terraform/syntax.d.ts.map +1 -0
- package/dist/terraform/syntax.js +438 -0
- package/dist/terraform/syntax.js.map +1 -0
- package/dist/util/ast.d.ts +5 -0
- package/dist/util/ast.d.ts.map +1 -1
- package/dist/util/ast.js +10 -0
- package/dist/util/ast.js.map +1 -1
- package/dist/util/atomic-file.d.ts +22 -0
- package/dist/util/atomic-file.d.ts.map +1 -0
- package/dist/util/atomic-file.js +106 -0
- package/dist/util/atomic-file.js.map +1 -0
- package/dist/util/collections.d.ts +5 -0
- package/dist/util/collections.d.ts.map +1 -1
- package/dist/util/collections.js +26 -0
- package/dist/util/collections.js.map +1 -1
- package/dist/util/concurrency.d.ts +1 -0
- package/dist/util/concurrency.d.ts.map +1 -1
- package/dist/util/concurrency.js +5 -0
- package/dist/util/concurrency.js.map +1 -1
- package/dist/util/confined-file.d.ts.map +1 -1
- package/dist/util/confined-file.js +1 -3
- package/dist/util/confined-file.js.map +1 -1
- package/dist/util/csharp-tree.d.ts +65 -0
- package/dist/util/csharp-tree.d.ts.map +1 -0
- package/dist/util/csharp-tree.js +266 -0
- package/dist/util/csharp-tree.js.map +1 -0
- package/dist/util/errors.d.ts +1 -0
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +3 -0
- package/dist/util/errors.js.map +1 -1
- package/dist/util/graph-edges.d.ts +2 -0
- package/dist/util/graph-edges.d.ts.map +1 -1
- package/dist/util/graph-edges.js +11 -0
- package/dist/util/graph-edges.js.map +1 -1
- package/dist/util/guards.d.ts +1 -0
- package/dist/util/guards.d.ts.map +1 -1
- package/dist/util/guards.js +6 -0
- package/dist/util/guards.js.map +1 -1
- package/dist/util/identifiers.d.ts +0 -24
- package/dist/util/identifiers.d.ts.map +1 -1
- package/dist/util/identifiers.js +0 -24
- package/dist/util/identifiers.js.map +1 -1
- package/dist/util/jvm-tree.d.ts +58 -0
- package/dist/util/jvm-tree.d.ts.map +1 -0
- package/dist/util/jvm-tree.js +153 -0
- package/dist/util/jvm-tree.js.map +1 -0
- package/dist/util/member-access-tables.d.ts.map +1 -1
- package/dist/util/member-access-tables.js +3 -0
- package/dist/util/member-access-tables.js.map +1 -1
- package/dist/util/package-exports.d.ts +0 -22
- package/dist/util/package-exports.d.ts.map +1 -1
- package/dist/util/package-exports.js +25 -5
- package/dist/util/package-exports.js.map +1 -1
- package/dist/util/paths.d.ts +1 -0
- package/dist/util/paths.d.ts.map +1 -1
- package/dist/util/paths.js +10 -4
- package/dist/util/paths.js.map +1 -1
- package/dist/util/project-files.d.ts.map +1 -1
- package/dist/util/project-files.js +3 -1
- package/dist/util/project-files.js.map +1 -1
- package/dist/util/resolution/csharp.d.ts +20 -8
- package/dist/util/resolution/csharp.d.ts.map +1 -1
- package/dist/util/resolution/csharp.js +126 -127
- package/dist/util/resolution/csharp.js.map +1 -1
- package/dist/util/resolution/files.d.ts +6 -0
- package/dist/util/resolution/files.d.ts.map +1 -1
- package/dist/util/resolution/files.js +74 -21
- package/dist/util/resolution/files.js.map +1 -1
- package/dist/util/resolution/jvm.d.ts +21 -1
- package/dist/util/resolution/jvm.d.ts.map +1 -1
- package/dist/util/resolution/jvm.js +168 -100
- package/dist/util/resolution/jvm.js.map +1 -1
- package/dist/util/resolution/project-symbols.d.ts +1 -1
- package/dist/util/resolution/project-symbols.d.ts.map +1 -1
- package/dist/util/resolution/project-symbols.js.map +1 -1
- package/dist/util/resolution/specifier-targets.d.ts +4 -0
- package/dist/util/resolution/specifier-targets.d.ts.map +1 -1
- package/dist/util/resolution/specifier-targets.js +16 -3
- package/dist/util/resolution/specifier-targets.js.map +1 -1
- package/dist/util/resolution/terraform.d.ts +18 -0
- package/dist/util/resolution/terraform.d.ts.map +1 -0
- package/dist/util/resolution/terraform.js +64 -0
- package/dist/util/resolution/terraform.js.map +1 -0
- package/dist/util/resolution.d.ts.map +1 -1
- package/dist/util/resolution.js +21 -7
- package/dist/util/resolution.js.map +1 -1
- package/dist/util/syntax-tree.d.ts +16 -0
- package/dist/util/syntax-tree.d.ts.map +1 -0
- package/dist/util/syntax-tree.js +34 -0
- package/dist/util/syntax-tree.js.map +1 -0
- package/dist/util/text-scanning.d.ts +6 -0
- package/dist/util/text-scanning.d.ts.map +1 -0
- package/dist/util/text-scanning.js +35 -0
- package/dist/util/text-scanning.js.map +1 -0
- package/dist/util/trivia-tables.d.ts +13 -8
- package/dist/util/trivia-tables.d.ts.map +1 -1
- package/dist/util/trivia-tables.js +13 -63
- package/dist/util/trivia-tables.js.map +1 -1
- package/dist/util/trivia.d.ts +10 -3
- package/dist/util/trivia.d.ts.map +1 -1
- package/dist/util/trivia.js +209 -79
- package/dist/util/trivia.js.map +1 -1
- package/dist/util/windows-process-drain.d.ts.map +1 -1
- package/dist/util/windows-process-drain.js.map +1 -1
- package/dist/util/worker-threads.d.ts +16 -0
- package/dist/util/worker-threads.d.ts.map +1 -1
- package/dist/util/worker-threads.js +118 -0
- package/dist/util/worker-threads.js.map +1 -1
- package/dist/worker/native-worker-pool.d.ts.map +1 -1
- package/dist/worker/native-worker-pool.js +2 -1
- package/dist/worker/native-worker-pool.js.map +1 -1
- package/docs/mcp.md +27 -2
- package/package.json +8 -8
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { LanguageExtensionMap } from "../../languages.js";
|
|
2
|
+
import type { SyntaxNodeLike } from "../../languages/types.js";
|
|
3
|
+
import type { JvmImportDirective } from "../../util/jvm-tree.js";
|
|
2
4
|
import type { Range } from "../../types.js";
|
|
3
5
|
import type { CFamilyIncludeForm, RubyLoadForm } from "../../util/specifiers.js";
|
|
4
|
-
import type { ImportBinding } from "../types.js";
|
|
5
|
-
import type { ImportBindingSink, ImportResolver, ResolvedImportTarget } from "./context.js";
|
|
6
|
+
import type { BuildReport, ImportBinding } from "../types.js";
|
|
7
|
+
import type { ImportBindingSink, ImportDegradedHook, ImportResolver, ResolvedImportTarget } from "./context.js";
|
|
8
|
+
import type { ParsedFileContext } from "../parse-context.js";
|
|
6
9
|
/**
|
|
7
10
|
* Per-language import-binding registry for statement overrides and implicit native-capture
|
|
8
11
|
* mapping. Rows are keyed by language id and live next to `language-specific.ts` because that
|
|
9
12
|
* file is the only dispatch consumer this wave.
|
|
10
13
|
*
|
|
11
14
|
* One row owns the statement handler, the implicit mapper, and the flags those paths used to
|
|
12
|
-
* spell as `languageId === "..."` chains: trivia masking,
|
|
13
|
-
*
|
|
15
|
+
* spell as `languageId === "..."` chains: trivia masking, Rust statement-key offsets, and Rust's
|
|
16
|
+
* reduced-mode rescan. C# and the JVM languages bind their directives from syntax-tree nodes
|
|
17
|
+
* (`applyCsharpImportDirective`, `applyJvmImportDirective`), so their rows name no statement handler.
|
|
14
18
|
* `text-import-extractors.ts` stays the shared discovery source; this table does not re-scan.
|
|
15
19
|
*
|
|
16
20
|
* `tests/import-binding-tables.test.ts` asserts every registered language has a row, that an
|
|
@@ -24,6 +28,10 @@ export type LanguageSpecificImportContext = ImportBindingSink & {
|
|
|
24
28
|
resolveFrom: ImportResolver;
|
|
25
29
|
/** Active extension-to-language mapping, so a resolved file is classified as the language that parses it. */
|
|
26
30
|
languageExtensions?: LanguageExtensionMap;
|
|
31
|
+
parsedFiles?: ReadonlyMap<string, ParsedFileContext>;
|
|
32
|
+
report?: BuildReport;
|
|
33
|
+
/** Reports that this file's imports are incomplete, so the module that holds them is marked parser-degraded. */
|
|
34
|
+
onDegraded?: ImportDegradedHook;
|
|
27
35
|
getBindings: () => ImportBinding[];
|
|
28
36
|
replaceBindings: (bindings: ImportBinding[]) => void;
|
|
29
37
|
};
|
|
@@ -38,17 +46,16 @@ export type ImplicitImportBindingArgs = {
|
|
|
38
46
|
alias?: string;
|
|
39
47
|
/** UTF-16 range of the captured alias token, when the native alias capture proved it. */
|
|
40
48
|
localRange?: Range;
|
|
41
|
-
wildcard?: boolean;
|
|
42
49
|
includeForm?: CFamilyIncludeForm;
|
|
43
50
|
rubyLoadForm?: RubyLoadForm;
|
|
44
51
|
};
|
|
45
52
|
export type ApplyStatementImportOverride = (context: LanguageSpecificImportContext, parserStmt: string, typeOnly: boolean, statementStartIndex?: number) => Promise<boolean>;
|
|
46
53
|
export type AppendImplicitImportBinding = (context: LanguageSpecificImportContext, args: ImplicitImportBindingArgs) => void;
|
|
47
54
|
/**
|
|
48
|
-
* How a statement override prepares text before the parser: mask
|
|
49
|
-
*
|
|
55
|
+
* How a statement override prepares text before the parser: mask only PHP `use` statements
|
|
56
|
+
* (includes keep string payloads), or leave the trimmed source untouched (Rust).
|
|
50
57
|
*/
|
|
51
|
-
export type StatementTriviaMask =
|
|
58
|
+
export type StatementTriviaMask = false | "use-keyword";
|
|
52
59
|
export type ImportBindingRow = {
|
|
53
60
|
/** Why the language has no statement override and no implicit mapper. */
|
|
54
61
|
omittedReason?: string;
|
|
@@ -56,15 +63,11 @@ export type ImportBindingRow = {
|
|
|
56
63
|
appendImplicit?: AppendImplicitImportBinding;
|
|
57
64
|
/** Present only with `applyStatement`. */
|
|
58
65
|
maskTrivia?: StatementTriviaMask;
|
|
59
|
-
/** Collapse whitespace around `.` after masking (C#, Java, Kotlin). */
|
|
60
|
-
normalizeDots?: true;
|
|
61
66
|
/**
|
|
62
|
-
* Include the statement start offset in the override de-dupe key (
|
|
67
|
+
* Include the statement start offset in the override de-dupe key (Rust). Required when the
|
|
63
68
|
* same statement text can appear in several scopes and each must keep its own range.
|
|
64
69
|
*/
|
|
65
70
|
statementKeyUsesOffset?: true;
|
|
66
|
-
/** Named-range attribution treats unaliased `local === imported` as two tokens (C#). */
|
|
67
|
-
alwaysAliased?: true;
|
|
68
71
|
/** Reduced-mode text bindings re-run even when native already produced some (Rust). */
|
|
69
72
|
rescanTextBindings?: true;
|
|
70
73
|
/** Why the language declares no statement override. */
|
|
@@ -72,5 +75,17 @@ export type ImportBindingRow = {
|
|
|
72
75
|
/** Why the language declares no implicit mapper. */
|
|
73
76
|
implicitOmittedReason?: string;
|
|
74
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Binds one C# `using` or `extern alias` directive. The node comes from `collectCsharpImportDirectives`, so the
|
|
80
|
+
* directive is never found again by its text or offset. C# has no type-only imports.
|
|
81
|
+
*/
|
|
82
|
+
export declare function applyCsharpImportDirective(context: LanguageSpecificImportContext, directive: SyntaxNodeLike): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Binds one Java or Kotlin `import`. The directive comes from `collectJvmImportDirectives`, so its ranges are its
|
|
85
|
+
* nodes' own and it is never found again by its text or offset. Neither language has type-only imports. Every form
|
|
86
|
+
* resolves `directive.from`, the name its dependency edge resolves too: the type, the owner of a static member, or the
|
|
87
|
+
* package or type of a wildcard.
|
|
88
|
+
*/
|
|
89
|
+
export declare function applyJvmImportDirective(context: LanguageSpecificImportContext, { from, leaf, isStatic, wildcard, alias }: JvmImportDirective): Promise<void>;
|
|
75
90
|
export declare const IMPORT_BINDING_ROWS: Record<string, ImportBindingRow>;
|
|
76
91
|
//# sourceMappingURL=import-binding-tables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-binding-tables.d.ts","sourceRoot":"","sources":["../../../src/indexer/imports/import-binding-tables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import-binding-tables.d.ts","sourceRoot":"","sources":["../../../src/indexer/imports/import-binding-tables.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAUjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,GAAG;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,cAAc,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,gHAAgH;IAChH,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,EAAE,MAAM,aAAa,EAAE,CAAC;IACnC,eAAe,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CACzC,OAAO,EAAE,6BAA6B,EACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,OAAO,EACjB,mBAAmB,CAAC,EAAE,MAAM,KACzB,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,yBAAyB,KAC5B,IAAI,CAAC;AAEV;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,aAAa,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yEAAyE;IACzE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,cAAc,CAAC,EAAE,2BAA2B,CAAC;IAC7C,0CAA0C;IAC1C,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC9B,uFAAuF;IACvF,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAC1B,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AA8DF;;;GAGG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,6BAA6B,EACtC,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,IAAI,CAAC,CAoKf;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,6BAA6B,EACtC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,GAC5D,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAiSD,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAwFhE,CAAC"}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { parsePhpImportStatement, parseRustImportStatements, rustImportKeywordOffset, } from "../../languages/import-statement-parsers.js";
|
|
2
|
+
import { csharpExternAlias, csharpUsingDirective } from "../../util/csharp-tree.js";
|
|
3
|
+
import { isJvmLanguage } from "../../util/syntax-tree.js";
|
|
4
|
+
import { toRange } from "../../util/ast.js";
|
|
5
|
+
import { normalizeCsharpIdentifier, normalizeCsharpQualifiedName } from "../../util/identifiers.js";
|
|
3
6
|
import { isRustCfgTestStatement } from "../../util/rust-test-modules.js";
|
|
4
7
|
import { resolveCsharpDottedTypeImportPath, resolveCsharpNamespaceImportPaths } from "../../util/resolution/csharp.js";
|
|
8
|
+
import { lookupJvmImport } from "../../util/resolution/jvm.js";
|
|
5
9
|
import { extractRustModPathAttribute } from "../../util/resolution/rust.js";
|
|
6
10
|
import { collectLineStartOffsets } from "../../util/lines.js";
|
|
7
11
|
import { attributeNamedBindingRanges, maskImportBindingTrivia, sourceRangeFromOffsets } from "./binding-ranges.js";
|
|
8
|
-
function
|
|
12
|
+
function csharpNodeRange(node, source, lineStarts) {
|
|
13
|
+
let startIndex = node.startIndex;
|
|
14
|
+
if (startIndex && source[startIndex - 1] === "@")
|
|
15
|
+
startIndex -= 1;
|
|
16
|
+
return sourceRangeFromOffsets(lineStarts, startIndex, node.endIndex);
|
|
17
|
+
}
|
|
18
|
+
function csharpAliasTargetLeaf(node) {
|
|
19
|
+
if (node.type === "identifier" || node.type === "predefined_type")
|
|
20
|
+
return node;
|
|
21
|
+
// A generic name is its identifier followed by type arguments; only the identifier names the target.
|
|
22
|
+
if (node.type === "generic_name")
|
|
23
|
+
return node.namedChildren.find((child) => child.type === "identifier") ?? null;
|
|
24
|
+
if (node.type === "qualified_name" || node.type === "alias_qualified_name") {
|
|
25
|
+
const name = node.childForFieldName("name");
|
|
26
|
+
if (name)
|
|
27
|
+
return csharpAliasTargetLeaf(name);
|
|
28
|
+
}
|
|
29
|
+
for (let index = node.namedChildren.length - 1; index >= 0; index -= 1) {
|
|
30
|
+
const leaf = csharpAliasTargetLeaf(node.namedChildren[index]);
|
|
31
|
+
if (leaf)
|
|
32
|
+
return leaf;
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
function pushCsharpOverride(context, parsed, directiveStartIndex, typeOnly, fromValue, resolved, localRange, importedRange) {
|
|
9
37
|
if (parsed.alias) {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
38
|
+
const localStart = localRange?.start.index;
|
|
39
|
+
const importedStart = importedRange?.start.index;
|
|
40
|
+
const local = localStart === undefined ? parsed.alias.text : context.source.slice(localStart, parsed.alias.endIndex);
|
|
41
|
+
const imported = importedStart === undefined ? parsed.leaf.text : context.source.slice(importedStart, parsed.leaf.endIndex);
|
|
12
42
|
context.pushBinding({
|
|
13
43
|
kind: "named",
|
|
14
|
-
local
|
|
44
|
+
local,
|
|
15
45
|
imported,
|
|
16
46
|
from: fromValue,
|
|
17
47
|
explicitAlias: true,
|
|
48
|
+
...(localRange ? { localRange } : {}),
|
|
49
|
+
...(importedRange ? { importedRange } : {}),
|
|
18
50
|
resolved,
|
|
19
51
|
typeOnly,
|
|
20
52
|
});
|
|
@@ -25,112 +57,129 @@ function pushCsharpOverride(context, parsed, typeOnly, fromValue, resolved) {
|
|
|
25
57
|
from: fromValue,
|
|
26
58
|
resolved,
|
|
27
59
|
typeOnly,
|
|
60
|
+
csharpDirectiveStartIndex: directiveStartIndex,
|
|
28
61
|
});
|
|
29
62
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// spaces, newlines survive), so every match offset is the raw-source offset.
|
|
38
|
-
const masked = maskImportBindingTrivia(source.slice(statementStartIndex), "csharp");
|
|
39
|
-
const semicolon = masked.indexOf(";");
|
|
40
|
-
const window = semicolon < 0 ? masked : masked.slice(0, semicolon + 1);
|
|
41
|
-
const escaped = alias.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
42
|
-
const match = window.match(new RegExp(`\\busing\\s+(${escaped})\\s*=`));
|
|
43
|
-
if (!match || match.index === undefined)
|
|
44
|
-
return undefined;
|
|
45
|
-
const aliasOffset = match[0].lastIndexOf(alias);
|
|
46
|
-
if (aliasOffset < 0)
|
|
47
|
-
return undefined;
|
|
48
|
-
const start = statementStartIndex + match.index + aliasOffset;
|
|
49
|
-
return sourceRangeFromOffsets(collectLineStartOffsets(source), start, start + alias.length);
|
|
50
|
-
}
|
|
51
|
-
async function applyCsharpStatementOverride(context, normalizedStmt, typeOnly, statementStartIndex) {
|
|
52
|
-
const externAlias = normalizedStmt.match(CSHARP_EXTERN_ALIAS_PATTERN)?.[1];
|
|
63
|
+
/**
|
|
64
|
+
* Binds one C# `using` or `extern alias` directive. The node comes from `collectCsharpImportDirectives`, so the
|
|
65
|
+
* directive is never found again by its text or offset. C# has no type-only imports.
|
|
66
|
+
*/
|
|
67
|
+
export async function applyCsharpImportDirective(context, directive) {
|
|
68
|
+
const typeOnly = false;
|
|
69
|
+
const externAlias = csharpExternAlias(directive);
|
|
53
70
|
if (externAlias) {
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
// dependency edge: the graph query does not treat it as an import specifier.
|
|
71
|
+
// An extern alias names a compiler-provided assembly alias, so it remains unresolved and
|
|
72
|
+
// does not produce a dependency edge: the graph query does not treat it as an import.
|
|
57
73
|
context.pushBinding({ kind: "namespace", localNS: externAlias, from: externAlias });
|
|
58
|
-
return
|
|
74
|
+
return;
|
|
59
75
|
}
|
|
60
|
-
const parsed =
|
|
61
|
-
if (!parsed)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
const parsed = csharpUsingDirective(directive);
|
|
77
|
+
if (!parsed) {
|
|
78
|
+
const alias = directive.childForFieldName("name");
|
|
79
|
+
if (alias?.type === "identifier") {
|
|
80
|
+
const target = directive.namedChildren.find((child) => child !== alias && child.type !== "comment");
|
|
81
|
+
if (target) {
|
|
82
|
+
const leaf = csharpAliasTargetLeaf(target) ?? target;
|
|
83
|
+
const unresolved = {
|
|
84
|
+
value: target.text,
|
|
85
|
+
leaf,
|
|
86
|
+
rawValue: target.text,
|
|
87
|
+
alias,
|
|
88
|
+
isStatic: false,
|
|
89
|
+
isGlobal: false,
|
|
90
|
+
};
|
|
91
|
+
const lineStarts = collectLineStartOffsets(context.source);
|
|
92
|
+
// The binding stays unresolved, so it cannot restore a target token it claims: only the alias
|
|
93
|
+
// name is a binding token, and every name in the target remains an ordinary reference.
|
|
94
|
+
pushCsharpOverride(context, unresolved, directive.startIndex, typeOnly, unresolved.value, { external: unresolved.value }, csharpNodeRange(alias, context.source, lineStarts));
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const lineStarts = parsed.alias ? collectLineStartOffsets(context.source) : undefined;
|
|
101
|
+
const localRange = parsed.alias && lineStarts ? csharpNodeRange(parsed.alias, context.source, lineStarts) : undefined;
|
|
102
|
+
const importedRange = parsed.alias && lineStarts ? csharpNodeRange(parsed.leaf, context.source, lineStarts) : undefined;
|
|
103
|
+
// Static imports bind to a declaring type only when exactly one file owns that type. A global
|
|
104
|
+
// static using applies to the whole project, which module-local bindings cannot express.
|
|
105
|
+
if (parsed.isStatic && !parsed.isGlobal) {
|
|
106
|
+
const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
|
|
107
|
+
// `partial`: a C# file of the project could not be read, so it may declare the type too and the binding stays
|
|
108
|
+
// external. The module records that, so a later build resolves it again once every file reads.
|
|
109
|
+
if (typeMatch.status === "partial")
|
|
110
|
+
context.onDegraded?.("lookup");
|
|
111
|
+
const qualifiedType = normalizeCsharpQualifiedName(parsed.value).replace(/^global::/u, "");
|
|
112
|
+
if (typeMatch.status === "found" && !typeMatch.parts && qualifiedType.includes(".")) {
|
|
71
113
|
context.pushBinding({
|
|
72
114
|
kind: "star",
|
|
73
|
-
from: parsed.
|
|
115
|
+
from: parsed.value,
|
|
74
116
|
resolved: typeMatch.file.replace(/\\/g, "/"),
|
|
75
117
|
typeOnly,
|
|
76
118
|
staticMembersOf: qualifiedType,
|
|
77
119
|
});
|
|
78
|
-
return
|
|
120
|
+
return;
|
|
79
121
|
}
|
|
122
|
+
context.pushBinding({
|
|
123
|
+
kind: "star",
|
|
124
|
+
from: parsed.rawValue,
|
|
125
|
+
resolved: { external: parsed.rawValue },
|
|
126
|
+
typeOnly,
|
|
127
|
+
});
|
|
128
|
+
return;
|
|
80
129
|
}
|
|
81
|
-
// A target
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
// A namespace split across several files has no single target, so it keeps the local alias
|
|
85
|
-
// as an unresolved namespace rather than claiming one of the declaring files.
|
|
86
|
-
const namespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, parsed.from, context.file, context.languageExtensions);
|
|
130
|
+
// A target declared as a namespace remains a namespace alias, even when written with alias
|
|
131
|
+
// syntax. Ambiguous namespaces stay unresolved rather than claiming one declaring file.
|
|
132
|
+
const namespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
|
|
87
133
|
if (parsed.alias && namespaceTargets.length) {
|
|
88
|
-
const localRange = csharpUsingAliasLocalRange(context.source, statementStartIndex, parsed.alias);
|
|
89
134
|
context.pushBinding({
|
|
90
135
|
kind: "namespace",
|
|
91
|
-
localNS: parsed.alias,
|
|
92
|
-
from: parsed.
|
|
136
|
+
localNS: normalizeCsharpIdentifier(parsed.alias.text),
|
|
137
|
+
from: parsed.value,
|
|
93
138
|
...(namespaceTargets.length === 1 ? { resolved: namespaceTargets[0].replace(/\\/g, "/") } : {}),
|
|
94
139
|
typeOnly,
|
|
95
140
|
...(localRange ? { localRange } : {}),
|
|
96
141
|
});
|
|
97
|
-
return
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
let fromValue = parsed.value;
|
|
145
|
+
// A plain using names a namespace, which ordinary C# declares across many files. Bind it to a
|
|
146
|
+
// representative declaring file; namespace-qualified export lookup reaches all files through
|
|
147
|
+
// the compilation-unit relation. Path-like resolution applies only when no file declares it.
|
|
148
|
+
let resolved;
|
|
149
|
+
if (parsed.alias) {
|
|
150
|
+
resolved = await context.resolveFrom(fromValue);
|
|
151
|
+
}
|
|
152
|
+
else if (namespaceTargets.length) {
|
|
153
|
+
resolved = namespaceTargets[0].replace(/\\/g, "/");
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
resolved = await context.resolveFrom(fromValue);
|
|
98
157
|
}
|
|
99
|
-
let fromValue = parsed.from;
|
|
100
|
-
// `using N;` names a namespace, which ordinary C# declares across many files. Bind it to the
|
|
101
|
-
// first declaring file: lookups through the binding qualify the name with `N`, and
|
|
102
|
-
// namespace-qualified export lookup reaches every file that declares `N` through the
|
|
103
|
-
// compilation-unit relation. Path-like resolution applies only when no file declares `N`, and
|
|
104
|
-
// only to a C# file.
|
|
105
|
-
let resolved = !parsed.alias && namespaceTargets.length
|
|
106
|
-
? namespaceTargets[0].replace(/\\/g, "/")
|
|
107
|
-
: await context.resolveFrom(fromValue);
|
|
108
158
|
if (parsed.alias) {
|
|
109
|
-
const fromParts = parsed.
|
|
159
|
+
const fromParts = parsed.value.split(".");
|
|
110
160
|
if (fromParts.length > 1) {
|
|
111
161
|
const fallbackFrom = fromParts.slice(0, -1).join(".");
|
|
112
162
|
if (fallbackFrom) {
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (
|
|
120
|
-
const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.
|
|
163
|
+
// A type alias names a type in a namespace. Resolve the type across every namespace file; any
|
|
164
|
+
// result but one proven declaration stays external instead of selecting a path-like first match
|
|
165
|
+
// or the namespace's file.
|
|
166
|
+
const fallbackNamespaceTargets = await resolveCsharpNamespaceImportPaths(context.projectRoot, fallbackFrom, context.file, context.languageExtensions, context.report, context.parsedFiles);
|
|
167
|
+
const namespaceDeclared = fallbackNamespaceTargets.length > 1 ||
|
|
168
|
+
(fallbackNamespaceTargets.length === 1 && typeof resolved !== "string");
|
|
169
|
+
if (namespaceDeclared) {
|
|
170
|
+
const typeMatch = await resolveCsharpDottedTypeImportPath(context.projectRoot, parsed.value, context.file, context.languageExtensions, context.report, context.parsedFiles);
|
|
171
|
+
// `partial` leaves the alias external and marks the module, as for a static using.
|
|
172
|
+
if (typeMatch.status === "partial")
|
|
173
|
+
context.onDegraded?.("lookup");
|
|
121
174
|
if (typeMatch.status === "found") {
|
|
122
175
|
fromValue = fallbackFrom;
|
|
123
176
|
resolved = typeMatch.file;
|
|
124
177
|
}
|
|
125
178
|
else {
|
|
126
|
-
fromValue = parsed.
|
|
127
|
-
resolved = { external: parsed.
|
|
179
|
+
fromValue = parsed.value;
|
|
180
|
+
resolved = { external: parsed.value };
|
|
128
181
|
}
|
|
129
182
|
}
|
|
130
|
-
else if (typeof resolved !== "string" && fallbackNamespaceTargets.length === 1) {
|
|
131
|
-
fromValue = fallbackFrom;
|
|
132
|
-
resolved = fallbackNamespaceTargets[0].replace(/\\/g, "/");
|
|
133
|
-
}
|
|
134
183
|
else if (typeof resolved !== "string") {
|
|
135
184
|
const fallbackResolved = await context.resolveFrom(fallbackFrom);
|
|
136
185
|
if (typeof fallbackResolved === "string") {
|
|
@@ -141,56 +190,57 @@ async function applyCsharpStatementOverride(context, normalizedStmt, typeOnly, s
|
|
|
141
190
|
}
|
|
142
191
|
}
|
|
143
192
|
}
|
|
144
|
-
pushCsharpOverride(context, parsed, typeOnly, fromValue, resolved);
|
|
145
|
-
return true;
|
|
193
|
+
pushCsharpOverride(context, parsed, directive.startIndex, typeOnly, fromValue, resolved, localRange, importedRange);
|
|
146
194
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Binds one Java or Kotlin `import`. The directive comes from `collectJvmImportDirectives`, so its ranges are its
|
|
197
|
+
* nodes' own and it is never found again by its text or offset. Neither language has type-only imports. Every form
|
|
198
|
+
* resolves `directive.from`, the name its dependency edge resolves too: the type, the owner of a static member, or the
|
|
199
|
+
* package or type of a wildcard.
|
|
200
|
+
*/
|
|
201
|
+
export async function applyJvmImportDirective(context, { from, leaf, isStatic, wildcard, alias }) {
|
|
202
|
+
const packageWildcard = wildcard && !isStatic;
|
|
203
|
+
const resolved = await context.resolveFrom(from, undefined, packageWildcard ? { jvmPackageWildcard: true } : undefined);
|
|
204
|
+
// A file that was not read in full may declare what an import names, and a file whose package could not be read may
|
|
205
|
+
// be one of a package's files. The module records that, so a later build resolves the import again once every file
|
|
206
|
+
// reads. A resolved import names a file that proves it, except a package wildcard, which names every file of its
|
|
207
|
+
// package.
|
|
208
|
+
if (isJvmLanguage(context.languageId)) {
|
|
209
|
+
const lookupOptions = { languageId: context.languageId, fromFile: context.file };
|
|
210
|
+
let incomplete = false;
|
|
211
|
+
if (packageWildcard) {
|
|
212
|
+
incomplete = (await lookupJvmImport(context.projectRoot, `${from}.*`, lookupOptions)).incomplete;
|
|
213
|
+
}
|
|
214
|
+
if (!incomplete && typeof resolved !== "string") {
|
|
215
|
+
incomplete = (await lookupJvmImport(context.projectRoot, from, lookupOptions)).incomplete;
|
|
216
|
+
}
|
|
217
|
+
if (incomplete)
|
|
218
|
+
context.onDegraded?.("lookup");
|
|
219
|
+
}
|
|
220
|
+
const owner = from.slice(from.lastIndexOf(".") + 1);
|
|
221
|
+
if (wildcard) {
|
|
170
222
|
context.pushBinding({
|
|
171
223
|
kind: "star",
|
|
172
|
-
from
|
|
224
|
+
from,
|
|
173
225
|
resolved,
|
|
174
|
-
...(
|
|
175
|
-
|
|
176
|
-
: { jvmTypeWildcardName: parsed.from.slice(parsed.from.lastIndexOf(".") + 1) }),
|
|
177
|
-
typeOnly,
|
|
226
|
+
...(isStatic ? { jvmStaticWildcardName: owner } : { jvmTypeWildcardName: owner }),
|
|
227
|
+
typeOnly: false,
|
|
178
228
|
});
|
|
179
|
-
return
|
|
229
|
+
return;
|
|
180
230
|
}
|
|
231
|
+
const importedRange = toRange(leaf);
|
|
181
232
|
context.pushBinding({
|
|
182
233
|
kind: "named",
|
|
183
|
-
local:
|
|
184
|
-
imported:
|
|
185
|
-
from
|
|
186
|
-
...(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
234
|
+
local: alias?.text ?? leaf.text,
|
|
235
|
+
imported: leaf.text,
|
|
236
|
+
from,
|
|
237
|
+
...(isStatic ? { jvmStaticWildcardName: owner } : {}),
|
|
238
|
+
...(alias ? { explicitAlias: true } : {}),
|
|
239
|
+
importedRange,
|
|
240
|
+
localRange: alias ? toRange(alias) : importedRange,
|
|
190
241
|
resolved,
|
|
191
|
-
typeOnly,
|
|
242
|
+
typeOnly: false,
|
|
192
243
|
});
|
|
193
|
-
return true;
|
|
194
244
|
}
|
|
195
245
|
async function applyRustStatementOverride(context, normalizedStmt, typeOnly, statementStartIndex) {
|
|
196
246
|
if (isRustTestOnlyStatement(context, normalizedStmt, statementStartIndex))
|
|
@@ -290,7 +340,7 @@ async function applyPhpStatementOverride(context, normalizedStmt, typeOnly) {
|
|
|
290
340
|
}
|
|
291
341
|
return true;
|
|
292
342
|
}
|
|
293
|
-
function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, source
|
|
343
|
+
function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, source) {
|
|
294
344
|
if (stmtStartIndex !== undefined && source !== undefined) {
|
|
295
345
|
attributeNamedBindingRanges({
|
|
296
346
|
bindings: [binding],
|
|
@@ -298,31 +348,10 @@ function pushNamedImplicitBinding(context, binding, stmtText, stmtStartIndex, so
|
|
|
298
348
|
text: maskImportBindingTrivia(stmtText, context.languageId),
|
|
299
349
|
textStartIndex: stmtStartIndex,
|
|
300
350
|
source,
|
|
301
|
-
...(alwaysAliased !== undefined ? { alwaysAliased } : {}),
|
|
302
351
|
});
|
|
303
352
|
}
|
|
304
353
|
context.pushBinding(binding);
|
|
305
354
|
}
|
|
306
|
-
function appendJavaImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source }) {
|
|
307
|
-
const parts = from.split(".");
|
|
308
|
-
const last = parts[parts.length - 1];
|
|
309
|
-
if (last === "*") {
|
|
310
|
-
context.pushBinding({ kind: "star", from, resolved, typeOnly });
|
|
311
|
-
}
|
|
312
|
-
else if (last) {
|
|
313
|
-
pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source, undefined);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
function appendCsharpImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source, alias }) {
|
|
317
|
-
if (alias) {
|
|
318
|
-
const fromParts = from.split(".");
|
|
319
|
-
const imported = fromParts[fromParts.length - 1] ?? alias;
|
|
320
|
-
pushNamedImplicitBinding(context, { kind: "named", local: alias, imported, from, explicitAlias: true, resolved, typeOnly }, stmtText, stmtStartIndex, source, IMPORT_BINDING_ROWS.csharp.alwaysAliased);
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
context.pushBinding({ kind: "star", from, resolved, typeOnly });
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
355
|
function appendRubyImplicitBinding(context, { from, resolved, rubyLoadForm }) {
|
|
327
356
|
context.pushBinding({ kind: "star", from, resolved, ...(rubyLoadForm ? { rubyLoadForm } : {}) });
|
|
328
357
|
}
|
|
@@ -355,29 +384,10 @@ function appendRustImplicitBinding(context, { from, resolved, stmtText, stmtStar
|
|
|
355
384
|
context.pushBinding({ kind: "star", from, resolved });
|
|
356
385
|
}
|
|
357
386
|
else {
|
|
358
|
-
pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved }, stmtText, stmtStartIndex, source
|
|
387
|
+
pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved }, stmtText, stmtStartIndex, source);
|
|
359
388
|
}
|
|
360
389
|
}
|
|
361
390
|
}
|
|
362
|
-
function appendKotlinImplicitBinding(context, { from, resolved, typeOnly, stmtText, stmtStartIndex, source, alias, wildcard }) {
|
|
363
|
-
if (wildcard || from.endsWith(".*")) {
|
|
364
|
-
context.pushBinding({ kind: "star", from, resolved, typeOnly });
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
const parts = from.split(".");
|
|
368
|
-
const imported = parts[parts.length - 1];
|
|
369
|
-
if (imported)
|
|
370
|
-
pushNamedImplicitBinding(context, {
|
|
371
|
-
kind: "named",
|
|
372
|
-
local: alias ?? imported,
|
|
373
|
-
imported,
|
|
374
|
-
from,
|
|
375
|
-
...(alias !== undefined ? { explicitAlias: true } : {}),
|
|
376
|
-
resolved,
|
|
377
|
-
typeOnly,
|
|
378
|
-
}, stmtText, stmtStartIndex, source, undefined);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
391
|
function swiftModuleLocalRange(source, statementStartIndex, statementText, name) {
|
|
382
392
|
if (!source || statementStartIndex === undefined || !name)
|
|
383
393
|
return undefined;
|
|
@@ -420,7 +430,7 @@ function appendSwiftImplicitBinding(context, { from, resolved, typeOnly, stmtTex
|
|
|
420
430
|
context.pushBinding({ kind: "star", from, resolved, typeOnly });
|
|
421
431
|
}
|
|
422
432
|
else {
|
|
423
|
-
pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source
|
|
433
|
+
pushNamedImplicitBinding(context, { kind: "named", local: last, imported: last, from, resolved, typeOnly }, stmtText, stmtStartIndex, source);
|
|
424
434
|
}
|
|
425
435
|
}
|
|
426
436
|
function appendZigImplicitBinding(context, { from, resolved, typeOnly, alias, localRange }) {
|
|
@@ -461,13 +471,8 @@ export const IMPORT_BINDING_ROWS = {
|
|
|
461
471
|
},
|
|
462
472
|
css: { omittedReason: STYLESHEET_OMITTED },
|
|
463
473
|
csharp: {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
maskTrivia: true,
|
|
467
|
-
normalizeDots: true,
|
|
468
|
-
alwaysAliased: true,
|
|
469
|
-
// `using X = P;` in two namespace blocks is two scoped aliases, each with its own range.
|
|
470
|
-
statementKeyUsesOffset: true,
|
|
474
|
+
statementOmittedReason: "C# using directives are bound from syntax-tree nodes by applyCsharpImportDirective, not from statement text.",
|
|
475
|
+
implicitOmittedReason: "C# using directives are bound from syntax-tree nodes; no native capture is mapped.",
|
|
471
476
|
},
|
|
472
477
|
go: {
|
|
473
478
|
appendImplicit: appendGoImplicitBinding,
|
|
@@ -476,20 +481,16 @@ export const IMPORT_BINDING_ROWS = {
|
|
|
476
481
|
hbs: { omittedReason: "Handlebars document format; embedded scripts parse as their own language." },
|
|
477
482
|
html: { omittedReason: "Document format; embedded scripts parse as their own language." },
|
|
478
483
|
java: {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
maskTrivia: true,
|
|
482
|
-
normalizeDots: true,
|
|
484
|
+
statementOmittedReason: "Java imports are bound from syntax-tree nodes by applyJvmImportDirective, not from statement text.",
|
|
485
|
+
implicitOmittedReason: "Java imports are bound from syntax-tree nodes; no native capture is mapped.",
|
|
483
486
|
},
|
|
484
487
|
js: {
|
|
485
488
|
statementOmittedReason: ECMASCRIPT_STATEMENT_OMITTED,
|
|
486
489
|
implicitOmittedReason: ECMASCRIPT_IMPLICIT_OMITTED,
|
|
487
490
|
},
|
|
488
491
|
kotlin: {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
maskTrivia: true,
|
|
492
|
-
normalizeDots: true,
|
|
492
|
+
statementOmittedReason: "Kotlin imports are bound from syntax-tree nodes by applyJvmImportDirective, not from statement text.",
|
|
493
|
+
implicitOmittedReason: "Kotlin imports are bound from syntax-tree nodes; no native capture is mapped.",
|
|
493
494
|
},
|
|
494
495
|
less: { omittedReason: STYLESHEET_OMITTED },
|
|
495
496
|
markdown: { omittedReason: "Document format; fenced code blocks parse as their own language." },
|
|
@@ -516,6 +517,9 @@ export const IMPORT_BINDING_ROWS = {
|
|
|
516
517
|
},
|
|
517
518
|
scss: { omittedReason: STYLESHEET_OMITTED },
|
|
518
519
|
sql: { omittedReason: "Data language; no import-statement or implicit-binding dispatch." },
|
|
520
|
+
terraform: {
|
|
521
|
+
omittedReason: "A module call binds no local names; `module.<name>` resolves in src/terraform/.",
|
|
522
|
+
},
|
|
519
523
|
svelte: { omittedReason: "Svelte component format; script blocks parse as js/ts and templates as html." },
|
|
520
524
|
swift: {
|
|
521
525
|
appendImplicit: appendSwiftImplicitBinding,
|