diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 2c162cfe615..a1f06a3dd65 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -903,9 +903,14 @@ export default class TypeScriptServiceClient extends Disposable implements IType if (command === 'updateOpen') { // If update open has completed, consider that the project has loaded - Promise.all(executions).then(() => { + const updateOpenTask = Promise.all(executions).then(() => { this.loadingIndicator.reset(); }); + + const updateOpenArgs = (args as Proto.UpdateOpenRequestArgs); + if (updateOpenArgs.openFiles?.length === 1) { + this.loadingIndicator.startedLoadingFile(updateOpenArgs.openFiles[0].file, updateOpenTask); + } } return executions[0]!; @@ -1322,7 +1327,7 @@ function getDiagnosticsKind(event: Proto.Event) { class ServerInitializingIndicator extends Disposable { - private _task?: { project: string | undefined; resolve: () => void }; + private _task?: { project: string; resolve: () => void }; public reset(): void { if (this._task) { @@ -1334,20 +1339,30 @@ class ServerInitializingIndicator extends Disposable { /** * Signal that a project has started loading. */ - public startedLoadingProject(projectName: string | undefined): void { + public startedLoadingProject(projectName: string): void { // TS projects are loaded sequentially. Cancel existing task because it should always be resolved before // the incoming project loading task is. this.reset(); + const projectDisplayName = vscode.workspace.asRelativePath(projectName); vscode.window.withProgress({ location: vscode.ProgressLocation.Window, - title: vscode.l10n.t("Initializing JS/TS language features"), + title: vscode.l10n.t("Initializing project '{0}'", projectDisplayName), }, () => new Promise(resolve => { this._task = { project: projectName, resolve }; })); } - public finishedLoadingProject(projectName: string | undefined): void { + public startedLoadingFile(fileName: string, task: Promise): void { + if (!this._task) { + vscode.window.withProgress({ + location: vscode.ProgressLocation.Window, + title: vscode.l10n.t("Analyzing '{0}' and its dependencies", path.basename(fileName)), + }, () => task); + } + } + + public finishedLoadingProject(projectName: string): void { if (this._task && this._task.project === projectName) { this._task.resolve(); this._task = undefined;