Skip to content

Commit 037dadc

Browse files
committed
feat: enable file decorations for chat edited files list
1 parent 2fddfda commit 037dadc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export class CollapsibleListPool extends Disposable {
182182
constructor(
183183
private _onDidChangeVisibility: Event<boolean>,
184184
private readonly menuId: MenuId | undefined,
185+
private readonly options: { enableFileDecorations?: boolean } | undefined,
185186
@IInstantiationService private readonly instantiationService: IInstantiationService,
186187
@IThemeService private readonly themeService: IThemeService,
187188
@ILabelService private readonly labelService: ILabelService,
@@ -215,7 +216,7 @@ export class CollapsibleListPool extends Disposable {
215216
'ChatListRenderer',
216217
container,
217218
new CollapsibleListDelegate(),
218-
[this.instantiationService.createInstance(CollapsibleListRenderer, resourceLabels, this.menuId)],
219+
[this.instantiationService.createInstance(CollapsibleListRenderer, resourceLabels, this.menuId, this.options)],
219220
{
220221
alwaysConsumeMouseWheel: false,
221222
accessibilityProvider: {
@@ -304,6 +305,7 @@ class CollapsibleListRenderer implements IListRenderer<IChatCollapsibleListItem,
304305
constructor(
305306
private labels: ResourceLabels,
306307
private menuId: MenuId | undefined,
308+
private options: { enableFileDecorations?: boolean } | undefined,
307309
@IThemeService private readonly themeService: IThemeService,
308310
@IChatVariablesService private readonly chatVariablesService: IChatVariablesService,
309311
@IProductService private readonly productService: IProductService,
@@ -383,7 +385,7 @@ class CollapsibleListRenderer implements IListRenderer<IChatCollapsibleListItem,
383385
templateData.label.setFile(uri, {
384386
fileKind: FileKind.FILE,
385387
// Should not have this live-updating data on a historical reference
386-
fileDecorations: { badges: false, colors: false },
388+
fileDecorations: this.options?.enableFileDecorations ? { badges: true, colors: true } : { badges: false, colors: false },
387389
range: 'range' in reference ? reference.range : undefined,
388390
title: data.options?.status?.description ?? data.title
389391
});

src/vs/workbench/contrib/chat/browser/chatInputPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
250250
}
251251
}));
252252

253-
this._chatEditsListPool = this._register(this.instantiationService.createInstance(CollapsibleListPool, this._onDidChangeVisibility.event, MenuId.ChatEditingSessionWidgetToolbar));
253+
this._chatEditsListPool = this._register(this.instantiationService.createInstance(CollapsibleListPool, this._onDidChangeVisibility.event, MenuId.ChatEditingSessionWidgetToolbar, { enableFileDecorations: true }));
254254
}
255255

256256
private setCurrentLanguageModelToDefault() {

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
156156
this._editorPool = this._register(this.instantiationService.createInstance(EditorPool, editorOptions, delegate, overflowWidgetsDomNode));
157157
this._diffEditorPool = this._register(this.instantiationService.createInstance(DiffEditorPool, editorOptions, delegate, overflowWidgetsDomNode));
158158
this._treePool = this._register(this.instantiationService.createInstance(TreePool, this._onDidChangeVisibility.event));
159-
this._contentReferencesListPool = this._register(this.instantiationService.createInstance(CollapsibleListPool, this._onDidChangeVisibility.event, undefined));
159+
this._contentReferencesListPool = this._register(this.instantiationService.createInstance(CollapsibleListPool, this._onDidChangeVisibility.event, undefined, undefined));
160160

161161
this._register(this.instantiationService.createInstance(ChatCodeBlockContentProvider));
162162
}

0 commit comments

Comments
 (0)