Skip to content

Commit

Permalink
Add the display of configured tasks when executing 'configure tasks...'
Browse files Browse the repository at this point in the history
Fixed #5468

Added `configured` tasks when executing the command and menu item for `configure tasks...`.
Previously, only `provided` tasks were displayed which is inconsistent with vscode, and our
own implementation present in the command `run task...` which permits configuring all tasks using the `configure` icon. In order to be consistent, and align with vscode and our own
implementations, `configured` tasks should also be added to the menu.

Triggering the `configure` for any given task opens the `task.json`.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Aug 1, 2019
1 parent 6e52f97 commit d87ecf2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/task/src/browser/quick-open-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,16 @@ export class QuickOpenTask implements QuickOpenModel, QuickOpenHandler {
this.items = [];
this.actionProvider = undefined;

const configuredTasks = await this.taskService.getConfiguredTasks();
const providedTasks = await this.taskService.getProvidedTasks();
if (!providedTasks.length) {
if (!configuredTasks && !providedTasks.length) {
this.items.push(new QuickOpenItem({
label: 'No tasks found',
run: (_mode: QuickOpenMode): boolean => false
}));
}

providedTasks.forEach(task => {
[...configuredTasks, ...providedTasks].forEach(task => {
this.items.push(new TaskConfigureQuickOpenItem(task, this.taskService, this.labelProvider));
});

Expand Down Expand Up @@ -321,7 +322,7 @@ export class TaskConfigureQuickOpenItem extends QuickOpenGroupItem {
}

getLabel(): string {
return `${this.task._source}: ${this.task.label}`;
return `${this.task.type}: ${this.task.label}`;
}

getDescription(): string {
Expand Down

0 comments on commit d87ecf2

Please sign in to comment.