diff --git a/.vscode/extensions/vscode-selfhost-test-provider/src/coverageProvider.ts b/.vscode/extensions/vscode-selfhost-test-provider/src/coverageProvider.ts index 3fff7c5b637..a1d1c162dbd 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/src/coverageProvider.ts +++ b/.vscode/extensions/vscode-selfhost-test-provider/src/coverageProvider.ts @@ -142,7 +142,7 @@ class ScriptCoverageTracker { } } -export class V8CoverageFile extends vscode.FileCoverage2 { +export class V8CoverageFile extends vscode.FileCoverage { public details: vscode.StatementCoverage[] = []; constructor( diff --git a/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json b/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json index 56d6859c3e3..e40cd7d7492 100644 --- a/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json +++ b/.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json @@ -11,7 +11,6 @@ "src/**/*", "../../../src/vscode-dts/vscode.d.ts", "../../../src/vscode-dts/vscode.proposed.testObserver.d.ts", - "../../../src/vscode-dts/vscode.proposed.testRelatedCode.d.ts", - "../../../src/vscode-dts/vscode.proposed.attributableCoverage.d.ts" + "../../../src/vscode-dts/vscode.proposed.testRelatedCode.d.ts" ] } diff --git a/src/vs/platform/extensions/common/extensionsApiProposals.ts b/src/vs/platform/extensions/common/extensionsApiProposals.ts index 27e5d94c455..1aec67707c7 100644 --- a/src/vs/platform/extensions/common/extensionsApiProposals.ts +++ b/src/vs/platform/extensions/common/extensionsApiProposals.ts @@ -16,9 +16,6 @@ const _allApiProposals = { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts', version: 2 }, - attributableCoverage: { - proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts', - }, authLearnMore: { proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts', }, diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index f8a27ed0675..6e68860da3f 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1732,7 +1732,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I DataTransferItem: extHostTypes.DataTransferItem, TestCoverageCount: extHostTypes.TestCoverageCount, FileCoverage: extHostTypes.FileCoverage, - FileCoverage2: extHostTypes.FileCoverage, StatementCoverage: extHostTypes.StatementCoverage, BranchCoverage: extHostTypes.BranchCoverage, DeclarationCoverage: extHostTypes.DeclarationCoverage, diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index f82d8654141..1cef0298f32 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -757,7 +757,6 @@ class TestRunTracker extends Disposable { const includesTests = coverage instanceof FileCoverage ? coverage.includesTests : []; if (includesTests.length) { - checkProposedApiEnabled(this.extension, 'attributableCoverage'); for (const test of includesTests) { this.ensureTestIsKnown(test); } diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 0a020cc8b65..99f37309007 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -17614,6 +17614,29 @@ declare module 'vscode' { */ loadDetailedCoverage?: (testRun: TestRun, fileCoverage: FileCoverage, token: CancellationToken) => Thenable; + /** + * An extension-provided function that provides detailed statement and + * function-level coverage for a single test in a file. This is the per-test + * sibling of {@link TestRunProfile.loadDetailedCoverage}, called only if + * a test item is provided in {@link FileCoverage.includesTests} and only + * for files where such data is reported. + * + * Often {@link TestRunProfile.loadDetailedCoverage} will be called first + * when a user opens a file, and then this method will be called if they + * drill down into specific per-test coverage information. This method + * should then return coverage data only for constructs the given test item + * executed during the test run. + * + * The {@link FileCoverage} object passed to this function is the same + * instance emitted on {@link TestRun.addCoverage} calls associated with this profile. + * + * @param testRun The test run that generated the coverage data. + * @param fileCoverage The file coverage object to load detailed coverage for. + * @param fromTestItem The test item to request coverage information for. + * @param token A cancellation token that indicates the operation should be cancelled. + */ + loadDetailedCoverageForTest?: (testRun: TestRun, fileCoverage: FileCoverage, fromTestItem: TestItem, token: CancellationToken) => Thenable; + /** * Deletes the run profile. */ @@ -18207,6 +18230,13 @@ declare module 'vscode' { */ declarationCoverage?: TestCoverageCount; + /** + * A list of {@link TestItem test cases} that generated coverage in this + * file. If set, then {@link TestRunProfile.loadDetailedCoverageForTest} + * should also be defined in order to retrieve detailed coverage information. + */ + includesTests?: TestItem[]; + /** * Creates a {@link FileCoverage} instance with counts filled in from * the coverage details. @@ -18222,12 +18252,14 @@ declare module 'vscode' { * used to represent line coverage. * @param branchCoverage Branch coverage information * @param declarationCoverage Declaration coverage information + * @param includesTests Test cases included in this coverage report, see {@link includesTests} */ constructor( uri: Uri, statementCoverage: TestCoverageCount, branchCoverage?: TestCoverageCount, declarationCoverage?: TestCoverageCount, + includesTests?: TestItem[], ); } diff --git a/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts b/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts deleted file mode 100644 index ea8c583b032..00000000000 --- a/src/vscode-dts/vscode.proposed.attributableCoverage.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - export class FileCoverage2 extends FileCoverage { - /** - * A list of {@link TestItem test cases} that generated coverage in this - * file. If set, then {@link TestRunProfile.loadDetailedCoverageForTest} - * should also be defined in order to retrieve detailed coverage information. - */ - includesTests?: TestItem[]; - - constructor( - uri: Uri, - statementCoverage: TestCoverageCount, - branchCoverage?: TestCoverageCount, - declarationCoverage?: TestCoverageCount, - includesTests?: TestItem[], - ); - } - - export interface TestRunProfile { - /** - * An extension-provided function that provides detailed statement and - * function-level coverage for a single test in a file. This is the per-test - * sibling of {@link TestRunProfile.loadDetailedCoverage}, called only if - * a test item is provided in {@link FileCoverage.includesTests} and only - * for files where such data is reported. - * - * Often {@link TestRunProfile.loadDetailedCoverage} will be called first - * when a user opens a file, and then this method will be called if they - * drill down into specific per-test coverage information. This method - * should then return coverage data only for constructs the given test item - * executed during the test run. - * - * The {@link FileCoverage} object passed to this function is the same - * instance emitted on {@link TestRun.addCoverage} calls associated with this profile. - * - * @param testRun The test run that generated the coverage data. - * @param fileCoverage The file coverage object to load detailed coverage for. - * @param fromTestItem The test item to request coverage information for. - * @param token A cancellation token that indicates the operation should be cancelled. - */ - loadDetailedCoverageForTest?: (testRun: TestRun, fileCoverage: FileCoverage, fromTestItem: TestItem, token: CancellationToken) => Thenable; - } -}