mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-23 08:39:54 +01:00
💄
This commit is contained in:
+3
-3
@@ -154,7 +154,7 @@ suite('Notebook Clipboard', () => {
|
||||
override getToCopy() {
|
||||
return {
|
||||
items: [
|
||||
editor.viewModel.cellAt(0)!.model
|
||||
viewModel.cellAt(0)!.model
|
||||
],
|
||||
isCopy: true
|
||||
};
|
||||
@@ -196,11 +196,11 @@ suite('Notebook Clipboard', () => {
|
||||
|
||||
viewModel.updateSelectionsState({ kind: SelectionStateType.Index, focus: { start: 0, end: 1 }, selections: [{ start: 0, end: 2 }] }, 'model');
|
||||
assert.ok(runCopyCells(accessor, editor, viewModel.cellAt(0)));
|
||||
assert.deepStrictEqual(_toCopy, [editor.viewModel.cellAt(0)!.model, editor.viewModel.cellAt(1)!.model]);
|
||||
assert.deepStrictEqual(_toCopy, [viewModel.cellAt(0)!.model, viewModel.cellAt(1)!.model]);
|
||||
|
||||
assert.ok(runCopyCells(accessor, editor, viewModel.cellAt(2)));
|
||||
assert.deepStrictEqual(_toCopy.length, 1);
|
||||
assert.deepStrictEqual(_toCopy, [editor.viewModel.cellAt(2)!.model]);
|
||||
assert.deepStrictEqual(_toCopy, [viewModel.cellAt(2)!.model]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ suite('Notebook Find', () => {
|
||||
|
||||
editor.textModel.applyEdits([{
|
||||
editType: CellEditType.Replace, index: 3, count: 0, cells: [
|
||||
new TestCell(editor.viewModel.viewType, 3, '# next paragraph 1', 'markdown', CellKind.Code, [], accessor.get(IModeService)),
|
||||
new TestCell(viewModel.viewType, 3, '# next paragraph 1', 'markdown', CellKind.Code, [], accessor.get(IModeService)),
|
||||
]
|
||||
}], true, undefined, () => undefined, undefined, true);
|
||||
assert.strictEqual(editor.textModel.length, 4);
|
||||
@@ -184,7 +184,7 @@ suite('Notebook Find', () => {
|
||||
model.find(false);
|
||||
model.find(false);
|
||||
assert.strictEqual(model.currentMatch, 2);
|
||||
(editor.viewModel.viewCells[1].textBuffer as ITextBuffer).applyEdits([
|
||||
(viewModel.viewCells[1].textBuffer as ITextBuffer).applyEdits([
|
||||
new ValidAnnotatedEditOperation(null, new Range(1, 1, 1, 14), '', false, false, false)
|
||||
], false, true);
|
||||
// cell content updates, recompute
|
||||
|
||||
@@ -211,7 +211,7 @@ export class CellOutputElement extends Disposable {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const notebookTextModel = this.notebookEditor.viewModel.notebookDocument;
|
||||
const notebookTextModel = this.notebookEditor.textModel;
|
||||
|
||||
const [mimeTypes, pick] = this.output.resolveMimeTypes(notebookTextModel, this.notebookEditor.activeKernel?.preloadProvides);
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ suite('CellOperations', () => {
|
||||
],
|
||||
async (editor, viewModel, accessor) => {
|
||||
viewModel.updateSelectionsState({ kind: SelectionStateType.Index, focus: { start: 2, end: 3 }, selections: [{ start: 1, end: 3 }] });
|
||||
const ret = await joinNotebookCells(editor.viewModel, { start: 1, end: 3 }, 'above');
|
||||
const ret = await joinNotebookCells(viewModel, { start: 1, end: 3 }, 'above');
|
||||
assert.strictEqual(ret?.edits.length, 2);
|
||||
assert.deepStrictEqual(ret?.edits[0], new ResourceTextEdit(viewModel.cellAt(0)!.uri, {
|
||||
range: new Range(1, 11, 1, 11), text: viewModel.cellAt(1)!.textBuffer.getEOL() + 'var b = 2;' + viewModel.cellAt(2)!.textBuffer.getEOL() + 'var c = 3;'
|
||||
|
||||
@@ -46,7 +46,7 @@ suite('NotebookEditorKernelManager', () => {
|
||||
});
|
||||
|
||||
async function withTestNotebook(cells: [string, string, CellKind, IOutputDto[], NotebookCellMetadata][], callback: (viewModel: NotebookViewModel, textModel: NotebookTextModel) => void | Promise<void>) {
|
||||
return _withTestNotebook(cells, (editor) => callback(editor.viewModel, editor.viewModel.notebookDocument));
|
||||
return _withTestNotebook(cells, (editor, viewModel) => callback(viewModel, viewModel.notebookDocument));
|
||||
}
|
||||
|
||||
// test('ctor', () => {
|
||||
|
||||
@@ -197,6 +197,9 @@ function _createTestNotebookEditor(instantiationService: TestInstantiationServic
|
||||
override notebookOptions = notebookOptions;
|
||||
override onDidChangeModel: Event<NotebookTextModel | undefined> = new Emitter<NotebookTextModel | undefined>().event;
|
||||
override get viewModel() { return viewModel; }
|
||||
override _getViewModel(): NotebookViewModel {
|
||||
return viewModel;
|
||||
}
|
||||
override get textModel() { return viewModel.notebookDocument; }
|
||||
override hasModel(): this is IActiveNotebookEditor {
|
||||
return !!this.viewModel;
|
||||
|
||||
Reference in New Issue
Block a user