Skip to content

Commit 623595b

Browse files
committed
1 parent d42fad2 commit 623595b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/vs/workbench/contrib/tasks/browser/taskQuickPick.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as Types from 'vs/base/common/types';
1111
import { ITaskService, IWorkspaceFolderTaskResult } from 'vs/workbench/contrib/tasks/common/taskService';
1212
import { IQuickPickItem, QuickPickInput, IQuickPick, IQuickInputButton, IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
1313
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
14-
import { Disposable } from 'vs/base/common/lifecycle';
14+
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
1515
import { Event } from 'vs/base/common/event';
1616
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
1717
import { Codicon } from 'vs/base/common/codicons';
@@ -90,12 +90,14 @@ export class TaskQuickPick extends Disposable {
9090
return icon.id ? `$(${icon.id}) ${label}` : `$(${Codicon.tools.id}) ${label}`;
9191
}
9292

93-
public static applyColorStyles(task: Task | ConfiguringTask, entry: TaskQuickPickEntryType | ITaskTwoLevelQuickPickEntry, themeService: IThemeService): void {
93+
public static applyColorStyles(task: Task | ConfiguringTask, entry: TaskQuickPickEntryType | ITaskTwoLevelQuickPickEntry, themeService: IThemeService): IDisposable | undefined {
9494
if (task.configurationProperties.icon?.color) {
9595
const colorTheme = themeService.getColorTheme();
96-
createColorStyleElement(colorTheme);
96+
const disposable = createColorStyleElement(colorTheme);
9797
entry.iconClasses = [getColorClass(task.configurationProperties.icon.color)];
98+
return disposable;
9899
}
100+
return;
99101
}
100102

101103
private _createTaskEntry(task: Task | ConfiguringTask, extraButtons: IQuickInputButton[] = []): ITaskTwoLevelQuickPickEntry {
@@ -104,7 +106,10 @@ export class TaskQuickPick extends Disposable {
104106
...extraButtons
105107
];
106108
const entry: ITaskTwoLevelQuickPickEntry = { label: TaskQuickPick.getTaskLabelWithIcon(task, this._guessTaskLabel(task)), description: this._taskService.getTaskDescription(task), task, detail: this._showDetail() ? task.configurationProperties.detail : undefined, buttons };
107-
TaskQuickPick.applyColorStyles(task, entry, this._themeService);
109+
const disposable = TaskQuickPick.applyColorStyles(task, entry, this._themeService);
110+
if (disposable) {
111+
this._register(disposable);
112+
}
108113
return entry;
109114
}
110115

0 commit comments

Comments
 (0)