Skip to content

Commit ef72141

Browse files
authored
testing: finalize test message stack trace API (#225517)
Closes #214488
1 parent ffee425 commit ef72141

File tree

7 files changed

+35
-45
lines changed

7 files changed

+35
-45
lines changed

.vscode/extensions/vscode-selfhost-test-provider/src/testOutputScanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export async function scanTestOutput(
290290
enqueueExitBlocker(
291291
(async () => {
292292
const stackInfo = await deriveStackLocations(store, rawErr, tcase!);
293-
let message: vscode.TestMessage2;
293+
let message: vscode.TestMessage;
294294

295295
if (hasDiff) {
296296
message = new vscode.TestMessage(tryMakeMarkdown(err));

.vscode/extensions/vscode-selfhost-test-provider/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"src/**/*",
1212
"../../../src/vscode-dts/vscode.d.ts",
1313
"../../../src/vscode-dts/vscode.proposed.testObserver.d.ts",
14-
"../../../src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts",
1514
"../../../src/vscode-dts/vscode.proposed.testRelatedCode.d.ts",
1615
"../../../src/vscode-dts/vscode.proposed.attributableCoverage.d.ts"
1716
]

src/vs/platform/extensions/common/extensionsApiProposals.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,6 @@ const _allApiProposals = {
356356
terminalSelection: {
357357
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts',
358358
},
359-
testMessageStackTrace: {
360-
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts',
361-
},
362359
testObserver: {
363360
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts',
364361
},

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
17701770
TestResultState: extHostTypes.TestResultState,
17711771
TestRunRequest: extHostTypes.TestRunRequest,
17721772
TestMessage: extHostTypes.TestMessage,
1773-
TestMessage2: extHostTypes.TestMessage,
17741773
TestMessageStackFrame: extHostTypes.TestMessageStackFrame,
17751774
TestTag: extHostTypes.TestTag,
17761775
TestRunProfileKind: extHostTypes.TestRunProfileKind,

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ export namespace TestMessage {
18931893
actual: message.actualOutput,
18941894
contextValue: message.contextValue,
18951895
location: message.location && ({ range: Range.from(message.location.range), uri: message.location.uri }),
1896-
stackTrace: (message as vscode.TestMessage2).stackTrace?.map(s => ({
1896+
stackTrace: message.stackTrace?.map(s => ({
18971897
label: s.label,
18981898
position: s.position && Position.from(s.position),
18991899
uri: s.uri && URI.revive(s.uri).toJSON(),

src/vscode-dts/vscode.d.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18093,6 +18093,34 @@ declare module 'vscode' {
1809318093
error: string | MarkdownString | undefined;
1809418094
}
1809518095

18096+
/**
18097+
* A stack frame found in the {@link TestMessage.stackTrace}.
18098+
*/
18099+
export class TestMessageStackFrame {
18100+
/**
18101+
* The location of this stack frame. This should be provided as a URI if the
18102+
* location of the call frame can be accessed by the editor.
18103+
*/
18104+
uri?: Uri;
18105+
18106+
/**
18107+
* Position of the stack frame within the file.
18108+
*/
18109+
position?: Position;
18110+
18111+
/**
18112+
* The name of the stack frame, typically a method or function name.
18113+
*/
18114+
label: string;
18115+
18116+
/**
18117+
* @param label The name of the stack frame
18118+
* @param file The file URI of the stack frame
18119+
* @param position The position of the stack frame within the file
18120+
*/
18121+
constructor(label: string, uri?: Uri, position?: Position);
18122+
}
18123+
1809618124
/**
1809718125
* Message associated with the test state. Can be linked to a specific
1809818126
* source range -- useful for assertion failures, for example.
@@ -18149,6 +18177,11 @@ declare module 'vscode' {
1814918177
*/
1815018178
contextValue?: string;
1815118179

18180+
/**
18181+
* The stack trace associated with the message or failure.
18182+
*/
18183+
stackTrace?: TestMessageStackFrame[];
18184+
1815218185
/**
1815318186
* Creates a new TestMessage that will present as a diff in the editor.
1815418187
* @param message Message to display to the user.

src/vscode-dts/vscode.proposed.testMessageStackTrace.d.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)