diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 5671d49d301..2d256281438 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -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( localize('serverDiedAfterStart', 'The TypeScript language service died 5 times right after it got started. The service will not be restarted.'), {