Skip to content

Commit 2a3f6d2

Browse files
ekazakov14ekazakov14
andauthored
Recover from shutdown timeout in tryRestart (#3602)
Co-authored-by: ekazakov14 <yarnstart@yandex-team.ru>
1 parent 14a12d0 commit 2a3f6d2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

_extension/src/client.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,13 @@ export class Client implements vscode.Disposable {
278278

279279
this.isInitialized = false;
280280
this.outputChannel.appendLine(`Restarting language server...`);
281-
await this.client.restart();
281+
try {
282+
await this.client.restart();
283+
}
284+
catch (err) {
285+
this.outputChannel.appendLine(`Graceful shutdown failed, forcing restart: ${err}`);
286+
await this.client.start();
287+
}
282288
return true;
283289
}
284290

0 commit comments

Comments
 (0)