@lzehrung/codegraph 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -29
- package/codegraph-skill/codegraph/SKILL.md +27 -26
- package/dist/agent/artifact.d.ts.map +1 -1
- package/dist/agent/artifact.js +105 -14
- package/dist/agent/artifact.js.map +1 -1
- package/dist/agent/candidateTests.d.ts +12 -0
- package/dist/agent/candidateTests.d.ts.map +1 -0
- package/dist/agent/candidateTests.js +17 -0
- package/dist/agent/candidateTests.js.map +1 -0
- package/dist/agent/explain.d.ts +3 -0
- package/dist/agent/explain.d.ts.map +1 -1
- package/dist/agent/explain.js +8 -0
- package/dist/agent/explain.js.map +1 -1
- package/dist/agent/explore.d.ts.map +1 -1
- package/dist/agent/explore.js +11 -6
- package/dist/agent/explore.js.map +1 -1
- package/dist/agent/fileView.d.ts.map +1 -1
- package/dist/agent/fileView.js +113 -120
- package/dist/agent/fileView.js.map +1 -1
- package/dist/agent/orient.d.ts.map +1 -1
- package/dist/agent/orient.js +7 -4
- package/dist/agent/orient.js.map +1 -1
- package/dist/agent/packet.d.ts.map +1 -1
- package/dist/agent/packet.js +5 -12
- package/dist/agent/packet.js.map +1 -1
- package/dist/agent/query-index/candidates.d.ts +13 -2
- package/dist/agent/query-index/candidates.d.ts.map +1 -1
- package/dist/agent/query-index/candidates.js +28 -39
- package/dist/agent/query-index/candidates.js.map +1 -1
- package/dist/agent/query-index/content.d.ts +1 -1
- package/dist/agent/query-index/content.js +4 -4
- package/dist/agent/query-index/content.js.map +1 -1
- package/dist/agent/query-index/schema.d.ts.map +1 -1
- package/dist/agent/query-index/schema.js.map +1 -1
- package/dist/agent/query-index/sessionStore.d.ts.map +1 -1
- package/dist/agent/query-index/sessionStore.js +42 -26
- package/dist/agent/query-index/sessionStore.js.map +1 -1
- package/dist/agent/query-index/store.d.ts +10 -4
- package/dist/agent/query-index/store.d.ts.map +1 -1
- package/dist/agent/query-index/store.js +115 -10
- package/dist/agent/query-index/store.js.map +1 -1
- package/dist/agent/query-index/update.d.ts.map +1 -1
- package/dist/agent/query-index/update.js +24 -9
- package/dist/agent/query-index/update.js.map +1 -1
- package/dist/agent/refactorPlan.d.ts.map +1 -1
- package/dist/agent/refactorPlan.js +6 -14
- package/dist/agent/refactorPlan.js.map +1 -1
- package/dist/agent/renamePreview.d.ts +2 -5
- package/dist/agent/renamePreview.d.ts.map +1 -1
- package/dist/agent/renamePreview.js +133 -80
- package/dist/agent/renamePreview.js.map +1 -1
- package/dist/agent/search.d.ts +3 -1
- package/dist/agent/search.d.ts.map +1 -1
- package/dist/agent/search.js +103 -35
- package/dist/agent/search.js.map +1 -1
- package/dist/agent/semanticSymbols.d.ts.map +1 -1
- package/dist/agent/semanticSymbols.js +2 -1
- package/dist/agent/semanticSymbols.js.map +1 -1
- package/dist/agent/session.d.ts +4 -0
- package/dist/agent/session.d.ts.map +1 -1
- package/dist/agent/session.js +20 -7
- package/dist/agent/session.js.map +1 -1
- package/dist/agent-tools.d.ts +1 -1
- package/dist/agent-tools.d.ts.map +1 -1
- package/dist/agent-tools.js +12 -21
- package/dist/agent-tools.js.map +1 -1
- package/dist/bin/cli.js +29242 -25373
- package/dist/bin/queryIndexWorker.js +131 -42
- package/dist/bin/rawQueryWorker.js +270 -0
- package/dist/chunking/chunkFile.d.ts +5 -0
- package/dist/chunking/chunkFile.d.ts.map +1 -1
- package/dist/chunking/chunkFile.js +14 -15
- package/dist/chunking/chunkFile.js.map +1 -1
- package/dist/cli/affected.d.ts.map +1 -1
- package/dist/cli/affected.js +17 -10
- package/dist/cli/affected.js.map +1 -1
- package/dist/cli/callHierarchy.d.ts.map +1 -1
- package/dist/cli/callHierarchy.js +9 -2
- package/dist/cli/callHierarchy.js.map +1 -1
- package/dist/cli/commandTable.d.ts.map +1 -1
- package/dist/cli/commandTable.js +16 -4
- package/dist/cli/commandTable.js.map +1 -1
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +166 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/graph.d.ts +2 -1
- package/dist/cli/graph.d.ts.map +1 -1
- package/dist/cli/graph.js +60 -16
- package/dist/cli/graph.js.map +1 -1
- package/dist/cli/graphDelta.d.ts +2 -1
- package/dist/cli/graphDelta.d.ts.map +1 -1
- package/dist/cli/graphDelta.js +5 -0
- package/dist/cli/graphDelta.js.map +1 -1
- package/dist/cli/grep.d.ts +1 -1
- package/dist/cli/grep.d.ts.map +1 -1
- package/dist/cli/grep.js +14 -4
- package/dist/cli/grep.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 +17 -8
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/impact.d.ts +2 -1
- package/dist/cli/impact.d.ts.map +1 -1
- package/dist/cli/impact.js +5 -0
- package/dist/cli/impact.js.map +1 -1
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/indexPolicy.d.ts.map +1 -1
- package/dist/cli/indexPolicy.js.map +1 -1
- package/dist/cli/inspect.d.ts +2 -1
- package/dist/cli/inspect.d.ts.map +1 -1
- package/dist/cli/inspect.js +25 -13
- package/dist/cli/inspect.js.map +1 -1
- package/dist/cli/install.js +1 -1
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/invocationContext.d.ts.map +1 -1
- package/dist/cli/invocationContext.js +3 -0
- package/dist/cli/invocationContext.js.map +1 -1
- package/dist/cli/links.d.ts +2 -0
- package/dist/cli/links.d.ts.map +1 -1
- package/dist/cli/links.js +1 -1
- package/dist/cli/links.js.map +1 -1
- package/dist/cli/navigation.d.ts +41 -1
- package/dist/cli/navigation.d.ts.map +1 -1
- package/dist/cli/navigation.js +4 -1
- package/dist/cli/navigation.js.map +1 -1
- package/dist/cli/options.d.ts.map +1 -1
- package/dist/cli/options.js +32 -11
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/renamePreview.d.ts.map +1 -1
- package/dist/cli/renamePreview.js +7 -1
- package/dist/cli/renamePreview.js.map +1 -1
- package/dist/cli/review.d.ts +2 -1
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +5 -0
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/rootPolicy.d.ts.map +1 -1
- package/dist/cli/rootPolicy.js +36 -3
- package/dist/cli/rootPolicy.js.map +1 -1
- package/dist/cli/skill.js +2 -2
- package/dist/cli/skill.js.map +1 -1
- package/dist/cli/sql.js +1 -1
- package/dist/cli/symbols.d.ts.map +1 -1
- package/dist/cli/symbols.js +4 -2
- package/dist/cli/symbols.js.map +1 -1
- package/dist/cli/viewer.d.ts.map +1 -1
- package/dist/cli/viewer.js +46 -34
- package/dist/cli/viewer.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +36 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +35 -3
- package/dist/config.js.map +1 -1
- package/dist/documentLinks/check.d.ts +2 -1
- package/dist/documentLinks/check.d.ts.map +1 -1
- package/dist/documentLinks/check.js +22 -11
- package/dist/documentLinks/check.js.map +1 -1
- package/dist/duplicate-token-normalization.d.ts.map +1 -1
- package/dist/duplicate-token-normalization.js +10 -2
- package/dist/duplicate-token-normalization.js.map +1 -1
- package/dist/duplicates/scoring.d.ts +0 -10
- package/dist/duplicates/scoring.d.ts.map +1 -1
- package/dist/duplicates/scoring.js +9 -9
- package/dist/duplicates/scoring.js.map +1 -1
- package/dist/duplicates/types.d.ts +2 -0
- package/dist/duplicates/types.d.ts.map +1 -1
- package/dist/duplicates/unitCache.d.ts +15 -9
- package/dist/duplicates/unitCache.d.ts.map +1 -1
- package/dist/duplicates/unitCache.js +184 -33
- package/dist/duplicates/unitCache.js.map +1 -1
- package/dist/duplicates/units.d.ts +6 -15
- package/dist/duplicates/units.d.ts.map +1 -1
- package/dist/duplicates/units.js +42 -20
- package/dist/duplicates/units.js.map +1 -1
- package/dist/duplicates.d.ts.map +1 -1
- package/dist/duplicates.js +59 -0
- package/dist/duplicates.js.map +1 -1
- package/dist/frameworks/angularjs.d.ts.map +1 -1
- package/dist/frameworks/angularjs.js +18 -12
- package/dist/frameworks/angularjs.js.map +1 -1
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +12 -9
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-edge-collector.d.ts +1 -0
- package/dist/graph-edge-collector.d.ts.map +1 -1
- package/dist/graph-edge-collector.js +1 -1
- package/dist/graph-edge-collector.js.map +1 -1
- package/dist/graphs/grep.d.ts.map +1 -1
- package/dist/graphs/grep.js +7 -2
- package/dist/graphs/grep.js.map +1 -1
- package/dist/graphs/specifiers.d.ts.map +1 -1
- package/dist/graphs/specifiers.js +8 -2
- package/dist/graphs/specifiers.js.map +1 -1
- package/dist/graphs/symbol-graph-detailed.d.ts +10 -1
- package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -1
- package/dist/graphs/symbol-graph-detailed.js +21 -5
- package/dist/graphs/symbol-graph-detailed.js.map +1 -1
- package/dist/impact/analyzer.d.ts.map +1 -1
- package/dist/impact/analyzer.js +19 -2
- package/dist/impact/analyzer.js.map +1 -1
- package/dist/impact/budgets.d.ts.map +1 -1
- package/dist/impact/budgets.js +5 -3
- package/dist/impact/budgets.js.map +1 -1
- package/dist/impact/call-compatibility/textScanner.d.ts +23 -0
- package/dist/impact/call-compatibility/textScanner.d.ts.map +1 -0
- package/dist/impact/call-compatibility/textScanner.js +615 -0
- package/dist/impact/call-compatibility/textScanner.js.map +1 -0
- package/dist/impact/callCompatibility.d.ts +8 -1
- package/dist/impact/callCompatibility.d.ts.map +1 -1
- package/dist/impact/callCompatibility.js +64 -587
- package/dist/impact/callCompatibility.js.map +1 -1
- package/dist/impact/context.d.ts.map +1 -1
- package/dist/impact/context.js +4 -1
- package/dist/impact/context.js.map +1 -1
- package/dist/impact/direct.d.ts +1 -1
- package/dist/impact/direct.d.ts.map +1 -1
- package/dist/impact/direct.js +7 -6
- package/dist/impact/direct.js.map +1 -1
- package/dist/impact/index.d.ts +6 -0
- package/dist/impact/index.d.ts.map +1 -1
- package/dist/impact/index.js +0 -8
- package/dist/impact/index.js.map +1 -1
- package/dist/impact/map.js +2 -2
- package/dist/impact/map.js.map +1 -1
- package/dist/impact/memberResolutionCoverage.d.ts.map +1 -1
- package/dist/impact/memberResolutionCoverage.js +5 -1
- package/dist/impact/memberResolutionCoverage.js.map +1 -1
- package/dist/impact/parse.d.ts.map +1 -1
- package/dist/impact/parse.js +108 -37
- package/dist/impact/parse.js.map +1 -1
- package/dist/impact/referenceCache.js +1 -1
- package/dist/impact/referenceCache.js.map +1 -1
- package/dist/impact/report-suggestions.d.ts.map +1 -1
- package/dist/impact/report-suggestions.js +347 -72
- package/dist/impact/report-suggestions.js.map +1 -1
- package/dist/impact/report.d.ts.map +1 -1
- package/dist/impact/report.js +13 -2
- package/dist/impact/report.js.map +1 -1
- package/dist/impact/reportCompact.d.ts.map +1 -1
- package/dist/impact/reportCompact.js +8 -0
- package/dist/impact/reportCompact.js.map +1 -1
- package/dist/impact/reportFull.d.ts.map +1 -1
- package/dist/impact/reportFull.js +1 -0
- package/dist/impact/reportFull.js.map +1 -1
- package/dist/impact/reportParts.d.ts +9 -0
- package/dist/impact/reportParts.d.ts.map +1 -1
- package/dist/impact/severity.d.ts +3 -2
- package/dist/impact/severity.d.ts.map +1 -1
- package/dist/impact/severity.js +16 -5
- package/dist/impact/severity.js.map +1 -1
- package/dist/impact/streaming.d.ts +32 -2
- package/dist/impact/streaming.d.ts.map +1 -1
- package/dist/impact/streaming.js +62 -3
- package/dist/impact/streaming.js.map +1 -1
- package/dist/impact/suggestions.d.ts.map +1 -1
- package/dist/impact/suggestions.js +1 -1
- package/dist/impact/suggestions.js.map +1 -1
- package/dist/impact/transitive.d.ts.map +1 -1
- package/dist/impact/transitive.js +13 -5
- package/dist/impact/transitive.js.map +1 -1
- package/dist/impact/types.d.ts +21 -20
- package/dist/impact/types.d.ts.map +1 -1
- package/dist/impact/types.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/build-cache/location.d.ts +19 -0
- package/dist/indexer/build-cache/location.d.ts.map +1 -0
- package/dist/indexer/build-cache/location.js +132 -0
- package/dist/indexer/build-cache/location.js.map +1 -0
- package/dist/indexer/build-cache/manifest.d.ts +14 -6
- package/dist/indexer/build-cache/manifest.d.ts.map +1 -1
- package/dist/indexer/build-cache/manifest.js +194 -30
- package/dist/indexer/build-cache/manifest.js.map +1 -1
- package/dist/indexer/build-cache/module-cache.d.ts +24 -2
- package/dist/indexer/build-cache/module-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache/module-cache.js +98 -32
- package/dist/indexer/build-cache/module-cache.js.map +1 -1
- package/dist/indexer/build-cache/options.d.ts +3 -1
- package/dist/indexer/build-cache/options.d.ts.map +1 -1
- package/dist/indexer/build-cache/options.js +10 -2
- package/dist/indexer/build-cache/options.js.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.d.ts +33 -13
- package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -1
- package/dist/indexer/build-cache/project-snapshot.js +472 -91
- package/dist/indexer/build-cache/project-snapshot.js.map +1 -1
- package/dist/indexer/build-cache/reports.d.ts.map +1 -1
- package/dist/indexer/build-cache/reports.js +10 -1
- package/dist/indexer/build-cache/reports.js.map +1 -1
- package/dist/indexer/build-cache/resolver-environment.d.ts +9 -0
- package/dist/indexer/build-cache/resolver-environment.d.ts.map +1 -0
- package/dist/indexer/build-cache/resolver-environment.js +160 -0
- package/dist/indexer/build-cache/resolver-environment.js.map +1 -0
- package/dist/indexer/build-cache.d.ts +4 -3
- package/dist/indexer/build-cache.d.ts.map +1 -1
- package/dist/indexer/build-cache.js +4 -3
- 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 +268 -96
- package/dist/indexer/build-index.js.map +1 -1
- package/dist/indexer/build-manifest.d.ts +1 -0
- package/dist/indexer/build-manifest.d.ts.map +1 -1
- package/dist/indexer/build-manifest.js +15 -5
- package/dist/indexer/build-manifest.js.map +1 -1
- package/dist/indexer/build-workers.d.ts +1 -1
- package/dist/indexer/build-workers.d.ts.map +1 -1
- package/dist/indexer/build-workers.js +57 -42
- 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.map +1 -1
- package/dist/indexer/finalize.d.ts.map +1 -1
- package/dist/indexer/finalize.js +7 -4
- package/dist/indexer/finalize.js.map +1 -1
- package/dist/indexer/import-types.d.ts +8 -0
- package/dist/indexer/import-types.d.ts.map +1 -1
- package/dist/indexer/imports/jsTextImports.d.ts.map +1 -1
- package/dist/indexer/imports/jsTextImports.js +14 -6
- package/dist/indexer/imports/jsTextImports.js.map +1 -1
- package/dist/indexer/imports/languageSpecific.d.ts.map +1 -1
- package/dist/indexer/imports/languageSpecific.js +10 -5
- package/dist/indexer/imports/languageSpecific.js.map +1 -1
- package/dist/indexer/imports/nativeCaptures.d.ts.map +1 -1
- package/dist/indexer/imports/nativeCaptures.js +4 -1
- package/dist/indexer/imports/nativeCaptures.js.map +1 -1
- package/dist/indexer/imports/python.d.ts.map +1 -1
- package/dist/indexer/imports/python.js +19 -9
- package/dist/indexer/imports/python.js.map +1 -1
- package/dist/indexer/incremental-plan.d.ts +2 -1
- package/dist/indexer/incremental-plan.d.ts.map +1 -1
- package/dist/indexer/incremental-plan.js +7 -4
- package/dist/indexer/incremental-plan.js.map +1 -1
- package/dist/indexer/load-current-index.d.ts.map +1 -1
- package/dist/indexer/load-current-index.js.map +1 -1
- package/dist/indexer/locals-and-exports.d.ts.map +1 -1
- package/dist/indexer/locals-and-exports.js +77 -22
- package/dist/indexer/locals-and-exports.js.map +1 -1
- package/dist/indexer/navigation-goto.d.ts.map +1 -1
- package/dist/indexer/navigation-goto.js +26 -16
- package/dist/indexer/navigation-goto.js.map +1 -1
- package/dist/indexer/navigation-local.d.ts.map +1 -1
- package/dist/indexer/navigation-local.js +7 -4
- package/dist/indexer/navigation-local.js.map +1 -1
- package/dist/indexer/navigation-references.d.ts +1 -1
- package/dist/indexer/navigation-references.d.ts.map +1 -1
- package/dist/indexer/navigation-references.js +34 -17
- package/dist/indexer/navigation-references.js.map +1 -1
- package/dist/indexer/navigation-resolve.d.ts.map +1 -1
- package/dist/indexer/navigation-resolve.js +116 -53
- package/dist/indexer/navigation-resolve.js.map +1 -1
- package/dist/indexer/navigation.d.ts +2 -1
- package/dist/indexer/navigation.d.ts.map +1 -1
- package/dist/indexer/navigation.js +34 -20
- package/dist/indexer/navigation.js.map +1 -1
- package/dist/indexer/parse-context.d.ts +2 -2
- package/dist/indexer/parse-context.d.ts.map +1 -1
- package/dist/indexer/parse-context.js +25 -4
- package/dist/indexer/parse-context.js.map +1 -1
- package/dist/indexer/reference-context.d.ts +2 -2
- package/dist/indexer/reference-context.d.ts.map +1 -1
- package/dist/indexer/reference-context.js +4 -2
- package/dist/indexer/reference-context.js.map +1 -1
- package/dist/indexer/scope-types.d.ts +3 -0
- package/dist/indexer/scope-types.d.ts.map +1 -1
- package/dist/indexer/scope.js +37 -38
- package/dist/indexer/scope.js.map +1 -1
- package/dist/indexer/shared.d.ts.map +1 -1
- package/dist/indexer/shared.js +3 -1
- package/dist/indexer/shared.js.map +1 -1
- package/dist/indexer/type-hierarchy.d.ts.map +1 -1
- package/dist/indexer/type-hierarchy.js +12 -8
- package/dist/indexer/type-hierarchy.js.map +1 -1
- package/dist/indexer/types.d.ts +27 -1
- package/dist/indexer/types.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.d.ts.map +1 -1
- package/dist/indexer/workspace-symbols.js +5 -3
- package/dist/indexer/workspace-symbols.js.map +1 -1
- package/dist/installer/locks.d.ts +10 -0
- package/dist/installer/locks.d.ts.map +1 -0
- package/dist/installer/locks.js +232 -0
- package/dist/installer/locks.js.map +1 -0
- package/dist/installer/registry.d.ts.map +1 -1
- package/dist/installer/registry.js +75 -235
- package/dist/installer/registry.js.map +1 -1
- package/dist/languages/definitions/csharp.d.ts.map +1 -1
- package/dist/languages/definitions/csharp.js +8 -0
- 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 +3 -0
- package/dist/languages/definitions/java.js.map +1 -1
- package/dist/languages/definitions/python.d.ts.map +1 -1
- package/dist/languages/definitions/python.js +2 -0
- package/dist/languages/definitions/python.js.map +1 -1
- package/dist/languages/definitions/rust.d.ts.map +1 -1
- package/dist/languages/definitions/rust.js +2 -0
- package/dist/languages/definitions/rust.js.map +1 -1
- package/dist/languages/importStatementParsers.d.ts +2 -0
- package/dist/languages/importStatementParsers.d.ts.map +1 -1
- package/dist/languages/importStatementParsers.js +24 -10
- package/dist/languages/importStatementParsers.js.map +1 -1
- package/dist/mcp/http.d.ts +3 -1
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/mcp/http.js +69 -20
- package/dist/mcp/http.js.map +1 -1
- package/dist/mcp/server.d.ts +58 -16
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +447 -140
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +51 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +129 -3
- package/dist/mcp/tools.js.map +1 -1
- package/dist/native/byteIndex.d.ts +26 -0
- package/dist/native/byteIndex.d.ts.map +1 -0
- package/dist/native/byteIndex.js +70 -0
- package/dist/native/byteIndex.js.map +1 -0
- package/dist/native/projectedTree.d.ts +3 -2
- package/dist/native/projectedTree.d.ts.map +1 -1
- package/dist/native/projectedTree.js +6 -50
- package/dist/native/projectedTree.js.map +1 -1
- package/dist/native/queryResults.d.ts +7 -1
- package/dist/native/queryResults.d.ts.map +1 -1
- package/dist/native/queryResults.js +13 -5
- package/dist/native/queryResults.js.map +1 -1
- package/dist/review/candidates.d.ts.map +1 -1
- package/dist/review/candidates.js +4 -1
- package/dist/review/candidates.js.map +1 -1
- package/dist/review/changes.d.ts +2 -0
- package/dist/review/changes.d.ts.map +1 -1
- package/dist/review/changes.js +10 -0
- package/dist/review/changes.js.map +1 -1
- package/dist/review/deleted.d.ts.map +1 -1
- package/dist/review/deleted.js +20 -2
- package/dist/review/deleted.js.map +1 -1
- package/dist/review/summaries.d.ts +5 -0
- package/dist/review/summaries.d.ts.map +1 -1
- package/dist/review/summaries.js +32 -21
- package/dist/review/summaries.js.map +1 -1
- package/dist/review/types.d.ts +3 -1
- package/dist/review/types.d.ts.map +1 -1
- package/dist/review/types.js +8 -1
- package/dist/review/types.js.map +1 -1
- package/dist/review.d.ts.map +1 -1
- package/dist/review.js +14 -5
- package/dist/review.js.map +1 -1
- package/dist/session.d.ts +20 -4
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +76 -16
- package/dist/session.js.map +1 -1
- package/dist/sql/types.d.ts.map +1 -1
- package/dist/sqlite/query.d.ts +29 -0
- package/dist/sqlite/query.d.ts.map +1 -1
- package/dist/sqlite/query.js +98 -11
- package/dist/sqlite/query.js.map +1 -1
- package/dist/sqlite/rawQueryWorker.d.ts +22 -0
- package/dist/sqlite/rawQueryWorker.d.ts.map +1 -0
- package/dist/sqlite/rawQueryWorker.js +31 -0
- package/dist/sqlite/rawQueryWorker.js.map +1 -0
- package/dist/sqlite/rawQueryWorkerPool.d.ts +66 -0
- package/dist/sqlite/rawQueryWorkerPool.d.ts.map +1 -0
- package/dist/sqlite/rawQueryWorkerPool.js +142 -0
- package/dist/sqlite/rawQueryWorkerPool.js.map +1 -0
- package/dist/sqlite/schema.d.ts +2 -1
- package/dist/sqlite/schema.d.ts.map +1 -1
- package/dist/sqlite/schema.js +15 -1
- package/dist/sqlite/schema.js.map +1 -1
- package/dist/sqlite/write.d.ts.map +1 -1
- package/dist/sqlite/write.js +15 -0
- package/dist/sqlite/write.js.map +1 -1
- package/dist/sqlite-driver.d.ts +11 -0
- package/dist/sqlite-driver.d.ts.map +1 -1
- package/dist/sqlite-driver.js +28 -2
- package/dist/sqlite-driver.js.map +1 -1
- package/dist/sqlite.d.ts +1 -1
- package/dist/sqlite.d.ts.map +1 -1
- package/dist/sqlite.js +1 -1
- package/dist/sqlite.js.map +1 -1
- package/dist/util/bloomFilter.d.ts +3 -2
- package/dist/util/bloomFilter.d.ts.map +1 -1
- package/dist/util/bloomFilter.js +8 -8
- package/dist/util/bloomFilter.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 +9 -2
- package/dist/util/concurrency.js.map +1 -1
- package/dist/util/confinedFile.d.ts +42 -2
- package/dist/util/confinedFile.d.ts.map +1 -1
- package/dist/util/confinedFile.js +114 -3
- package/dist/util/confinedFile.js.map +1 -1
- package/dist/util/errors.d.ts +2 -0
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +18 -0
- package/dist/util/errors.js.map +1 -1
- package/dist/util/git.d.ts +2 -0
- package/dist/util/git.d.ts.map +1 -1
- package/dist/util/git.js +174 -26
- package/dist/util/git.js.map +1 -1
- package/dist/util/identifiers.d.ts +75 -0
- package/dist/util/identifiers.d.ts.map +1 -0
- package/dist/util/identifiers.js +82 -0
- package/dist/util/identifiers.js.map +1 -0
- package/dist/util/paths.d.ts.map +1 -1
- package/dist/util/paths.js +45 -9
- package/dist/util/paths.js.map +1 -1
- package/dist/util/projectFiles.d.ts.map +1 -1
- package/dist/util/projectFiles.js +43 -14
- package/dist/util/projectFiles.js.map +1 -1
- package/dist/util/resolution/jvm.d.ts.map +1 -1
- package/dist/util/resolution/jvm.js +20 -9
- 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 +6 -5
- package/dist/util/resolution/php.js.map +1 -1
- package/dist/util/resolution/tsconfig.d.ts.map +1 -1
- package/dist/util/resolution/tsconfig.js +26 -12
- package/dist/util/resolution/tsconfig.js.map +1 -1
- package/dist/util/rustTestModules.d.ts.map +1 -1
- package/dist/util/rustTestModules.js +4 -2
- package/dist/util/rustTestModules.js.map +1 -1
- package/dist/util/specifiers.d.ts.map +1 -1
- package/dist/util/specifiers.js +10 -3
- package/dist/util/specifiers.js.map +1 -1
- package/dist/util/sqliteSchema.d.ts.map +1 -1
- package/dist/util/sqliteSchema.js +10 -1
- package/dist/util/sqliteSchema.js.map +1 -1
- package/dist/worker/nativeExtractWorker.d.ts +4 -2
- package/dist/worker/nativeExtractWorker.d.ts.map +1 -1
- package/dist/worker/nativeExtractWorker.js +12 -11
- package/dist/worker/nativeExtractWorker.js.map +1 -1
- package/docs/mcp.md +35 -14
- package/package.json +3 -3
|
@@ -7,570 +7,12 @@ import { isJsTsLanguage } from "../languages/js-family.js";
|
|
|
7
7
|
import { sliceText, toRange } from "../util/ast.js";
|
|
8
8
|
import { fileIdentityKey } from "../util/paths.js";
|
|
9
9
|
import { getCallCompatibilityProvider, getCallCompatibilitySupportedLanguages, registerCallCompatibilityExtractors, } from "./call-compatibility/providers/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import { canStartReferenceLookup, recordReferenceLookupOmitted, recordReferenceLookupStarted, } from "./budgets.js";
|
|
10
|
+
import { findOpeningParen, findSignatureOpeningParen, findCommentEnd, findCallOpeningParen, findBalancedParentheses, canStartRegexLiteral, findRegexLiteralEnd, splitTopLevelCommaGroups, } from "./call-compatibility/textScanner.js";
|
|
12
11
|
function supportsCallCompatibilityLanguage(languageId) {
|
|
13
12
|
return getCallCompatibilityProvider(languageId) !== null;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return -1;
|
|
18
|
-
}
|
|
19
|
-
return source.indexOf("(", startIndex);
|
|
20
|
-
}
|
|
21
|
-
function findSignatureOpeningParen(source, startIndex) {
|
|
22
|
-
if (startIndex < 0 || startIndex >= source.length) {
|
|
23
|
-
return -1;
|
|
24
|
-
}
|
|
25
|
-
let quote = null;
|
|
26
|
-
let escaped = false;
|
|
27
|
-
let isTypeAnnotation = false;
|
|
28
|
-
for (let index = startIndex; index < source.length; index += 1) {
|
|
29
|
-
const char = source[index];
|
|
30
|
-
if (quote) {
|
|
31
|
-
if (escaped) {
|
|
32
|
-
escaped = false;
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
if (char === "\\") {
|
|
36
|
-
escaped = true;
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
if (char === quote) {
|
|
40
|
-
quote = null;
|
|
41
|
-
}
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const commentEnd = findCommentEnd(source, index);
|
|
45
|
-
if (commentEnd !== null) {
|
|
46
|
-
if (commentEnd < 0) {
|
|
47
|
-
return -1;
|
|
48
|
-
}
|
|
49
|
-
index = commentEnd - 1;
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
53
|
-
quote = char;
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
if (char === "<") {
|
|
57
|
-
const closeIndex = findBalancedAngleBrackets(source, index);
|
|
58
|
-
if (closeIndex < 0) {
|
|
59
|
-
return -1;
|
|
60
|
-
}
|
|
61
|
-
index = closeIndex;
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if (char === ":") {
|
|
65
|
-
isTypeAnnotation = true;
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
if (char === "=") {
|
|
69
|
-
if (source[index + 1] === ">") {
|
|
70
|
-
index += 1;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
isTypeAnnotation = false;
|
|
74
|
-
continue;
|
|
75
|
-
}
|
|
76
|
-
if (char === "(") {
|
|
77
|
-
if (!isTypeAnnotation) {
|
|
78
|
-
return index;
|
|
79
|
-
}
|
|
80
|
-
const balanced = findBalancedParentheses(source, index);
|
|
81
|
-
if (!balanced) {
|
|
82
|
-
return -1;
|
|
83
|
-
}
|
|
84
|
-
index = balanced.end - 1;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return -1;
|
|
88
|
-
}
|
|
89
|
-
function findCommentEnd(source, index) {
|
|
90
|
-
if (source[index] !== "/") {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
const nextChar = source[index + 1];
|
|
94
|
-
if (nextChar === "/") {
|
|
95
|
-
const newlineIndex = source.indexOf("\n", index + 2);
|
|
96
|
-
if (newlineIndex < 0) {
|
|
97
|
-
return source.length;
|
|
98
|
-
}
|
|
99
|
-
return newlineIndex;
|
|
100
|
-
}
|
|
101
|
-
if (nextChar === "*") {
|
|
102
|
-
const closeIndex = source.indexOf("*/", index + 2);
|
|
103
|
-
if (closeIndex < 0) {
|
|
104
|
-
return -1;
|
|
105
|
-
}
|
|
106
|
-
return closeIndex + 2;
|
|
107
|
-
}
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
function findCallOpeningParen(source, startIndex, endIndex) {
|
|
111
|
-
if (endIndex === undefined) {
|
|
112
|
-
return findOpeningParen(source, startIndex);
|
|
113
|
-
}
|
|
114
|
-
if (endIndex < startIndex || endIndex > source.length) {
|
|
115
|
-
return -1;
|
|
116
|
-
}
|
|
117
|
-
let skippedWhitespace = false;
|
|
118
|
-
for (let index = endIndex; index < source.length; index += 1) {
|
|
119
|
-
const char = source[index];
|
|
120
|
-
if (char === undefined) {
|
|
121
|
-
return -1;
|
|
122
|
-
}
|
|
123
|
-
if (/\s/.test(char)) {
|
|
124
|
-
skippedWhitespace = true;
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
if (char === "(") {
|
|
128
|
-
return index;
|
|
129
|
-
}
|
|
130
|
-
if (char === "<") {
|
|
131
|
-
if (skippedWhitespace) {
|
|
132
|
-
return -1;
|
|
133
|
-
}
|
|
134
|
-
const closeIndex = findBalancedAngleBrackets(source, index);
|
|
135
|
-
if (closeIndex < 0) {
|
|
136
|
-
return -1;
|
|
137
|
-
}
|
|
138
|
-
for (let afterGeneric = closeIndex + 1; afterGeneric < source.length; afterGeneric += 1) {
|
|
139
|
-
const nextChar = source[afterGeneric];
|
|
140
|
-
if (nextChar === undefined) {
|
|
141
|
-
return -1;
|
|
142
|
-
}
|
|
143
|
-
if (/\s/.test(nextChar)) {
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
if (nextChar === "(") {
|
|
147
|
-
return afterGeneric;
|
|
148
|
-
}
|
|
149
|
-
return -1;
|
|
150
|
-
}
|
|
151
|
-
return -1;
|
|
152
|
-
}
|
|
153
|
-
return -1;
|
|
154
|
-
}
|
|
155
|
-
return -1;
|
|
156
|
-
}
|
|
157
|
-
function findBalancedAngleBrackets(source, openIndex) {
|
|
158
|
-
if (source[openIndex] !== "<") {
|
|
159
|
-
return -1;
|
|
160
|
-
}
|
|
161
|
-
let depth = 0;
|
|
162
|
-
let parenDepth = 0;
|
|
163
|
-
let bracketDepth = 0;
|
|
164
|
-
let braceDepth = 0;
|
|
165
|
-
let quote = null;
|
|
166
|
-
let escaped = false;
|
|
167
|
-
for (let index = openIndex; index < source.length; index += 1) {
|
|
168
|
-
const char = source[index];
|
|
169
|
-
if (quote) {
|
|
170
|
-
if (escaped) {
|
|
171
|
-
escaped = false;
|
|
172
|
-
continue;
|
|
173
|
-
}
|
|
174
|
-
if (char === "\\") {
|
|
175
|
-
escaped = true;
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (char === quote) {
|
|
179
|
-
quote = null;
|
|
180
|
-
}
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const commentEnd = findCommentEnd(source, index);
|
|
184
|
-
if (commentEnd !== null) {
|
|
185
|
-
if (commentEnd < 0) {
|
|
186
|
-
return -1;
|
|
187
|
-
}
|
|
188
|
-
index = commentEnd - 1;
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
192
|
-
quote = char;
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
if (char === "(") {
|
|
196
|
-
parenDepth += 1;
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
if (char === ")") {
|
|
200
|
-
parenDepth -= 1;
|
|
201
|
-
if (parenDepth < 0) {
|
|
202
|
-
return -1;
|
|
203
|
-
}
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
if (char === "[") {
|
|
207
|
-
bracketDepth += 1;
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
if (char === "]") {
|
|
211
|
-
bracketDepth -= 1;
|
|
212
|
-
if (bracketDepth < 0) {
|
|
213
|
-
return -1;
|
|
214
|
-
}
|
|
215
|
-
continue;
|
|
216
|
-
}
|
|
217
|
-
if (char === "{") {
|
|
218
|
-
braceDepth += 1;
|
|
219
|
-
continue;
|
|
220
|
-
}
|
|
221
|
-
if (char === "}") {
|
|
222
|
-
braceDepth -= 1;
|
|
223
|
-
if (braceDepth < 0) {
|
|
224
|
-
return -1;
|
|
225
|
-
}
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
const atTopLevel = !parenDepth && !bracketDepth && !braceDepth;
|
|
229
|
-
if (char === "<" && atTopLevel) {
|
|
230
|
-
depth += 1;
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
if (char === ">" && source[index - 1] !== "=" && atTopLevel) {
|
|
234
|
-
depth -= 1;
|
|
235
|
-
if (!depth) {
|
|
236
|
-
return index;
|
|
237
|
-
}
|
|
238
|
-
if (depth < 0) {
|
|
239
|
-
return -1;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return -1;
|
|
244
|
-
}
|
|
245
|
-
function findBalancedParentheses(source, openIndex) {
|
|
246
|
-
if (openIndex < 0 || source[openIndex] !== "(") {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
let depth = 0;
|
|
250
|
-
let quote = null;
|
|
251
|
-
let escaped = false;
|
|
252
|
-
for (let index = openIndex; index < source.length; index += 1) {
|
|
253
|
-
const char = source[index];
|
|
254
|
-
if (quote) {
|
|
255
|
-
if (escaped) {
|
|
256
|
-
escaped = false;
|
|
257
|
-
continue;
|
|
258
|
-
}
|
|
259
|
-
if (char === "\\") {
|
|
260
|
-
escaped = true;
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
if (char === quote) {
|
|
264
|
-
quote = null;
|
|
265
|
-
}
|
|
266
|
-
continue;
|
|
267
|
-
}
|
|
268
|
-
const commentEnd = findCommentEnd(source, index);
|
|
269
|
-
if (commentEnd !== null) {
|
|
270
|
-
if (commentEnd < 0) {
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
273
|
-
index = commentEnd - 1;
|
|
274
|
-
continue;
|
|
275
|
-
}
|
|
276
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
277
|
-
quote = char;
|
|
278
|
-
continue;
|
|
279
|
-
}
|
|
280
|
-
if (char === "(") {
|
|
281
|
-
depth += 1;
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
if (char === ")") {
|
|
285
|
-
depth -= 1;
|
|
286
|
-
if (!depth) {
|
|
287
|
-
return {
|
|
288
|
-
start: openIndex,
|
|
289
|
-
end: index + 1,
|
|
290
|
-
inner: source.slice(openIndex + 1, index),
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
if (depth < 0) {
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return null;
|
|
299
|
-
}
|
|
300
|
-
function hasTypeContextBeforeLessThan(text, index, groupStart) {
|
|
301
|
-
const left = text.slice(groupStart, index).trimEnd();
|
|
302
|
-
if (!left) {
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
const typeKeywordPattern = /(^|[\s([{,:?=<>|&])(?:as|satisfies|new)\s+[A-Za-z_$][\w$.[\]\s]*$/;
|
|
306
|
-
return typeKeywordPattern.test(left) || hasOpenTypeAnnotationBefore(text, index, groupStart);
|
|
307
|
-
}
|
|
308
|
-
function hasOpenTypeAnnotationBefore(text, index, groupStart) {
|
|
309
|
-
let parenDepth = 0;
|
|
310
|
-
let bracketDepth = 0;
|
|
311
|
-
let braceDepth = 0;
|
|
312
|
-
let quote = null;
|
|
313
|
-
let escaped = false;
|
|
314
|
-
let hasTypeAnnotation = false;
|
|
315
|
-
for (let current = groupStart; current < index; current += 1) {
|
|
316
|
-
const char = text[current];
|
|
317
|
-
if (quote) {
|
|
318
|
-
if (escaped) {
|
|
319
|
-
escaped = false;
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
if (char === "\\") {
|
|
323
|
-
escaped = true;
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
if (char === quote) {
|
|
327
|
-
quote = null;
|
|
328
|
-
}
|
|
329
|
-
continue;
|
|
330
|
-
}
|
|
331
|
-
const commentEnd = findCommentEnd(text, current);
|
|
332
|
-
if (commentEnd !== null) {
|
|
333
|
-
if (commentEnd < 0) {
|
|
334
|
-
return false;
|
|
335
|
-
}
|
|
336
|
-
current = commentEnd - 1;
|
|
337
|
-
continue;
|
|
338
|
-
}
|
|
339
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
340
|
-
quote = char;
|
|
341
|
-
continue;
|
|
342
|
-
}
|
|
343
|
-
if (char === "(") {
|
|
344
|
-
parenDepth += 1;
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
if (char === ")") {
|
|
348
|
-
parenDepth -= 1;
|
|
349
|
-
if (parenDepth < 0) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
if (char === "[") {
|
|
355
|
-
bracketDepth += 1;
|
|
356
|
-
continue;
|
|
357
|
-
}
|
|
358
|
-
if (char === "]") {
|
|
359
|
-
bracketDepth -= 1;
|
|
360
|
-
if (bracketDepth < 0) {
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
if (char === "{") {
|
|
366
|
-
braceDepth += 1;
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
if (char === "}") {
|
|
370
|
-
braceDepth -= 1;
|
|
371
|
-
if (braceDepth < 0) {
|
|
372
|
-
return false;
|
|
373
|
-
}
|
|
374
|
-
continue;
|
|
375
|
-
}
|
|
376
|
-
const atTopLevel = !parenDepth && !bracketDepth && !braceDepth;
|
|
377
|
-
if (!atTopLevel) {
|
|
378
|
-
continue;
|
|
379
|
-
}
|
|
380
|
-
if (char === ":") {
|
|
381
|
-
hasTypeAnnotation = true;
|
|
382
|
-
continue;
|
|
383
|
-
}
|
|
384
|
-
if (char === "=" && text[current + 1] !== ">") {
|
|
385
|
-
hasTypeAnnotation = false;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return hasTypeAnnotation;
|
|
389
|
-
}
|
|
390
|
-
function previousSignificantIndex(text, index, groupStart) {
|
|
391
|
-
for (let current = index - 1; current >= groupStart; current -= 1) {
|
|
392
|
-
const char = text[current];
|
|
393
|
-
if (char !== undefined && !/\s/.test(char)) {
|
|
394
|
-
return current;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
return -1;
|
|
398
|
-
}
|
|
399
|
-
function previousSignificantChar(text, index, groupStart) {
|
|
400
|
-
const previousIndex = previousSignificantIndex(text, index, groupStart);
|
|
401
|
-
if (previousIndex < 0) {
|
|
402
|
-
return null;
|
|
403
|
-
}
|
|
404
|
-
return text[previousIndex] ?? null;
|
|
405
|
-
}
|
|
406
|
-
function previousSignificantCharBefore(text, index, groupStart) {
|
|
407
|
-
const previousIndex = previousSignificantIndex(text, index, groupStart);
|
|
408
|
-
if (previousIndex < 0) {
|
|
409
|
-
return null;
|
|
410
|
-
}
|
|
411
|
-
return previousSignificantChar(text, previousIndex, groupStart);
|
|
412
|
-
}
|
|
413
|
-
function canStartRegexLiteral(text, index, groupStart) {
|
|
414
|
-
if (text[index] !== "/" || text[index + 1] === "/" || text[index + 1] === "*") {
|
|
415
|
-
return false;
|
|
416
|
-
}
|
|
417
|
-
const previous = previousSignificantChar(text, index, groupStart);
|
|
418
|
-
if (!previous) {
|
|
419
|
-
return true;
|
|
420
|
-
}
|
|
421
|
-
if (previous === ">" && previousSignificantCharBefore(text, index, groupStart) === "=") {
|
|
422
|
-
return true;
|
|
423
|
-
}
|
|
424
|
-
return "([{,=:+-!*?&|;".includes(previous);
|
|
425
|
-
}
|
|
426
|
-
function findRegexLiteralEnd(text, index) {
|
|
427
|
-
if (text[index] !== "/" || text[index + 1] === "/" || text[index + 1] === "*") {
|
|
428
|
-
return null;
|
|
429
|
-
}
|
|
430
|
-
let escaped = false;
|
|
431
|
-
let inCharacterClass = false;
|
|
432
|
-
for (let current = index + 1; current < text.length; current += 1) {
|
|
433
|
-
const char = text[current];
|
|
434
|
-
if (char === "\n" || char === "\r") {
|
|
435
|
-
return -1;
|
|
436
|
-
}
|
|
437
|
-
if (escaped) {
|
|
438
|
-
escaped = false;
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
if (char === "\\") {
|
|
442
|
-
escaped = true;
|
|
443
|
-
continue;
|
|
444
|
-
}
|
|
445
|
-
if (char === "[") {
|
|
446
|
-
inCharacterClass = true;
|
|
447
|
-
continue;
|
|
448
|
-
}
|
|
449
|
-
if (char === "]") {
|
|
450
|
-
inCharacterClass = false;
|
|
451
|
-
continue;
|
|
452
|
-
}
|
|
453
|
-
if (char === "/" && !inCharacterClass) {
|
|
454
|
-
let endIndex = current + 1;
|
|
455
|
-
while (/[A-Za-z]/.test(text[endIndex] ?? "")) {
|
|
456
|
-
endIndex += 1;
|
|
457
|
-
}
|
|
458
|
-
return endIndex;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return -1;
|
|
462
|
-
}
|
|
463
|
-
function splitTopLevelCommaGroups(text, angleMode, detectRegexLiterals = true) {
|
|
464
|
-
const trimmed = text.trim();
|
|
465
|
-
if (!trimmed) {
|
|
466
|
-
return [];
|
|
467
|
-
}
|
|
468
|
-
const groups = [];
|
|
469
|
-
let groupStart = 0;
|
|
470
|
-
let parenDepth = 0;
|
|
471
|
-
let bracketDepth = 0;
|
|
472
|
-
let braceDepth = 0;
|
|
473
|
-
let angleDepth = 0;
|
|
474
|
-
let quote = null;
|
|
475
|
-
let escaped = false;
|
|
476
|
-
for (let index = 0; index < text.length; index += 1) {
|
|
477
|
-
const char = text[index];
|
|
478
|
-
if (quote) {
|
|
479
|
-
if (escaped) {
|
|
480
|
-
escaped = false;
|
|
481
|
-
continue;
|
|
482
|
-
}
|
|
483
|
-
if (char === "\\") {
|
|
484
|
-
escaped = true;
|
|
485
|
-
continue;
|
|
486
|
-
}
|
|
487
|
-
if (char === quote) {
|
|
488
|
-
quote = null;
|
|
489
|
-
}
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
const commentEnd = findCommentEnd(text, index);
|
|
493
|
-
if (commentEnd !== null) {
|
|
494
|
-
if (commentEnd < 0) {
|
|
495
|
-
return null;
|
|
496
|
-
}
|
|
497
|
-
index = commentEnd - 1;
|
|
498
|
-
continue;
|
|
499
|
-
}
|
|
500
|
-
if (detectRegexLiterals && canStartRegexLiteral(text, index, groupStart)) {
|
|
501
|
-
const regexEnd = findRegexLiteralEnd(text, index);
|
|
502
|
-
if (regexEnd === null) {
|
|
503
|
-
return null;
|
|
504
|
-
}
|
|
505
|
-
if (regexEnd < 0) {
|
|
506
|
-
return null;
|
|
507
|
-
}
|
|
508
|
-
index = regexEnd - 1;
|
|
509
|
-
continue;
|
|
510
|
-
}
|
|
511
|
-
if (char === '"' || char === "'" || char === "`") {
|
|
512
|
-
quote = char;
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
if (char === "(") {
|
|
516
|
-
parenDepth += 1;
|
|
517
|
-
continue;
|
|
518
|
-
}
|
|
519
|
-
if (char === ")") {
|
|
520
|
-
parenDepth -= 1;
|
|
521
|
-
if (parenDepth < 0) {
|
|
522
|
-
return null;
|
|
523
|
-
}
|
|
524
|
-
continue;
|
|
525
|
-
}
|
|
526
|
-
if (char === "[") {
|
|
527
|
-
bracketDepth += 1;
|
|
528
|
-
continue;
|
|
529
|
-
}
|
|
530
|
-
if (char === "]") {
|
|
531
|
-
bracketDepth -= 1;
|
|
532
|
-
if (bracketDepth < 0) {
|
|
533
|
-
return null;
|
|
534
|
-
}
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
if (char === "{") {
|
|
538
|
-
braceDepth += 1;
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
if (char === "}") {
|
|
542
|
-
braceDepth -= 1;
|
|
543
|
-
if (braceDepth < 0) {
|
|
544
|
-
return null;
|
|
545
|
-
}
|
|
546
|
-
continue;
|
|
547
|
-
}
|
|
548
|
-
const atDelimiterTopLevel = !parenDepth && !bracketDepth && !braceDepth;
|
|
549
|
-
if (char === "<" &&
|
|
550
|
-
atDelimiterTopLevel &&
|
|
551
|
-
(angleDepth || angleMode === "always" || hasTypeContextBeforeLessThan(text, index, groupStart))) {
|
|
552
|
-
angleDepth += 1;
|
|
553
|
-
continue;
|
|
554
|
-
}
|
|
555
|
-
if (char === ">" && angleDepth && text[index - 1] !== "=" && atDelimiterTopLevel) {
|
|
556
|
-
angleDepth -= 1;
|
|
557
|
-
continue;
|
|
558
|
-
}
|
|
559
|
-
const atTopLevel = atDelimiterTopLevel && !angleDepth;
|
|
560
|
-
if (char === "," && atTopLevel) {
|
|
561
|
-
groups.push(text.slice(groupStart, index).trim());
|
|
562
|
-
groupStart = index + 1;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
if (quote || parenDepth || bracketDepth || braceDepth || angleDepth) {
|
|
566
|
-
return null;
|
|
567
|
-
}
|
|
568
|
-
groups.push(text.slice(groupStart).trim());
|
|
569
|
-
if (groups.length && groups[groups.length - 1] === "") {
|
|
570
|
-
groups.pop();
|
|
571
|
-
}
|
|
572
|
-
return groups;
|
|
573
|
-
}
|
|
14
|
+
import { directSignatureParameterNode, findAncestorOfTypes, findFirstDescendantOfTypes, } from "./signature-node-utils.js";
|
|
15
|
+
import { canStartReferenceLookup, recordReferenceLookupOmitted, recordReferenceLookupStarted, } from "./budgets.js";
|
|
574
16
|
function referenceScanLimitForCallsites(maxRefs) {
|
|
575
17
|
return Math.max(maxRefs + 50, maxRefs * 4);
|
|
576
18
|
}
|
|
@@ -1241,33 +683,69 @@ function rangeContainsIndex(range, index) {
|
|
|
1241
683
|
}
|
|
1242
684
|
return index >= startIndex && index <= endIndex;
|
|
1243
685
|
}
|
|
1244
|
-
function
|
|
686
|
+
export function buildCallerRangeIndex(index) {
|
|
687
|
+
const byFile = new Map();
|
|
688
|
+
for (const module of index.byFile.values()) {
|
|
689
|
+
const entries = module.locals
|
|
690
|
+
.flatMap((local) => {
|
|
691
|
+
const startIndex = local.range.start.index;
|
|
692
|
+
const endIndex = local.range.end.index;
|
|
693
|
+
if (startIndex === undefined || endIndex === undefined)
|
|
694
|
+
return [];
|
|
695
|
+
return [{ local, maxEndIndex: endIndex }];
|
|
696
|
+
})
|
|
697
|
+
.sort((left, right) => {
|
|
698
|
+
const startDifference = left.local.range.start.index - right.local.range.start.index;
|
|
699
|
+
if (startDifference !== 0)
|
|
700
|
+
return startDifference;
|
|
701
|
+
return left.local.range.end.index - right.local.range.end.index;
|
|
702
|
+
});
|
|
703
|
+
let maxEndIndex = Number.NEGATIVE_INFINITY;
|
|
704
|
+
for (const entry of entries) {
|
|
705
|
+
maxEndIndex = Math.max(maxEndIndex, entry.local.range.end.index);
|
|
706
|
+
entry.maxEndIndex = maxEndIndex;
|
|
707
|
+
}
|
|
708
|
+
byFile.set(fileIdentityKey(module.file), entries);
|
|
709
|
+
}
|
|
710
|
+
return byFile;
|
|
711
|
+
}
|
|
712
|
+
export function findCallerSymbolId(callerRangeIndex, ref) {
|
|
1245
713
|
const startIndex = ref.range.start.index;
|
|
1246
|
-
if (startIndex === undefined)
|
|
714
|
+
if (startIndex === undefined)
|
|
1247
715
|
return undefined;
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
if (!module) {
|
|
716
|
+
const entries = callerRangeIndex.get(fileIdentityKey(ref.file));
|
|
717
|
+
if (!entries?.length)
|
|
1251
718
|
return undefined;
|
|
719
|
+
let low = 0;
|
|
720
|
+
let high = entries.length;
|
|
721
|
+
while (low < high) {
|
|
722
|
+
const middle = Math.floor((low + high) / 2);
|
|
723
|
+
const middleStart = entries[middle].local.range.start.index;
|
|
724
|
+
if (middleStart <= startIndex) {
|
|
725
|
+
low = middle + 1;
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
high = middle;
|
|
729
|
+
}
|
|
1252
730
|
}
|
|
1253
731
|
let best;
|
|
1254
|
-
for (
|
|
1255
|
-
|
|
732
|
+
for (let index = low - 1; index >= 0; index -= 1) {
|
|
733
|
+
const entry = entries[index];
|
|
734
|
+
if (entry.maxEndIndex < startIndex)
|
|
735
|
+
break;
|
|
736
|
+
if (!rangeContainsIndex(entry.local.range, startIndex))
|
|
1256
737
|
continue;
|
|
1257
|
-
}
|
|
1258
738
|
if (!best) {
|
|
1259
|
-
best = local;
|
|
739
|
+
best = entry.local;
|
|
1260
740
|
continue;
|
|
1261
741
|
}
|
|
1262
|
-
const localSpan = (local.range.end.index ?? 0) - (local.range.start.index ?? 0);
|
|
742
|
+
const localSpan = (entry.local.range.end.index ?? 0) - (entry.local.range.start.index ?? 0);
|
|
1263
743
|
const bestSpan = (best.range.end.index ?? 0) - (best.range.start.index ?? 0);
|
|
1264
|
-
if (localSpan < bestSpan)
|
|
1265
|
-
best = local;
|
|
1266
|
-
}
|
|
744
|
+
if (localSpan < bestSpan)
|
|
745
|
+
best = entry.local;
|
|
1267
746
|
}
|
|
1268
|
-
if (!best)
|
|
747
|
+
if (!best)
|
|
1269
748
|
return undefined;
|
|
1270
|
-
}
|
|
1271
749
|
const bestStartIndex = best.range.start.index ?? 0;
|
|
1272
750
|
return `${best.file}::${best.localName}::${bestStartIndex}`;
|
|
1273
751
|
}
|
|
@@ -1312,7 +790,7 @@ async function collectVerifiedCallsiteReferences(index, changedSymbol, maxRefs,
|
|
|
1312
790
|
if (!support || !supportsCallCompatibilityLanguage(support.id)) {
|
|
1313
791
|
continue;
|
|
1314
792
|
}
|
|
1315
|
-
const parsed = await tryEnsureParsedContext(file, index.parsed?.get(fileIdentityKey(file)), diagnostics);
|
|
793
|
+
const parsed = await tryEnsureParsedContext(file, index.parsed?.get(fileIdentityKey(file)), index.languageExtensions, diagnostics);
|
|
1316
794
|
if (!parsed) {
|
|
1317
795
|
continue;
|
|
1318
796
|
}
|
|
@@ -1366,14 +844,11 @@ function classifyCompatibility(expected, actual) {
|
|
|
1366
844
|
}
|
|
1367
845
|
return { status: "compatible", reason: "compatible_argument_count" };
|
|
1368
846
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
return await ensureParsedContext(file, parsedEntry);
|
|
1372
|
-
}
|
|
1373
|
-
catch {
|
|
847
|
+
function tryEnsureParsedContext(file, parsedEntry, languageExtensions, diagnostics) {
|
|
848
|
+
return ensureParsedContext(file, parsedEntry, languageExtensions).catch(() => {
|
|
1374
849
|
incrementSkippedReason(diagnostics, "parse-failed");
|
|
1375
850
|
return null;
|
|
1376
|
-
}
|
|
851
|
+
});
|
|
1377
852
|
}
|
|
1378
853
|
function incrementSkippedReason(diagnostics, reason) {
|
|
1379
854
|
if (!diagnostics) {
|
|
@@ -1382,7 +857,7 @@ function incrementSkippedReason(diagnostics, reason) {
|
|
|
1382
857
|
diagnostics.skippedByReason[reason] = (diagnostics.skippedByReason[reason] ?? 0) + 1;
|
|
1383
858
|
}
|
|
1384
859
|
async function buildCallCompatibilityHintForReference(input) {
|
|
1385
|
-
const { index, changedSymbol, signature, ref, diagnostics, projectRoot } = input;
|
|
860
|
+
const { index, changedSymbol, signature, ref, callerRangeIndex, diagnostics, projectRoot } = input;
|
|
1386
861
|
if (fileIdentityKey(ref.file) === fileIdentityKey(changedSymbol.file) &&
|
|
1387
862
|
sameRangeStart(ref.range, changedSymbol.range)) {
|
|
1388
863
|
return null;
|
|
@@ -1391,7 +866,7 @@ async function buildCallCompatibilityHintForReference(input) {
|
|
|
1391
866
|
if (calleeStartIndex === undefined) {
|
|
1392
867
|
return null;
|
|
1393
868
|
}
|
|
1394
|
-
const parsedCallsite = await tryEnsureParsedContext(ref.file, index.parsed?.get(fileIdentityKey(ref.file)), diagnostics);
|
|
869
|
+
const parsedCallsite = await tryEnsureParsedContext(ref.file, index.parsed?.get(fileIdentityKey(ref.file)), index.languageExtensions, diagnostics);
|
|
1395
870
|
if (!parsedCallsite) {
|
|
1396
871
|
return null;
|
|
1397
872
|
}
|
|
@@ -1410,7 +885,7 @@ async function buildCallCompatibilityHintForReference(input) {
|
|
|
1410
885
|
return null;
|
|
1411
886
|
}
|
|
1412
887
|
const compatibility = classifyCompatibility(signature, actual);
|
|
1413
|
-
const callerSymbolId = findCallerSymbolId(
|
|
888
|
+
const callerSymbolId = findCallerSymbolId(callerRangeIndex, ref);
|
|
1414
889
|
const callsiteFile = projectRoot ? path.relative(projectRoot, ref.file).replace(/\\/g, "/") : ref.file;
|
|
1415
890
|
return {
|
|
1416
891
|
...compatibility,
|
|
@@ -1432,6 +907,7 @@ export async function attachCallCompatibilityHints(index, changedSymbols, option
|
|
|
1432
907
|
if (options.maxRefs <= 0) {
|
|
1433
908
|
return;
|
|
1434
909
|
}
|
|
910
|
+
const callerRangeIndex = buildCallerRangeIndex(index);
|
|
1435
911
|
const diagnostics = options.diagnostics?.callCompatibility;
|
|
1436
912
|
if (diagnostics) {
|
|
1437
913
|
diagnostics.supportedLanguages = [...getCallCompatibilitySupportedLanguages()];
|
|
@@ -1447,7 +923,7 @@ export async function attachCallCompatibilityHints(index, changedSymbols, option
|
|
|
1447
923
|
recordReferenceLookupOmitted(options.workBudget, 1);
|
|
1448
924
|
continue;
|
|
1449
925
|
}
|
|
1450
|
-
const parsedDefinition = await tryEnsureParsedContext(changedSymbol.file, index.parsed?.get(fileIdentityKey(changedSymbol.file)), diagnostics);
|
|
926
|
+
const parsedDefinition = await tryEnsureParsedContext(changedSymbol.file, index.parsed?.get(fileIdentityKey(changedSymbol.file)), index.languageExtensions, diagnostics);
|
|
1451
927
|
if (!parsedDefinition) {
|
|
1452
928
|
continue;
|
|
1453
929
|
}
|
|
@@ -1502,6 +978,7 @@ export async function attachCallCompatibilityHints(index, changedSymbols, option
|
|
|
1502
978
|
changedSymbol,
|
|
1503
979
|
signature,
|
|
1504
980
|
ref,
|
|
981
|
+
callerRangeIndex,
|
|
1505
982
|
diagnostics,
|
|
1506
983
|
...(options.projectRoot ? { projectRoot: options.projectRoot } : {}),
|
|
1507
984
|
});
|