File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,8 @@ export default class AutoLanguageClient {
315
315
( filepath ) => this . filterChangeWatchedFiles ( filepath ) ,
316
316
this . reportBusyWhile ,
317
317
this . getServerName ( ) ,
318
- this . determineProjectPath
318
+ this . determineProjectPath ,
319
+ this . shutdownGracefully
319
320
)
320
321
this . _serverManager . startListening ( )
321
322
process . on ( "exit" , ( ) => this . exitCleanup . bind ( this ) )
@@ -988,6 +989,12 @@ export default class AutoLanguageClient {
988
989
return true
989
990
}
990
991
992
+ /**
993
+ * If this is set to `true` (the default value), the servers will shut down gracefully. If it is set to `false`, the
994
+ * servers will be killed without awaiting shutdown response.
995
+ */
996
+ protected shutdownGracefully : boolean = true
997
+
991
998
/**
992
999
* Called on language server stderr output.
993
1000
*
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ export class ServerManager {
50
50
private _changeWatchedFileFilter : ( filePath : string ) => boolean ,
51
51
private _reportBusyWhile : ReportBusyWhile ,
52
52
private _languageServerName : string ,
53
- private _determineProjectPath : ( textEditor : TextEditor ) => string | null
53
+ private _determineProjectPath : ( textEditor : TextEditor ) => string | null ,
54
+ private shutdownGracefully : boolean
54
55
) {
55
56
this . updateNormalizedProjectPaths ( )
56
57
}
@@ -212,7 +213,7 @@ export class ServerManager {
212
213
this . _activeServers . splice ( this . _activeServers . indexOf ( server ) , 1 )
213
214
this . _stoppingServers . push ( server )
214
215
server . disposable . dispose ( )
215
- if ( server . connection . isConnected ) {
216
+ if ( this . shutdownGracefully && server . connection . isConnected ) {
216
217
await server . connection . shutdown ( )
217
218
}
218
219
You can’t perform that action at this time.
0 commit comments