diff --git a/CHANGELOG.md b/CHANGELOG.md index f20e3d1f..1ec0fdf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [4.2.1] + +### Added + +- show more progress in case of reloading workspace. + ## [4.2.0] - 2022-05-19 ### Added diff --git a/src/WorkspaceManager.ts b/src/WorkspaceManager.ts index e239e627..ff32fb1f 100644 --- a/src/WorkspaceManager.ts +++ b/src/WorkspaceManager.ts @@ -209,12 +209,21 @@ export class WorkspaceManager implements vscode.Disposable { async load(): Promise { this._executableConfig.forEach(c => c.dispose()); - await new Promise(r => setTimeout(r, 500)); // there are some race condition, this fixes it: maybe async dispose would fix it too? - - const configuration = this._getConfiguration(this.log); - const executableConfig = configuration.getExecutableConfigs(this._shared); - this._executableConfig = executableConfig; - return Promise.allSettled(executableConfig.map(x => x.load().catch(e => this.log.errorS(e)))).then(); + return vscode.window.withProgress( + { location: { viewId: 'workbench.view.extension.test' } }, + async ( + _progress: vscode.Progress<{ message?: string; increment?: number }>, + _token: vscode.CancellationToken, + ): Promise => { + await new Promise(r => setTimeout(r, 500)); // there are some race condition, this fixes it: maybe async dispose would fix it too? + + const configuration = this._getConfiguration(this.log); + const executableConfig = configuration.getExecutableConfigs(this._shared); + this._executableConfig = executableConfig; + + await Promise.allSettled(executableConfig.map(x => x.load().catch(e => this.log.errorS(e)))); + }, + ); } private _getConfiguration(log: LoggerWrapper): Configurations {