This repository was archived by the owner on Dec 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { DebugAdapterTracker , DebugConsole , DebugSession } from "vscode" ;
2
2
import { MessagingService } from "../service/messagingService" ;
3
3
import { DEBUG_COMMANDS } from "../view/constants" ;
4
+ import { DebuggerCommunicationServer } from "../debuggerCommunicationServer" ;
4
5
5
6
export class DebugAdapter implements DebugAdapterTracker {
6
7
private readonly console : DebugConsole | undefined ;
@@ -32,8 +33,8 @@ export class DebugAdapter implements DebugAdapterTracker {
32
33
onError ( ) {
33
34
this . messagingService . sendStartMessage ( ) ;
34
35
}
35
- // Device is always running when exiting debugging mode
36
36
onExit ( ) {
37
+ // Device is always running when exiting debugging mode
37
38
this . messagingService . sendStartMessage ( ) ;
38
39
}
39
40
}
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ export const DEBUGGER_MESSAGES = {
11
11
INPUT_CHANGED : "input_changed" ,
12
12
RECEIVED_STATE : "received_state" ,
13
13
DISCONNECT : "process_disconnect" ,
14
-
15
14
} ,
16
15
LISTENER : {
17
16
UPDATE_STATE : "updateState" ,
@@ -47,6 +46,7 @@ export class DebuggerCommunicationServer {
47
46
}
48
47
49
48
public closeConnection ( ) : void {
49
+ this . disconnectSocketIo ( ) ;
50
50
this . serverIo . close ( ) ;
51
51
this . serverHttp . close ( ) ;
52
52
console . info ( "Closing the server" ) ;
@@ -108,6 +108,9 @@ export class DebuggerCommunicationServer {
108
108
} ) ;
109
109
} ) ;
110
110
}
111
+ public disconnectSocketIo ( ) {
112
+ this . serverIo . emit ( DEBUGGER_MESSAGES . EMITTER . DISCONNECT , { } ) ;
113
+ }
111
114
112
115
private handleState ( data : any ) : void {
113
116
try {
Original file line number Diff line number Diff line change @@ -14,11 +14,7 @@ export class MessagingService {
14
14
this . currentWebviewTarget . postMessage ( { command : debugCommand } ) ;
15
15
}
16
16
}
17
- public sendDebuggerExitMessage ( ) {
18
- this . currentWebviewTarget . postMessage ( {
19
- command : DEBUGGER_MESSAGES . EMITTER . DISCONNECT ,
20
- } ) ;
21
- }
17
+
22
18
public sendStartMessage ( ) {
23
19
this . currentWebviewTarget . postMessage ( {
24
20
command : VSCODE_MESSAGES_TO_WEBVIEW . RUN_DEVICE ,
You can’t perform that action at this time.
0 commit comments