From e20fdf95457363caac501a20e42e34876fcd39db Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 27 Sep 2018 11:59:17 -0700 Subject: [PATCH] Signal that TS Server has loaded succesfully when any error event is received A successful error computation more or less signals that the server is ready and is more reliable than waiting for the projectUpdatedInBackground signal --- .../src/typescriptServiceClient.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 73745af9dba..a70d25330e2 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -601,6 +601,12 @@ export default class TypeScriptServiceClient extends Disposable implements IType case 'syntaxDiag': case 'semanticDiag': case 'suggestionDiag': + // This event also roughly signals that project has been loaded successfully + if (this._tsServerLoading) { + this._tsServerLoading.resolve(); + this._tsServerLoading = undefined; + } + const diagnosticEvent: Proto.DiagnosticEvent = event; if (diagnosticEvent.body && diagnosticEvent.body.diagnostics) { this._onDiagnosticsReceived.fire({ @@ -632,12 +638,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType const resources = body.openFiles.map(vscode.Uri.file); this.bufferSyncSupport.getErr(resources); } - - // This event also roughly signals that project has been loaded successfully - if (this._tsServerLoading) { - this._tsServerLoading.resolve(); - this._tsServerLoading = undefined; - } break; case 'beginInstallTypes':