From bf1ce35df8cf02e20562adb44c36c50213fbc374 Mon Sep 17 00:00:00 2001 From: Polina Sokolova Date: Tue, 9 Jun 2020 00:30:00 -0700 Subject: [PATCH] Suppress error pop-up for watch expression evaluation --- src/debugAdapter/goDebug.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index 68b3257125..34e7d2e35f 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -26,7 +26,8 @@ import { StackFrame, StoppedEvent, TerminatedEvent, - Thread + Thread, + ErrorDestination } from 'vscode-debugadapter'; import { DebugProtocol } from 'vscode-debugprotocol'; import { @@ -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); } ); }