Skip to content

Commit c19df5b

Browse files
authored
support showIcons setting in terminal completions, simple suggest widget (microsoft#235998)
support showIcons setting in terminal completions
1 parent 1bf794a commit c19df5b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/vs/workbench/services/suggest/browser/simpleSuggestWidget.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { localize } from '../../../../nls.js';
1919
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
2020
import { SuggestWidgetStatus } from '../../../../editor/contrib/suggest/browser/suggestWidgetStatus.js';
2121
import { MenuId } from '../../../../platform/actions/common/actions.js';
22+
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
2223

2324
const $ = dom.$;
2425

@@ -86,7 +87,8 @@ export class SimpleSuggestWidget extends Disposable {
8687
private readonly _persistedSize: IPersistedWidgetSizeDelegate,
8788
private readonly _getFontInfo: () => ISimpleSuggestWidgetFontInfo,
8889
options: IWorkbenchSuggestWidgetOptions,
89-
@IInstantiationService instantiationService: IInstantiationService
90+
@IInstantiationService instantiationService: IInstantiationService,
91+
@IConfigurationService configurationService: IConfigurationService,
9092
) {
9193
super();
9294

@@ -141,6 +143,9 @@ export class SimpleSuggestWidget extends Disposable {
141143
state = undefined;
142144
}));
143145

146+
const applyIconStyle = () => this.element.domNode.classList.toggle('no-icons', !configurationService.getValue('editor.suggest.showIcons'));
147+
applyIconStyle();
148+
144149
const renderer = new SimpleSuggestWidgetItemRenderer(_getFontInfo);
145150
this._register(renderer);
146151
this._listElement = dom.append(this.element.domNode, $('.tree'));
@@ -196,6 +201,11 @@ export class SimpleSuggestWidget extends Disposable {
196201
this._register(this._list.onMouseDown(e => this._onListMouseDownOrTap(e)));
197202
this._register(this._list.onTap(e => this._onListMouseDownOrTap(e)));
198203
this._register(this._list.onDidChangeSelection(e => this._onListSelection(e)));
204+
this._register(configurationService.onDidChangeConfiguration(e => {
205+
if (e.affectsConfiguration('editor.suggest.showIcons')) {
206+
applyIconStyle();
207+
}
208+
}));
199209
}
200210

201211
private _cursorPosition?: { top: number; left: number; height: number };

0 commit comments

Comments
 (0)