Skip to content

Commit

Permalink
master: show some progress in case reloading workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Pek committed May 21, 2022
1 parent a3cc860 commit e16eb49
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 15 additions & 6 deletions src/WorkspaceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,21 @@ export class WorkspaceManager implements vscode.Disposable {
async load(): Promise<void> {
this._executableConfig.forEach(c => c.dispose());

await new Promise<void>(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<void> => {
await new Promise<void>(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 {
Expand Down

0 comments on commit e16eb49

Please sign in to comment.