diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 2b0112ce1c8..5b7f7b102c4 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1525,8 +1525,7 @@ declare module 'vscode' { } export interface NotebookOutputSelector { - type: string; - subTypes?: string[]; + mimeTypes?: string[]; } export interface NotebookRenderRequest { @@ -1640,10 +1639,10 @@ declare module 'vscode' { export interface NotebookContentProvider { openNotebook(uri: Uri, openContext: NotebookDocumentOpenContext): NotebookData | Promise; + resolveNotebook(document: NotebookDocument): Promise; saveNotebook(document: NotebookDocument, cancellation: CancellationToken): Promise; saveNotebookAs(targetResource: Uri, document: NotebookDocument, cancellation: CancellationToken): Promise; readonly onDidChangeNotebook: Event; - revertNotebook(document: NotebookDocument, cancellation: CancellationToken): Promise; backupNotebook(document: NotebookDocument, context: NotebookDocumentBackupContext, cancellation: CancellationToken): Promise; kernel?: NotebookKernel; diff --git a/src/vs/workbench/api/browser/mainThreadNotebook.ts b/src/vs/workbench/api/browser/mainThreadNotebook.ts index d82c05147e7..562c464ad58 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebook.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebook.ts @@ -662,10 +662,6 @@ export class MainThreadNotebookController implements IMainNotebookController { const backupId = await this._proxy.$backup(this._viewType, uri, token); return backupId; } - - async revert(uri: URI, token: CancellationToken): Promise { - return this._proxy.$revert(this._viewType, uri, token); - } } export class MainThreadNotebookKernel implements INotebookKernelInfo { diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 076bdcea1fa..c56bd11806d 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1586,7 +1586,6 @@ export interface ExtHostNotebookShape { $executeNotebook2(kernelId: string, viewType: string, uri: UriComponents, cellHandle: number | undefined, token: CancellationToken): Promise; $saveNotebook(viewType: string, uri: UriComponents, token: CancellationToken): Promise; $saveNotebookAs(viewType: string, uri: UriComponents, target: UriComponents, token: CancellationToken): Promise; - $revert(viewType: string, uri: UriComponents, cancellation: CancellationToken): Promise; $backup(viewType: string, uri: UriComponents, cancellation: CancellationToken): Promise; $acceptDisplayOrder(displayOrder: INotebookDisplayOrder): void; $renderOutputs(uriComponents: UriComponents, id: string, request: IOutputRenderRequest): Promise | undefined>; diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index 3889752e29a..6c2379dd92e 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -666,8 +666,8 @@ export class ExtHostNotebookOutputRenderer { } matches(mimeType: string): boolean { - if (this.filter.subTypes) { - if (this.filter.subTypes.indexOf(mimeType) >= 0) { + if (this.filter.mimeTypes) { + if (this.filter.mimeTypes.indexOf(mimeType) >= 0) { return true; } } diff --git a/src/vs/workbench/contrib/notebook/browser/notebookServiceImpl.ts b/src/vs/workbench/contrib/notebook/browser/notebookServiceImpl.ts index 5c3f1d2e2dd..fae81aeb059 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookServiceImpl.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookServiceImpl.ts @@ -751,16 +751,6 @@ export class NotebookService extends Disposable implements INotebookService, ICu return; } - async revert(viewType: string, uri: URI, token: CancellationToken): Promise { - let provider = this._notebookProviders.get(viewType); - - if (provider) { - return provider.controller.revert(uri, token); - } - - return; - } - onDidReceiveMessage(viewType: string, editorId: string, message: any): void { let provider = this._notebookProviders.get(viewType); diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 8d3647f4be7..ba74d7c15e1 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -99,8 +99,7 @@ export interface INotebookDisplayOrder { } export interface INotebookMimeTypeSelector { - type: string; - subTypes?: string[]; + mimeTypes?: string[]; } export interface INotebookRendererInfo { diff --git a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts index 6c26894ecfe..29c9bff066b 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookEditorModel.ts @@ -114,12 +114,7 @@ export class NotebookEditorModel extends EditorModel implements IWorkingCopy, IN return; } - if (this._notebook.supportBackup) { - const tokenSource = new CancellationTokenSource(); - await this.notebookService.revert(this.viewType, this.resource, tokenSource.token); - } else { - await this.load({ forceReadFromDisk: true }); - } + await this.load({ forceReadFromDisk: true }); this._dirty = false; this._onDidChangeDirty.fire(); diff --git a/src/vs/workbench/contrib/notebook/common/notebookService.ts b/src/vs/workbench/contrib/notebook/common/notebookService.ts index 4826265b7f7..b1d5333d626 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookService.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookService.ts @@ -27,7 +27,6 @@ export interface IMainNotebookController { save(uri: URI, token: CancellationToken): Promise; saveAs(uri: URI, target: URI, token: CancellationToken): Promise; backup(uri: URI, token: CancellationToken): Promise; - revert(uri: URI, token: CancellationToken): Promise; } export interface INotebookService { @@ -67,7 +66,6 @@ export interface INotebookService { save(viewType: string, resource: URI, token: CancellationToken): Promise; saveAs(viewType: string, resource: URI, target: URI, token: CancellationToken): Promise; backup(viewType: string, uri: URI, token: CancellationToken): Promise; - revert(viewType: string, uri: URI, token: CancellationToken): Promise; onDidReceiveMessage(viewType: string, editorId: string, message: any): void; setToCopy(items: NotebookCellTextModel[]): void; getToCopy(): NotebookCellTextModel[] | undefined;