Skip to content
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

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Support diffing notebook snapshots #242042

merged 1 commit into from
Feb 26, 2025

Conversation

@DonJayamanne DonJayamanne self-assigned this Feb 26, 2025


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);
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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)) {
Copy link
Contributor Author

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

@DonJayamanne DonJayamanne marked this pull request as ready for review February 26, 2025 09:22
@vs-code-engineering vs-code-engineering bot added this to the February 2025 milestone Feb 26, 2025
@rebornix rebornix merged commit 55112f9 into main Feb 26, 2025
8 checks passed
@rebornix rebornix deleted the don/fresh-emu branch February 26, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants