Skip to content

Commit 3781e5f

Browse files
authored
fix: don't filter suggested files from Add Files picker (microsoft#235431)
1 parent 3bb6b62 commit 3781e5f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { ISymbolQuickPickItem, SymbolsQuickAccessProvider } from '../../../searc
4343
import { SearchContext } from '../../../search/common/constants.js';
4444
import { ChatAgentLocation, IChatAgentService } from '../../common/chatAgents.js';
4545
import { ChatContextKeys } from '../../common/chatContextKeys.js';
46-
import { IChatEditingService } from '../../common/chatEditingService.js';
46+
import { IChatEditingService, WorkingSetEntryState } from '../../common/chatEditingService.js';
4747
import { IChatRequestVariableEntry } from '../../common/chatModel.js';
4848
import { ChatRequestAgentPart } from '../../common/chatParserTypes.js';
4949
import { IChatVariableData, IChatVariablesService } from '../../common/chatVariables.js';
@@ -794,8 +794,10 @@ export class AttachContextAction extends Action2 {
794794
// Avoid attaching the same context twice
795795
const attachedContext = widget.attachmentModel.getAttachmentIDs();
796796
if (chatEditingService) {
797-
for (const file of chatEditingService.currentEditingSessionObs.get()?.workingSet.keys() ?? []) {
798-
attachedContext.add(this._getFileContextId({ resource: file }));
797+
for (const [file, state] of chatEditingService.currentEditingSessionObs.get()?.workingSet.entries() ?? []) {
798+
if (state.state !== WorkingSetEntryState.Suggested) {
799+
attachedContext.add(this._getFileContextId({ resource: file }));
800+
}
799801
}
800802
}
801803

0 commit comments

Comments
 (0)