Skip to content

Commit

Permalink
update workspace model on location change
Browse files Browse the repository at this point in the history
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
  • Loading branch information
Colin Grant authored and kenneth-marut-work committed Apr 20, 2021
1 parent df062f6 commit f438a1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/task/src/browser/task-configuration-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export class TaskConfigurationManager {
this.workspaceService.onWorkspaceChanged(() => {
this.updateModels();
});
this.workspaceService.onWorkspaceLocationChanged(() => {
this.updateModels();
});
}

protected createModels(): void {
Expand Down Expand Up @@ -237,6 +240,7 @@ export class TaskConfigurationManager {
}));
}
this.models.set(TaskScope.Workspace, workspaceModel);
this.onDidChangeTaskConfigEmitter.fire({ scope: TaskScope.Workspace, type: FileChangeType.UPDATED });
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/task/src/browser/task-configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class TaskConfigurations implements Disposable {
}

getRawTaskConfigurations(scope?: TaskConfigurationScope): (TaskCustomization | TaskConfiguration)[] {
if (!scope) {
if (scope === undefined) {
const tasks: (TaskCustomization | TaskConfiguration)[] = [];
for (const configs of this.rawTaskConfigurations.values()) {
tasks.push(...configs);
Expand Down
2 changes: 1 addition & 1 deletion packages/task/src/browser/task-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ export class TaskService implements TaskConfigurationClient {
}

/**
* Runs a task identified by the given identifier, but only if found in the give workspace folder
* Runs a task identified by the given identifier, but only if found in the given workspace folder
*
* @param token The cache token for the user interaction in progress
* @param workspaceFolderUri The folder to restrict the search to
Expand Down

0 comments on commit f438a1e

Please sign in to comment.