chat: support representing file deletions in edit sessions (#289270)

* chat: support representing file deletions in edit sessions

Add support for file deletion operations in chat editing sessions through
new ChatResponseWorkspaceEditPart. This allows agents to represent file-level
operations (deletions, creations, renames) alongside text and notebook edits.

- Adds ChatEditingDeletedFileEntry class to represent deleted files with
  proper diff display and restoration functionality
- Introduces ChatResponseWorkspaceEditPart and IChatWorkspaceEdit interfaces
  for file-level operations at the workspace level
- Implements workspace edit streaming through chat editing sessions with
  proper undo/redo support
- Adds ChatWorkspaceEditContentPart for UI rendering of file operations
- Extends chat session storage to serialize deleted file entries
- Supports both acceptance and rejection of file deletions with proper state
  management and snapshotting

Ref https://github.com/microsoft/vscode/issues/275705

(Commit message generated by Copilot)

* fix test
This commit is contained in:
Connor Peet
2026-01-21 08:37:20 -08:00
committed by GitHub
parent acb22942b0
commit 4c5bbc5c2b
22 changed files with 605 additions and 48 deletions

View File

@@ -1915,6 +1915,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
ChatResponseWarningPart: extHostTypes.ChatResponseWarningPart,
ChatResponseTextEditPart: extHostTypes.ChatResponseTextEditPart,
ChatResponseNotebookEditPart: extHostTypes.ChatResponseNotebookEditPart,
ChatResponseWorkspaceEditPart: extHostTypes.ChatResponseWorkspaceEditPart,
ChatResponseMarkdownWithVulnerabilitiesPart: extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart,
ChatResponseCommandButtonPart: extHostTypes.ChatResponseCommandButtonPart,
ChatResponseConfirmationPart: extHostTypes.ChatResponseConfirmationPart,