Skip to content
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

fix: error logged via a console.error doesn't show as red in debug console #173366

Merged
merged 1 commit into from Feb 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/vs/workbench/contrib/debug/browser/debugSession.ts
Expand Up @@ -1074,6 +1074,8 @@ export class DebugSession implements IDebugSession {

const outputQueue = new Queue<void>();
this.rawListeners.push(this.raw.onDidOutput(async event => {
const outputSeverity = event.body.category === 'stderr' ? Severity.Error : event.body.category === 'console' ? Severity.Warning : Severity.Info;

// When a variables event is received, execute immediately to obtain the variables value #126967
if (event.body.variablesReference) {
const source = event.body.source && event.body.line ? {
Expand All @@ -1090,14 +1092,14 @@ export class DebugSession implements IDebugSession {
// For single logged variables, try to use the output if we can so
// present a better (i.e. ANSI-aware) representation of the output
if (resolved.length === 1) {
this.appendToRepl({ output: event.body.output, expression: resolved[0], sev: Severity.Info, source }, event.body.category === 'important');
this.appendToRepl({ output: event.body.output, expression: resolved[0], sev: outputSeverity, source }, event.body.category === 'important');
return;
}

resolved.forEach((child) => {
// Since we can not display multiple trees in a row, we are displaying these variables one after the other (ignoring their names)
(<any>child).name = null;
this.appendToRepl({ output: '', expression: child, sev: Severity.Info, source }, event.body.category === 'important');
this.appendToRepl({ output: '', expression: child, sev: outputSeverity, source }, event.body.category === 'important');
});
});
return;
Expand All @@ -1107,7 +1109,6 @@ export class DebugSession implements IDebugSession {
return;
}

const outputSeverity = event.body.category === 'stderr' ? Severity.Error : event.body.category === 'console' ? Severity.Warning : Severity.Info;
if (event.body.category === 'telemetry') {
// only log telemetry events from debug adapter if the debug extension provided the telemetry key
// and the user opted in telemetry
Expand Down