Skip to content

Commit 9ba3b41

Browse files
authored
Don't colorize swift testing issue messages (#1543)
The inline issue label in VS Code doesn't support ANSI colour codes, and so renders them verbatim. Remove these so the messages are easier to read.
1 parent dde7e1d commit 9ba3b41

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/TestExplorer/TestParsers/SwiftTestingOutputParser.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,18 @@ export class SwiftTestingOutputParser {
482482

483483
export class MessageRenderer {
484484
/**
485-
* Converts a swift-testing `EventMessage` to a colorized symbol and message text.
485+
* Converts a swift-testing `EventMessage` to a printable string.
486486
*
487487
* @param message An event message, typically found on an `EventRecordPayload`.
488-
* @returns A string colorized with ANSI escape codes.
488+
* @returns A string representing the message.
489489
*/
490490
static render(message: EventMessage): string {
491-
return `${SymbolRenderer.eventMessageSymbol(message.symbol)} ${MessageRenderer.colorize(message.symbol, message.text)}`;
491+
return message.text;
492+
493+
// Currently VS Code doesn't support colorizing the output of issues
494+
// shown inline in the editor. Until this is supported we just return
495+
// the message text. Once it is supported we can use the following code:
496+
// return `${SymbolRenderer.eventMessageSymbol(message.symbol)} ${MessageRenderer.colorize(message.symbol, message.text)}`;
492497
}
493498

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

0 commit comments

Comments
 (0)