@@ -11,7 +11,7 @@ import * as Types from 'vs/base/common/types';
11
11
import { ITaskService , IWorkspaceFolderTaskResult } from 'vs/workbench/contrib/tasks/common/taskService' ;
12
12
import { IQuickPickItem , QuickPickInput , IQuickPick , IQuickInputButton , IQuickInputService } from 'vs/platform/quickinput/common/quickInput' ;
13
13
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' ;
15
15
import { Event } from 'vs/base/common/event' ;
16
16
import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
17
17
import { Codicon } from 'vs/base/common/codicons' ;
@@ -90,12 +90,14 @@ export class TaskQuickPick extends Disposable {
90
90
return icon . id ? `$(${ icon . id } ) ${ label } ` : `$(${ Codicon . tools . id } ) ${ label } ` ;
91
91
}
92
92
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 {
94
94
if ( task . configurationProperties . icon ?. color ) {
95
95
const colorTheme = themeService . getColorTheme ( ) ;
96
- createColorStyleElement ( colorTheme ) ;
96
+ const disposable = createColorStyleElement ( colorTheme ) ;
97
97
entry . iconClasses = [ getColorClass ( task . configurationProperties . icon . color ) ] ;
98
+ return disposable ;
98
99
}
100
+ return ;
99
101
}
100
102
101
103
private _createTaskEntry ( task : Task | ConfiguringTask , extraButtons : IQuickInputButton [ ] = [ ] ) : ITaskTwoLevelQuickPickEntry {
@@ -104,7 +106,10 @@ export class TaskQuickPick extends Disposable {
104
106
...extraButtons
105
107
] ;
106
108
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
+ }
108
113
return entry ;
109
114
}
110
115
0 commit comments