@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
|
@@ -5,11 +5,15 @@ import { findReferences } from "../indexer/navigation.js";
|
|
|
5
5
|
import { fileIdentityKey, resolveFilePathFromRoot, toProjectDisplayPath } from "../util/paths.js";
|
|
6
6
|
import { mapLimit } from "../util/concurrency.js";
|
|
7
7
|
import { maskJsLikeCommentsAndStrings } from "../util/comments.js";
|
|
8
|
+
import { findBalancedAngleBrackets, findBalancedBraces, findBalancedParentheses, } from "./call-compatibility/textScanner.js";
|
|
8
9
|
import { listCandidateTestFiles } from "./context.js";
|
|
9
10
|
import { collectHunkLineText, collectRemovedLines } from "./hunks.js";
|
|
10
11
|
import { normalizeImpactFilePath } from "./path.js";
|
|
11
12
|
import { collectImpactSuggestions } from "./suggestions.js";
|
|
12
13
|
import { compileTestPatterns, createIndexTestFileMatcher } from "./testPatterns.js";
|
|
14
|
+
import { ECMASCRIPT_IDENTIFIER_SOURCE } from "../util/identifiers.js";
|
|
15
|
+
const JAVASCRIPT_IDENTIFIER_PATTERN = new RegExp(ECMASCRIPT_IDENTIFIER_SOURCE, "uy");
|
|
16
|
+
const JAVASCRIPT_IDENTIFIER_PART_PATTERN = new RegExp(String.raw `(?:${ECMASCRIPT_IDENTIFIER_SOURCE})|[$_\p{ID_Continue}\u200c\u200d]`, "u");
|
|
13
17
|
const CONFIG_FILE_RE = /(^|\/)(?:tsconfig(?:\.[^./]+)?\.json|jsconfig\.json|vite\.config\.[cm]?[jt]s|webpack\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|esbuild\.config\.[cm]?[jt]s|babel\.config\.[cm]?[jt]s|\.eslintrc(?:\.[^./]+)?|prettier\.config\.[cm]?[jt]s|package\.json|pnpm-workspace\.ya?ml|lerna\.json|turbo\.json|nx\.json|\.env(?:\.[^/]*)?)$/i;
|
|
14
18
|
const UNTESTED_CHANGE_REFERENCE_SCAN_LIMIT = 500;
|
|
15
19
|
function matchesConfigSemantics(filePath) {
|
|
@@ -208,6 +212,7 @@ function collectConfigAndBreakingSuggestions(index, projectRoot, fileChanges, ch
|
|
|
208
212
|
for (const change of signatureChanges) {
|
|
209
213
|
upsertBreakingSuggestion({
|
|
210
214
|
file: normalized,
|
|
215
|
+
...(change.range ? { range: change.range } : {}),
|
|
211
216
|
kind: "breakingChange",
|
|
212
217
|
symbol: change.name,
|
|
213
218
|
details: change.details,
|
|
@@ -374,8 +379,9 @@ async function collectUntestedChangeSuggestions(index, changedSymbols, projectRo
|
|
|
374
379
|
});
|
|
375
380
|
if (refs.status !== "ok")
|
|
376
381
|
return undefined;
|
|
382
|
+
const scanMayBeTruncated = refs.references.length >= UNTESTED_CHANGE_REFERENCE_SCAN_LIMIT;
|
|
377
383
|
const hasTestRef = refs.references.some((entry) => testFiles.has(fileIdentityKey(entry.file)));
|
|
378
|
-
if (hasTestRef)
|
|
384
|
+
if (hasTestRef && !scanMayBeTruncated)
|
|
379
385
|
return undefined;
|
|
380
386
|
const coverage = coverageByFile.get(symbol.file);
|
|
381
387
|
const coveredLines = countCoveredLinesForRange(coverage, symbol.range);
|
|
@@ -389,18 +395,23 @@ async function collectUntestedChangeSuggestions(index, changedSymbols, projectRo
|
|
|
389
395
|
? `Coverage currently exercises ${coveredLines}/${totalLines} changed line(s).`
|
|
390
396
|
: "No LCOV or Istanbul coverage data matched this symbol range.";
|
|
391
397
|
const fanIn = fanInByFile.get(fileIdentityKey(symbol.file)) ?? 0;
|
|
392
|
-
const confidence =
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
const confidence = scanMayBeTruncated
|
|
399
|
+
? "low"
|
|
400
|
+
: confidenceFromSignals({
|
|
401
|
+
hasCoverageData,
|
|
402
|
+
coveredLines,
|
|
403
|
+
totalLines,
|
|
404
|
+
exported: symbol.exported,
|
|
405
|
+
fanIn,
|
|
406
|
+
kind: symbol.kind,
|
|
407
|
+
});
|
|
400
408
|
const suggestedCommand = inferTestCommand(candidateNames);
|
|
409
|
+
const referenceScanNote = scanMayBeTruncated
|
|
410
|
+
? `Reference scan reached the ${UNTESTED_CHANGE_REFERENCE_SCAN_LIMIT}-reference cap; test coverage may be under-counted. `
|
|
411
|
+
: "";
|
|
401
412
|
const details = candidateNames.length
|
|
402
|
-
?
|
|
403
|
-
:
|
|
413
|
+
? `${referenceScanNote}Changed symbol has no discovered references in test files. ${coverageSummary} Candidate tests: ${candidateNames.join(", ")}. Fan-in for this file is ${fanIn}. Suggested command: ${suggestedCommand}`
|
|
414
|
+
: `${referenceScanNote}Changed symbol has no discovered references in test files. ${coverageSummary} Fan-in for this file is ${fanIn}. Suggested command: ${suggestedCommand}`;
|
|
404
415
|
return {
|
|
405
416
|
file: symbol.file,
|
|
406
417
|
range: symbol.range,
|
|
@@ -524,41 +535,113 @@ function countNewlines(text) {
|
|
|
524
535
|
}
|
|
525
536
|
return count;
|
|
526
537
|
}
|
|
527
|
-
function
|
|
528
|
-
let
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
if (
|
|
534
|
-
|
|
535
|
-
escaping = false;
|
|
536
|
-
continue;
|
|
537
|
-
}
|
|
538
|
-
if (ch === "\\") {
|
|
539
|
-
escaping = true;
|
|
540
|
-
continue;
|
|
541
|
-
}
|
|
542
|
-
if (ch === quote)
|
|
543
|
-
quote = null;
|
|
538
|
+
function skipWhitespaceAndComments(text, index) {
|
|
539
|
+
let cursor = index;
|
|
540
|
+
while (cursor < text.length) {
|
|
541
|
+
const ch = text[cursor];
|
|
542
|
+
if (!ch)
|
|
543
|
+
break;
|
|
544
|
+
if (/\s/.test(ch)) {
|
|
545
|
+
cursor += 1;
|
|
544
546
|
continue;
|
|
545
547
|
}
|
|
546
|
-
if (ch ===
|
|
547
|
-
|
|
548
|
+
if (ch === "/" && text[cursor + 1] === "/") {
|
|
549
|
+
const newline = text.indexOf("\n", cursor + 2);
|
|
550
|
+
cursor = newline < 0 ? text.length : newline + 1;
|
|
548
551
|
continue;
|
|
549
552
|
}
|
|
550
|
-
if (ch === "
|
|
551
|
-
|
|
553
|
+
if (ch === "/" && text[cursor + 1] === "*") {
|
|
554
|
+
const close = text.indexOf("*/", cursor + 2);
|
|
555
|
+
cursor = close < 0 ? text.length : close + 2;
|
|
552
556
|
continue;
|
|
553
557
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
return cursor;
|
|
561
|
+
}
|
|
562
|
+
function readIdentifier(text, index) {
|
|
563
|
+
const ch = text[index];
|
|
564
|
+
if (!ch)
|
|
565
|
+
return null;
|
|
566
|
+
JAVASCRIPT_IDENTIFIER_PATTERN.lastIndex = index;
|
|
567
|
+
const identifierMatch = JAVASCRIPT_IDENTIFIER_PATTERN.exec(text);
|
|
568
|
+
if (!identifierMatch)
|
|
569
|
+
return null;
|
|
570
|
+
const end = JAVASCRIPT_IDENTIFIER_PATTERN.lastIndex;
|
|
571
|
+
return { name: text.slice(index, end), end };
|
|
572
|
+
}
|
|
573
|
+
function skipDecorator(text, index) {
|
|
574
|
+
if (text[index] !== "@")
|
|
575
|
+
return null;
|
|
576
|
+
let cursor = skipWhitespaceAndComments(text, index + 1);
|
|
577
|
+
let segment = readIdentifier(text, cursor);
|
|
578
|
+
if (!segment)
|
|
579
|
+
return null;
|
|
580
|
+
cursor = skipWhitespaceAndComments(text, segment.end);
|
|
581
|
+
while (text[cursor] === ".") {
|
|
582
|
+
cursor = skipWhitespaceAndComments(text, cursor + 1);
|
|
583
|
+
segment = readIdentifier(text, cursor);
|
|
584
|
+
if (!segment)
|
|
585
|
+
return null;
|
|
586
|
+
cursor = skipWhitespaceAndComments(text, segment.end);
|
|
587
|
+
}
|
|
588
|
+
if (text[cursor] === "(") {
|
|
589
|
+
const args = findBalancedParentheses(text, cursor);
|
|
590
|
+
if (!args)
|
|
591
|
+
return null;
|
|
592
|
+
return args.end;
|
|
593
|
+
}
|
|
594
|
+
return cursor;
|
|
595
|
+
}
|
|
596
|
+
function skipOptionalGenerics(text, index) {
|
|
597
|
+
const cursor = skipWhitespaceAndComments(text, index);
|
|
598
|
+
if (text[cursor] !== "<")
|
|
599
|
+
return cursor;
|
|
600
|
+
const close = findBalancedAngleBrackets(text, cursor);
|
|
601
|
+
return close < 0 ? cursor : close + 1;
|
|
602
|
+
}
|
|
603
|
+
function skipHeritageClause(text, index) {
|
|
604
|
+
let cursor = skipWhitespaceAndComments(text, index);
|
|
605
|
+
while (true) {
|
|
606
|
+
const keyword = readIdentifier(text, cursor);
|
|
607
|
+
if (!keyword || (keyword.name !== "extends" && keyword.name !== "implements")) {
|
|
608
|
+
return cursor;
|
|
609
|
+
}
|
|
610
|
+
cursor = skipWhitespaceAndComments(text, keyword.end);
|
|
611
|
+
while (cursor < text.length) {
|
|
612
|
+
const ch = text[cursor];
|
|
613
|
+
if (!ch)
|
|
614
|
+
break;
|
|
615
|
+
if (ch === "{")
|
|
616
|
+
return cursor;
|
|
617
|
+
if (ch === "<") {
|
|
618
|
+
const close = findBalancedAngleBrackets(text, cursor);
|
|
619
|
+
if (close < 0)
|
|
620
|
+
return cursor;
|
|
621
|
+
cursor = close + 1;
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
if (ch === "(") {
|
|
625
|
+
const balanced = findBalancedParentheses(text, cursor);
|
|
626
|
+
if (!balanced)
|
|
627
|
+
return cursor;
|
|
628
|
+
cursor = balanced.end;
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
if (ch === ",") {
|
|
632
|
+
cursor = skipWhitespaceAndComments(text, cursor + 1);
|
|
633
|
+
continue;
|
|
558
634
|
}
|
|
635
|
+
if (/\s/.test(ch)) {
|
|
636
|
+
cursor = skipWhitespaceAndComments(text, cursor);
|
|
637
|
+
const next = readIdentifier(text, cursor);
|
|
638
|
+
if (next && (next.name === "extends" || next.name === "implements"))
|
|
639
|
+
break;
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
cursor += 1;
|
|
559
643
|
}
|
|
560
644
|
}
|
|
561
|
-
return null;
|
|
562
645
|
}
|
|
563
646
|
function functionSuffixStartsAfterParams(text, closeParenIndex) {
|
|
564
647
|
return /^\s*(?::|[{;])/.test(text.slice(closeParenIndex + 1));
|
|
@@ -622,45 +705,231 @@ function arrowSuffixStartsAfterParams(text, closeParenIndex) {
|
|
|
622
705
|
}
|
|
623
706
|
return false;
|
|
624
707
|
}
|
|
625
|
-
function
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
708
|
+
function lineRangeAt(text, index, startLine) {
|
|
709
|
+
const line = startLine + countNewlines(text.slice(0, index));
|
|
710
|
+
return {
|
|
711
|
+
start: { line, column: 1 },
|
|
712
|
+
end: { line, column: 1 },
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
function findConstructorParamCount(classBodyInner) {
|
|
716
|
+
let depth = 0;
|
|
717
|
+
let quote = null;
|
|
718
|
+
let escaped = false;
|
|
719
|
+
for (let index = 0; index < classBodyInner.length; index += 1) {
|
|
720
|
+
const ch = classBodyInner[index];
|
|
721
|
+
if (!ch)
|
|
722
|
+
continue;
|
|
723
|
+
if (quote) {
|
|
724
|
+
if (escaped) {
|
|
725
|
+
escaped = false;
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
if (ch === "\\") {
|
|
729
|
+
escaped = true;
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
if (ch === quote)
|
|
733
|
+
quote = null;
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
if (ch === '"' || ch === "'" || ch === "`") {
|
|
737
|
+
quote = ch;
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
if (ch === "{") {
|
|
741
|
+
depth += 1;
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
if (ch === "}") {
|
|
745
|
+
if (depth)
|
|
746
|
+
depth -= 1;
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
if (depth !== 0)
|
|
750
|
+
continue;
|
|
751
|
+
if (classBodyInner.startsWith("constructor", index) &&
|
|
752
|
+
!JAVASCRIPT_IDENTIFIER_PART_PATTERN.test(classBodyInner[index - 1] ?? "")) {
|
|
753
|
+
const cursor = skipWhitespaceAndComments(classBodyInner, index + "constructor".length);
|
|
754
|
+
if (classBodyInner[cursor] !== "(")
|
|
755
|
+
continue;
|
|
756
|
+
const params = findBalancedParentheses(classBodyInner, cursor);
|
|
757
|
+
if (!params)
|
|
758
|
+
return null;
|
|
759
|
+
return countParams(params.inner);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
return 0;
|
|
763
|
+
}
|
|
764
|
+
function tryParseExportedFunction(text, index, hunkIndex, startLine, isDefault) {
|
|
765
|
+
let cursor = skipWhitespaceAndComments(text, index);
|
|
766
|
+
const maybeAsync = readIdentifier(text, cursor);
|
|
767
|
+
if (maybeAsync?.name === "async") {
|
|
768
|
+
cursor = skipWhitespaceAndComments(text, maybeAsync.end);
|
|
769
|
+
}
|
|
770
|
+
const keyword = readIdentifier(text, cursor);
|
|
771
|
+
if (keyword?.name !== "function")
|
|
772
|
+
return null;
|
|
773
|
+
cursor = skipWhitespaceAndComments(text, keyword.end);
|
|
774
|
+
if (text[cursor] === "*")
|
|
775
|
+
cursor = skipWhitespaceAndComments(text, cursor + 1);
|
|
776
|
+
const name = readIdentifier(text, cursor);
|
|
777
|
+
if (name) {
|
|
778
|
+
cursor = name.end;
|
|
779
|
+
}
|
|
780
|
+
else if (!isDefault) {
|
|
781
|
+
return null;
|
|
782
|
+
}
|
|
783
|
+
const exportName = name?.name ?? "default";
|
|
784
|
+
cursor = skipOptionalGenerics(text, cursor);
|
|
785
|
+
cursor = skipWhitespaceAndComments(text, cursor);
|
|
786
|
+
if (text[cursor] !== "(")
|
|
787
|
+
return null;
|
|
788
|
+
const params = findBalancedParentheses(text, cursor);
|
|
789
|
+
if (!params || !functionSuffixStartsAfterParams(text, params.end - 1))
|
|
790
|
+
return null;
|
|
791
|
+
return {
|
|
792
|
+
signature: {
|
|
793
|
+
name: exportName,
|
|
794
|
+
paramCount: countParams(params.inner),
|
|
631
795
|
hunkIndex,
|
|
632
|
-
line:
|
|
633
|
-
}
|
|
796
|
+
line: lineRangeAt(text, index, startLine).start.line,
|
|
797
|
+
},
|
|
798
|
+
end: params.end,
|
|
634
799
|
};
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
800
|
+
}
|
|
801
|
+
function tryParseExportedArrow(text, index, hunkIndex, startLine) {
|
|
802
|
+
let cursor = skipWhitespaceAndComments(text, index);
|
|
803
|
+
const binding = readIdentifier(text, cursor);
|
|
804
|
+
if (binding?.name !== "const" && binding?.name !== "let" && binding?.name !== "var")
|
|
805
|
+
return null;
|
|
806
|
+
cursor = skipWhitespaceAndComments(text, binding.end);
|
|
807
|
+
const name = readIdentifier(text, cursor);
|
|
808
|
+
if (!name)
|
|
809
|
+
return null;
|
|
810
|
+
cursor = skipWhitespaceAndComments(text, name.end);
|
|
811
|
+
if (text[cursor] !== "=")
|
|
812
|
+
return null;
|
|
813
|
+
cursor = skipWhitespaceAndComments(text, cursor + 1);
|
|
814
|
+
const maybeAsync = readIdentifier(text, cursor);
|
|
815
|
+
if (maybeAsync?.name === "async") {
|
|
816
|
+
cursor = skipWhitespaceAndComments(text, maybeAsync.end);
|
|
817
|
+
}
|
|
818
|
+
cursor = skipOptionalGenerics(text, cursor);
|
|
819
|
+
cursor = skipWhitespaceAndComments(text, cursor);
|
|
820
|
+
if (text[cursor] === "(") {
|
|
821
|
+
const params = findBalancedParentheses(text, cursor);
|
|
822
|
+
if (!params || !arrowSuffixStartsAfterParams(text, params.end - 1))
|
|
823
|
+
return null;
|
|
824
|
+
return {
|
|
825
|
+
signature: {
|
|
826
|
+
name: name.name,
|
|
827
|
+
paramCount: countParams(params.inner),
|
|
828
|
+
hunkIndex,
|
|
829
|
+
line: lineRangeAt(text, index, startLine).start.line,
|
|
830
|
+
},
|
|
831
|
+
end: params.end,
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
const single = readIdentifier(text, cursor);
|
|
835
|
+
if (!single)
|
|
836
|
+
return null;
|
|
837
|
+
cursor = skipWhitespaceAndComments(text, single.end);
|
|
838
|
+
if (!(text[cursor] === "=" && text[cursor + 1] === ">"))
|
|
839
|
+
return null;
|
|
840
|
+
return {
|
|
841
|
+
signature: {
|
|
842
|
+
name: name.name,
|
|
660
843
|
paramCount: 1,
|
|
661
844
|
hunkIndex,
|
|
662
|
-
line:
|
|
663
|
-
}
|
|
845
|
+
line: lineRangeAt(text, index, startLine).start.line,
|
|
846
|
+
},
|
|
847
|
+
end: cursor + 2,
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
function tryParseExportedClass(text, index, hunkIndex, startLine, isDefault) {
|
|
851
|
+
let cursor = skipWhitespaceAndComments(text, index);
|
|
852
|
+
const maybeAbstract = readIdentifier(text, cursor);
|
|
853
|
+
if (maybeAbstract?.name === "abstract") {
|
|
854
|
+
cursor = skipWhitespaceAndComments(text, maybeAbstract.end);
|
|
855
|
+
}
|
|
856
|
+
const keyword = readIdentifier(text, cursor);
|
|
857
|
+
if (keyword?.name !== "class")
|
|
858
|
+
return null;
|
|
859
|
+
cursor = skipWhitespaceAndComments(text, keyword.end);
|
|
860
|
+
const name = readIdentifier(text, cursor);
|
|
861
|
+
let exportName = isDefault ? "default" : name?.name;
|
|
862
|
+
if (name) {
|
|
863
|
+
exportName = isDefault ? name.name : name.name;
|
|
864
|
+
cursor = name.end;
|
|
865
|
+
}
|
|
866
|
+
else if (!isDefault) {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
cursor = skipOptionalGenerics(text, cursor);
|
|
870
|
+
cursor = skipHeritageClause(text, cursor);
|
|
871
|
+
cursor = skipWhitespaceAndComments(text, cursor);
|
|
872
|
+
if (text[cursor] !== "{")
|
|
873
|
+
return null;
|
|
874
|
+
const body = findBalancedBraces(text, cursor);
|
|
875
|
+
if (!body)
|
|
876
|
+
return null;
|
|
877
|
+
const paramCount = findConstructorParamCount(body.inner);
|
|
878
|
+
if (paramCount === null)
|
|
879
|
+
return null;
|
|
880
|
+
return {
|
|
881
|
+
signature: {
|
|
882
|
+
name: exportName ?? "default",
|
|
883
|
+
paramCount,
|
|
884
|
+
hunkIndex,
|
|
885
|
+
line: lineRangeAt(text, index, startLine).start.line,
|
|
886
|
+
},
|
|
887
|
+
end: body.end,
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function collectExportSignaturesFromText(text, hunkIndex, startLine) {
|
|
891
|
+
const output = [];
|
|
892
|
+
const scanText = maskJsLikeCommentsAndStrings(text);
|
|
893
|
+
let index = 0;
|
|
894
|
+
while (index < scanText.length) {
|
|
895
|
+
const exportAt = scanText.indexOf("export", index);
|
|
896
|
+
if (exportAt < 0)
|
|
897
|
+
break;
|
|
898
|
+
const before = exportAt === 0 ? "" : (scanText[exportAt - 1] ?? "");
|
|
899
|
+
const after = scanText[exportAt + "export".length] ?? "";
|
|
900
|
+
if ((before && JAVASCRIPT_IDENTIFIER_PART_PATTERN.test(before)) ||
|
|
901
|
+
(after && JAVASCRIPT_IDENTIFIER_PART_PATTERN.test(after))) {
|
|
902
|
+
index = exportAt + "export".length;
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
let cursor = skipWhitespaceAndComments(scanText, exportAt + "export".length);
|
|
906
|
+
while (true) {
|
|
907
|
+
const nextDecorator = skipDecorator(scanText, cursor);
|
|
908
|
+
if (nextDecorator === null)
|
|
909
|
+
break;
|
|
910
|
+
cursor = skipWhitespaceAndComments(scanText, nextDecorator);
|
|
911
|
+
}
|
|
912
|
+
let isDefault = false;
|
|
913
|
+
const maybeDefault = readIdentifier(scanText, cursor);
|
|
914
|
+
if (maybeDefault?.name === "default") {
|
|
915
|
+
isDefault = true;
|
|
916
|
+
cursor = skipWhitespaceAndComments(scanText, maybeDefault.end);
|
|
917
|
+
while (true) {
|
|
918
|
+
const nextDecorator = skipDecorator(scanText, cursor);
|
|
919
|
+
if (nextDecorator === null)
|
|
920
|
+
break;
|
|
921
|
+
cursor = skipWhitespaceAndComments(scanText, nextDecorator);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
const parsed = tryParseExportedFunction(scanText, cursor, hunkIndex, startLine, isDefault) ??
|
|
925
|
+
tryParseExportedClass(scanText, cursor, hunkIndex, startLine, isDefault) ??
|
|
926
|
+
(!isDefault ? tryParseExportedArrow(scanText, cursor, hunkIndex, startLine) : null);
|
|
927
|
+
if (parsed) {
|
|
928
|
+
output.push(parsed.signature);
|
|
929
|
+
index = parsed.end;
|
|
930
|
+
continue;
|
|
931
|
+
}
|
|
932
|
+
index = exportAt + "export".length;
|
|
664
933
|
}
|
|
665
934
|
return output;
|
|
666
935
|
}
|
|
@@ -722,11 +991,16 @@ function detectExportSignatureChanges(change) {
|
|
|
722
991
|
const output = [];
|
|
723
992
|
for (const removedSig of removed) {
|
|
724
993
|
const matched = bestAddedMatchForRemoved(removedSig);
|
|
994
|
+
const range = {
|
|
995
|
+
start: { line: removedSig.line, column: 1 },
|
|
996
|
+
end: { line: removedSig.line, column: 1 },
|
|
997
|
+
};
|
|
725
998
|
if (matched && matched.paramCount !== removedSig.paramCount) {
|
|
726
999
|
output.push({
|
|
727
1000
|
name: removedSig.name,
|
|
728
1001
|
details: `Exported function signature changed from ${removedSig.paramCount} parameter(s) to ${matched.paramCount}. This is likely a breaking API change.`,
|
|
729
1002
|
confidence: "high",
|
|
1003
|
+
range,
|
|
730
1004
|
});
|
|
731
1005
|
continue;
|
|
732
1006
|
}
|
|
@@ -740,6 +1014,7 @@ function detectExportSignatureChanges(change) {
|
|
|
740
1014
|
name: removedSig.name,
|
|
741
1015
|
details: renameDetails,
|
|
742
1016
|
confidence: "medium",
|
|
1017
|
+
range,
|
|
743
1018
|
});
|
|
744
1019
|
}
|
|
745
1020
|
}
|