File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/vs/workbench/contrib/chat/browser/chatEditing Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,13 @@ registerAction2(class RemoveFileFromWorkingSet extends WorkingSetAction {
109
109
for ( const uri of uris ) {
110
110
chatWidget . attachmentModel . delete ( uri . toString ( ) ) ;
111
111
}
112
+
113
+ // If there are now only suggested files in the working set, also clear those
114
+ const entries = [ ...currentEditingSession . workingSet . entries ( ) ] ;
115
+ const suggestedFiles = entries . filter ( ( [ _ , state ] ) => state . state === WorkingSetEntryState . Suggested ) ;
116
+ if ( suggestedFiles . length === entries . length && ! chatWidget . attachmentModel . attachments . find ( ( v ) => v . isFile && URI . isUri ( v . value ) ) ) {
117
+ currentEditingSession . remove ( WorkingSetEntryRemovalReason . Programmatic , ...entries . map ( ( [ uri , ] ) => uri ) ) ;
118
+ }
112
119
}
113
120
} ) ;
114
121
You can’t perform that action at this time.
0 commit comments