Skip to content

Commit f24856d

Browse files
committed
update notebookcommon
1 parent e3d1bab commit f24856d

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { VSBuffer } from 'vs/base/common/buffer';
77
import { CancellationToken } from 'vs/base/common/cancellation';
8-
import { IDiffResult, ISequence } from 'vs/base/common/diff/diff';
8+
import { IDiffResult } from 'vs/base/common/diff/diff';
99
import { Event } from 'vs/base/common/event';
1010
import * as glob from 'vs/base/common/glob';
1111
import { Iterable } from 'vs/base/common/iterator';
@@ -763,7 +763,7 @@ export interface INotebookEditorModel extends IEditorModel {
763763
readonly onDidChangeReadonly: Event<void>;
764764
readonly resource: URI;
765765
readonly viewType: string;
766-
readonly notebook: NotebookTextModel | undefined;
766+
readonly notebook: INotebookTextModel | undefined;
767767
isResolved(): this is IResolvedNotebookEditorModel;
768768
isDirty(): boolean;
769769
isReadonly(): boolean;
@@ -857,20 +857,6 @@ export interface INotebookCellStatusBarItemProvider {
857857
provideCellStatusBarItems(uri: URI, index: number, token: CancellationToken): Promise<INotebookCellStatusBarItemList | undefined>;
858858
}
859859

860-
export class CellSequence implements ISequence {
861-
862-
constructor(readonly textModel: NotebookTextModel) {
863-
}
864-
865-
getElements(): string[] | number[] | Int32Array {
866-
const hashValue = new Int32Array(this.textModel.cells.length);
867-
for (let i = 0; i < this.textModel.cells.length; i++) {
868-
hashValue[i] = this.textModel.cells[i].getHashValue();
869-
}
870-
871-
return hashValue;
872-
}
873-
}
874860

875861
export interface INotebookDiffResult {
876862
cellsDiff: IDiffResult;

src/vs/workbench/contrib/notebook/test/browser/notebookDiff.test.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,31 @@
55

66
import * as assert from 'assert';
77
import { VSBuffer } from 'vs/base/common/buffer';
8-
import { LcsDiff } from 'vs/base/common/diff/diff';
8+
import { ISequence, LcsDiff } from 'vs/base/common/diff/diff';
99
import { Mimes } from 'vs/base/common/mime';
1010
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
1111
import { NotebookDiffEditorEventDispatcher } from 'vs/workbench/contrib/notebook/browser/diff/eventDispatcher';
1212
import { NotebookTextDiffEditor } from 'vs/workbench/contrib/notebook/browser/diff/notebookTextDiffEditor';
13-
import { CellKind, CellSequence } from 'vs/workbench/contrib/notebook/common/notebookCommon';
13+
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
14+
import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
1415
import { withTestNotebookDiffModel } from 'vs/workbench/contrib/notebook/test/browser/testNotebookEditor';
1516

17+
class CellSequence implements ISequence {
18+
19+
constructor(readonly textModel: NotebookTextModel) {
20+
}
21+
22+
getElements(): string[] | number[] | Int32Array {
23+
const hashValue = new Int32Array(this.textModel.cells.length);
24+
for (let i = 0; i < this.textModel.cells.length; i++) {
25+
hashValue[i] = this.textModel.cells[i].getHashValue();
26+
}
27+
28+
return hashValue;
29+
}
30+
}
31+
32+
1633
suite('NotebookCommon', () => {
1734
const configurationService = new TestConfigurationService();
1835

0 commit comments

Comments
 (0)