From bf1ce35df8cf02e20562adb44c36c50213fbc374 Mon Sep 17 00:00:00 2001 From: Polina Sokolova Date: Tue, 9 Jun 2020 00:30:00 -0700 Subject: [PATCH 1/3] 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); } ); } From 3f528ce7adec4ba3dd7eebbb23953ea7a7d99db2 Mon Sep 17 00:00:00 2001 From: Polina Sokolova Date: Tue, 9 Jun 2020 01:29:02 -0700 Subject: [PATCH 2/3] Alphabetize imports --- src/debugAdapter/goDebug.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index 34e7d2e35f..de4e727dde 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -15,6 +15,7 @@ import kill = require('tree-kill'); import * as util from 'util'; import { DebugSession, + ErrorDestination, Handles, InitializedEvent, logger, @@ -26,8 +27,7 @@ import { StackFrame, StoppedEvent, TerminatedEvent, - Thread, - ErrorDestination + Thread } from 'vscode-debugadapter'; import { DebugProtocol } from 'vscode-debugprotocol'; import { From 9a524922e55ecbda7179749b8de330385107a319 Mon Sep 17 00:00:00 2001 From: Polina Sokolova Date: Tue, 9 Jun 2020 09:57:57 -0700 Subject: [PATCH 3/3] Make lint happy --- src/debugAdapter/goDebug.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index de4e727dde..76b1d44b82 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -1592,9 +1592,9 @@ export class GoDebugSession extends LoggingDebugSession { // are continiously reevaluated in the Watch panel, which // already displays errors. if (args.context === 'watch') { - dest = null + dest = null; } else { - dest = ErrorDestination.User + dest = ErrorDestination.User; } this.sendErrorResponse(response, 2009, 'Unable to eval expression: "{e}"', { e: err.toString()