提交 28a77d42 编写于 作者: J Johannes Rieken

declare more in INotebookEditorModel

上级 a12c7ec2
......@@ -17,6 +17,7 @@ import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/no
import { GlobPattern } from 'vs/workbench/api/common/extHost.protocol';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Schemas } from 'vs/base/common/network';
import { IRevertOptions } from 'vs/workbench/common/editor';
export enum CellKind {
Markdown = 1,
......@@ -559,10 +560,14 @@ export const NOTEBOOK_EDITOR_CURSOR_BOUNDARY = new RawContextKey<'none' | 'top'
export interface INotebookEditorModel extends IEditorModel {
viewType: string;
notebook: NotebookTextModel;
readonly onDidChangeDirty: Event<void>;
readonly resource: URI;
readonly viewType: string;
readonly notebook: NotebookTextModel;
isDirty(): boolean;
save(): Promise<boolean>;
saveAs(target: URI): Promise<boolean>;
revert(options?: IRevertOptions | undefined): Promise<void>;
}
export interface INotebookTextModelBackup {
......
......@@ -22,6 +22,7 @@ import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/no
import { CellKind, CellUri, INotebookEditorModel, IProcessedOutput, NotebookCellMetadata, INotebookKernelInfo } from 'vs/workbench/contrib/notebook/common/notebookCommon';
import { Webview } from 'vs/workbench/contrib/webview/browser/webview';
import { ICompositeCodeEditor, IEditor } from 'vs/editor/common/editorCommon';
import { NotImplementedError } from 'vs/base/common/errors';
export class TestCell extends NotebookCellTextModel {
constructor(
......@@ -246,6 +247,10 @@ export class NotebookEditorTestModel extends EditorModel implements INotebookEdi
return this._notebook.viewType;
}
get resource() {
return this._notebook.uri;
}
get notebook() {
return this._notebook;
}
......@@ -282,6 +287,14 @@ export class NotebookEditorTestModel extends EditorModel implements INotebookEdi
return false;
}
saveAs(): Promise<boolean> {
throw new NotImplementedError();
}
revert(): Promise<void> {
throw new NotImplementedError();
}
}
export function withTestNotebook(instantiationService: IInstantiationService, blukEditService: IBulkEditService, undoRedoService: IUndoRedoService, cells: [string[], string, CellKind, IProcessedOutput[], NotebookCellMetadata][], callback: (editor: TestNotebookEditor, viewModel: NotebookViewModel, textModel: NotebookTextModel) => void) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册