-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support diffing notebook snapshots #242042
Conversation
|
||
|
||
registerNotebookContribution(NotebookChatEditorControllerContrib.ID, NotebookChatEditorControllerContrib); | ||
registerSingleton(INotebookOriginalModelReferenceFactory, NotebookOriginalModelReferenceFactory, InstantiationType.Delayed); | ||
registerSingleton(INotebookModelSynchronizerFactory, NotebookModelSynchronizerFactory, InstantiationType.Delayed); | ||
registerSingleton(INotebookOriginalCellModelFactory, OriginalNotebookCellModelFactory, InstantiationType.Delayed); | ||
|
||
registerWorkbenchContribution2(ChatEditingNotebookFileSystemProviderContrib.ID, ChatEditingNotebookFileSystemProviderContrib, WorkbenchPhase.BlockStartup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to move this out of notebook folder into chatEditing
.
Reason is the file system provider needs to access the chat services and its best to keep them closer
return serializeSnapshot(notebook.createSnapshot({ context: SnapshotContext.Backup, outputSizeLimit, transientOptions }), transientOptions); | ||
} | ||
|
||
function restoreSnapshot(notebook: NotebookTextModel, snapshot: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved out as this file as well as Notebook File System provider need to de-serialize snapshots.
|
||
if (entries?.before && ChatEditingModifiedNotebookEntry.canHandleSnapshot(entries.before)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation for diffing in common code
Fixes https://github.com/microsoft/vscode-copilot/issues/13249
Fixes https://github.com/microsoft/vscode-copilot/issues/13540
Fixes https://github.com/microsoft/vscode-copilot/issues/13543