mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 00:05:28 +01:00
Ensure untitled notebook document is identified for edit session. (#242002)
This commit is contained in:
+1
-1
@@ -112,7 +112,7 @@ export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifie
|
||||
const loggingService = accessor.get(INotebookLoggingService);
|
||||
const resourceRef: IReference<IResolvedNotebookEditorModel> = 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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user