Skip to content

Commit 72bc3f9

Browse files
authored
fix: allow adding untitled editors to chat editing working set (microsoft#232170)
1 parent d80bb0d commit 72bc3f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatContextActions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { IEditorService } from '../../../../services/editor/common/editorService
3131
import { IExtensionService, isProposedApiEnabled } from '../../../../services/extensions/common/extensions.js';
3232
import { IHostService } from '../../../../services/host/browser/host.js';
3333
import { VIEW_ID as SEARCH_VIEW_ID } from '../../../../services/search/common/search.js';
34+
import { UntitledTextEditorInput } from '../../../../services/untitled/common/untitledTextEditorInput.js';
3435
import { IViewsService } from '../../../../services/views/common/viewsService.js';
3536
import { FileEditorInput } from '../../../files/browser/editors/fileEditorInput.js';
3637
import { AnythingQuickAccessProvider } from '../../../search/browser/anythingQuickAccess.js';
@@ -322,7 +323,7 @@ export class AttachContextAction extends Action2 {
322323
isDynamic: true
323324
});
324325
} else if (isIOpenEditorsQuickPickItem(pick)) {
325-
for (const editor of editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput)) {
326+
for (const editor of editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput || e instanceof UntitledTextEditorInput)) {
326327
const uri = editor instanceof DiffEditorInput ? editor.modified.resource : editor.resource;
327328
if (uri) {
328329
if (chatEditingService) {
@@ -545,7 +546,7 @@ export class AttachContextAction extends Action2 {
545546
});
546547
}
547548
} else if (context.showFilesOnly) {
548-
if (editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput).length > 0) {
549+
if (editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput || e instanceof UntitledTextEditorInput).length > 0) {
549550
quickPickItems.push({
550551
kind: 'open-editors',
551552
id: 'open-editors',
@@ -606,7 +607,7 @@ export class AttachContextAction extends Action2 {
606607
}
607608

608609
if (isIOpenEditorsQuickPickItem(item)) {
609-
for (const editor of editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput)) {
610+
for (const editor of editorService.editors.filter(e => e instanceof FileEditorInput || e instanceof DiffEditorInput || e instanceof UntitledTextEditorInput)) {
610611
// There is an open editor that hasn't yet been attached to the chat
611612
if (editor.resource && !attachedContext.has(this._getFileContextId({ resource: editor.resource }))) {
612613
return true;

0 commit comments

Comments
 (0)