提交 565c88f4 编写于 作者: M Matt Bierner

Use more reliable signal for ts project load complete

`telemetry` is not fired for implicit projects, while `projectsUpdatedInBackground` should always be fired. Gating this to 3.0 since I believe the event was only added recently
上级 d1dbe4d5
......@@ -319,12 +319,14 @@ export default class TypeScriptServiceClient extends Disposable implements IType
if (this._tsServerLoading) {
this._tsServerLoading.reject();
}
vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: localize('serverLoading.progress', "Initializing JS/TS language features"),
}, () => new Promise((resolve, reject) => {
this._tsServerLoading = { resolve, reject };
}));
if (this._apiVersion.gte(API.v300)) {
vscode.window.withProgress({
location: vscode.ProgressLocation.Window,
title: localize('serverLoading.progress', "Initializing JS/TS language features"),
}, () => new Promise((resolve, reject) => {
this._tsServerLoading = { resolve, reject };
}));
}
this.serviceStarted(resendModels);
......@@ -613,13 +615,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType
case 'telemetry':
const telemetryData = (event as Proto.TelemetryEvent).body;
this.dispatchTelemetryEvent(telemetryData);
// This event also roughly signals that project has been loaded successfully
if (this._tsServerLoading) {
this._tsServerLoading.resolve();
this._tsServerLoading = undefined;
}
break;
case 'projectLanguageServiceState':
......@@ -634,6 +629,12 @@ 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':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册