-
Notifications
You must be signed in to change notification settings - Fork 645
When delve fails, stop the debug sessions #774
Conversation
src/debugAdapter/goDebug.ts
Outdated
@@ -268,9 +269,11 @@ class Delve { | |||
connectClient(port, host); | |||
} | |||
}); | |||
let that = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why, but "this" in line 275 does not point to Delve object, it points to the ChildProcess which is why I had to resort to that = this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use a fat arrow function (code => { ... }
) instead of function
, then this
will be correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ya! doh! I thought I was doing just that... need to get coffee
src/debugAdapter/goDebug.ts
Outdated
@@ -268,9 +269,11 @@ class Delve { | |||
connectClient(port, host); | |||
} | |||
}); | |||
let that = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use a fat arrow function (code => { ... }
) instead of function
, then this
will be correct
@@ -388,6 +391,10 @@ class GoDebugSession extends DebugSession { | |||
this.delve.onstderr = (str: string) => { | |||
this.sendEvent(new OutputEvent(str, 'stderr')); | |||
}; | |||
this.delve.onclose = () => { | |||
this.sendErrorResponse(response, 3000, 'Failed to continue: Check the debug console for details.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 'failed to continue'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cos it matches with the other message for when the delve.connection fails?
Fixes #492