Skip to content

Don't colorize swift testing issue messages #1543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/TestExplorer/TestParsers/SwiftTestingOutputParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,18 @@ export class SwiftTestingOutputParser {

export class MessageRenderer {
/**
* Converts a swift-testing `EventMessage` to a colorized symbol and message text.
* Converts a swift-testing `EventMessage` to a printable string.
*
* @param message An event message, typically found on an `EventRecordPayload`.
* @returns A string colorized with ANSI escape codes.
* @returns A string representing the message.
*/
static render(message: EventMessage): string {
return `${SymbolRenderer.eventMessageSymbol(message.symbol)} ${MessageRenderer.colorize(message.symbol, message.text)}`;
return message.text;

// Currently VS Code doesn't support colorizing the output of issues
// shown inline in the editor. Until this is supported we just return
// the message text. Once it is supported we can use the following code:
// return `${SymbolRenderer.eventMessageSymbol(message.symbol)} ${MessageRenderer.colorize(message.symbol, message.text)}`;
}

private static colorize(symbolType: TestSymbol, message: string): string {
Expand Down