File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class PowerShellProcess {
15
15
private static warnUserThreshold = 30 ;
16
16
17
17
public onExited : vscode . Event < void > ;
18
- private onExitedEmitter = new vscode . EventEmitter < void > ( ) ;
18
+ private onExitedEmitter ?: vscode . EventEmitter < void > ;
19
19
20
20
private consoleTerminal ?: vscode . Terminal ;
21
21
private consoleCloseSubscription ?: vscode . Disposable ;
@@ -31,6 +31,7 @@ export class PowerShellProcess {
31
31
private sessionFilePath : vscode . Uri ,
32
32
private sessionSettings : Settings ) {
33
33
34
+ this . onExitedEmitter = new vscode . EventEmitter < void > ( ) ;
34
35
this . onExited = this . onExitedEmitter . event ;
35
36
}
36
37
@@ -149,6 +150,9 @@ export class PowerShellProcess {
149
150
150
151
void this . deleteSessionFile ( this . sessionFilePath ) ;
151
152
153
+ this . onExitedEmitter ?. fire ( ) ;
154
+ this . onExitedEmitter = undefined ;
155
+
152
156
this . consoleTerminal ?. dispose ( ) ;
153
157
this . consoleTerminal = undefined ;
154
158
@@ -230,7 +234,6 @@ export class PowerShellProcess {
230
234
}
231
235
232
236
this . logger . writeWarning ( `PowerShell process terminated or Extension Terminal was closed, PID: ${ this . pid } ` ) ;
233
- this . onExitedEmitter . fire ( ) ;
234
237
this . dispose ( ) ;
235
238
}
236
239
}
Original file line number Diff line number Diff line change @@ -530,13 +530,13 @@ export class SessionManager implements Middleware {
530
530
this . sessionSettings ) ;
531
531
532
532
languageServerProcess . onExited (
533
- async ( ) => {
533
+ ( ) => {
534
534
LanguageClientConsumer . onLanguageClientExited ( ) ;
535
535
536
536
if ( this . sessionStatus === SessionStatus . Running
537
537
|| this . sessionStatus === SessionStatus . Busy ) {
538
538
this . setSessionStatus ( "Session Exited!" , SessionStatus . Failed ) ;
539
- await this . promptForRestart ( ) ;
539
+ void this . promptForRestart ( ) ;
540
540
}
541
541
} ) ;
542
542
You can’t perform that action at this time.
0 commit comments