Skip to content

Commit

Permalink
Suppress error pop-up for watch expression evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
polinasok committed Jun 9, 2020
1 parent cf9d16b commit bf1ce35
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import {
StackFrame,
StoppedEvent,
TerminatedEvent,
Thread
Thread,
ErrorDestination
} from 'vscode-debugadapter';
import { DebugProtocol } from 'vscode-debugprotocol';
import {
Expand Down Expand Up @@ -1586,9 +1587,18 @@ export class GoDebugSession extends LoggingDebugSession {
log('EvaluateResponse');
},
(err) => {
let dest: ErrorDestination;
// No need to repeatedly show the error pop-up when expressions
// are continiously reevaluated in the Watch panel, which
// already displays errors.
if (args.context === 'watch') {
dest = null
} else {
dest = ErrorDestination.User
}
this.sendErrorResponse(response, 2009, 'Unable to eval expression: "{e}"', {
e: err.toString()
});
}, dest);
}
);
}
Expand Down

0 comments on commit bf1ce35

Please sign in to comment.