mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Add extra guard on restarting TS server on fatal crash
This commit is contained in:
parent
6ff3d9c899
commit
3c030d7014
|
@ -109,6 +109,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
private lastStart: number;
|
||||
private numberRestarts: number;
|
||||
private isRestarting: boolean = false;
|
||||
private hasServerFatallyCrashedTooManyTimes = false;
|
||||
private readonly loadingIndicator = new ServerInitializingIndicator();
|
||||
|
||||
public readonly telemetryReporter: TelemetryReporter;
|
||||
|
@ -306,7 +307,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
|
||||
private token: number = 0;
|
||||
private startService(resendModels: boolean = false): ServerState.State {
|
||||
if (this.isDisposed) {
|
||||
if (this.isDisposed || this.hasServerFatallyCrashedTooManyTimes) {
|
||||
return ServerState.None;
|
||||
}
|
||||
|
||||
|
@ -542,6 +543,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
if (diff < 10 * 1000 /* 10 seconds */) {
|
||||
this.lastStart = Date.now();
|
||||
startService = false;
|
||||
this.hasServerFatallyCrashedTooManyTimes = true;
|
||||
prompt = vscode.window.showErrorMessage<MyMessageItem>(
|
||||
localize('serverDiedAfterStart', 'The TypeScript language service died 5 times right after it got started. The service will not be restarted.'),
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue