diff --git a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts index 145cb1a8d24..d63450e6504 100644 --- a/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts +++ b/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts @@ -112,7 +112,7 @@ export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifie const loggingService = accessor.get(INotebookLoggingService); const resourceRef: IReference = await resolver.resolve(uri); const notebook = resourceRef.object.notebook; - const originalUri = ChatEditingNotebookFileSystemProvider.getSnapshotFileURI(telemetryInfo.requestId, notebook.uri.path); + const originalUri = ChatEditingNotebookFileSystemProvider.getSnapshotFileURI(telemetryInfo.requestId, notebook.uri.scheme === Schemas.untitled ? `/${notebook.uri.path}` : notebook.uri.path); const [options, buffer] = await Promise.all([ notebookService.withNotebookDataProvider(resourceRef.object.notebook.notebookType), notebookService.createNotebookTextDocumentSnapshot(notebook.uri, SnapshotContext.Backup, CancellationToken.None).then(s => streamToBuffer(s)) diff --git a/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.ts b/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.ts index b1670958f9f..1bc15e00ae3 100644 --- a/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.ts @@ -871,6 +871,11 @@ export class NotebookService extends Disposable implements INotebookService { } hasSupportedNotebooks(resource: URI): boolean { + if (this._models.has(resource)) { + // it might be untitled + return true; + } + const contribution = this.notebookProviderInfoStore.getContributedNotebook(resource); if (!contribution.length) { return false;