@@ -20,14 +20,6 @@ suite('Notebook Document', function () {
20
20
}
21
21
} ;
22
22
23
- const complexContentProvider = new class implements vscode . NotebookContentProvider {
24
- async openNotebook ( uri : vscode . Uri , _openContext : vscode . NotebookDocumentOpenContext ) : Promise < vscode . NotebookData > {
25
- return new vscode . NotebookData (
26
- [ new vscode . NotebookCellData ( vscode . NotebookCellKind . Code , uri . toString ( ) , 'javascript' ) ] ,
27
- ) ;
28
- }
29
- } ;
30
-
31
23
const disposables : vscode . Disposable [ ] = [ ] ;
32
24
const testDisposables : vscode . Disposable [ ] = [ ] ;
33
25
@@ -45,17 +37,7 @@ suite('Notebook Document', function () {
45
37
} ) ;
46
38
47
39
suiteSetup ( function ( ) {
48
- disposables . push ( vscode . workspace . registerNotebookContentProvider ( 'notebook.nbdtest' , complexContentProvider ) ) ;
49
- disposables . push ( vscode . workspace . registerNotebookSerializer ( 'notebook.nbdserializer' , simpleContentProvider ) ) ;
50
- } ) ;
51
-
52
- test ( 'cannot register sample provider multiple times' , function ( ) {
53
- assert . throws ( ( ) => {
54
- vscode . workspace . registerNotebookContentProvider ( 'notebook.nbdtest' , complexContentProvider ) ;
55
- } ) ;
56
- // assert.throws(() => {
57
- // vscode.workspace.registerNotebookSerializer('notebook.nbdserializer', simpleContentProvider);
58
- // });
40
+ disposables . push ( vscode . workspace . registerNotebookSerializer ( 'notebook.nbdtest' , simpleContentProvider ) ) ;
59
41
} ) ;
60
42
61
43
test ( 'cannot open unknown types' , async function ( ) {
@@ -131,7 +113,7 @@ suite('Notebook Document', function () {
131
113
} ) ;
132
114
133
115
test ( 'open untitled notebook' , async function ( ) {
134
- const nb = await vscode . workspace . openNotebookDocument ( 'notebook.nbdserializer ' ) ;
116
+ const nb = await vscode . workspace . openNotebookDocument ( 'notebook.nbdtest ' ) ;
135
117
assert . strictEqual ( nb . isUntitled , true ) ;
136
118
assert . strictEqual ( nb . isClosed , false ) ;
137
119
assert . strictEqual ( nb . uri . scheme , 'untitled' ) ;
@@ -140,7 +122,7 @@ suite('Notebook Document', function () {
140
122
141
123
test ( 'open untitled with data' , async function ( ) {
142
124
const nb = await vscode . workspace . openNotebookDocument (
143
- 'notebook.nbdserializer ' ,
125
+ 'notebook.nbdtest ' ,
144
126
new vscode . NotebookData ( [
145
127
new vscode . NotebookCellData ( vscode . NotebookCellKind . Code , 'console.log()' , 'javascript' ) ,
146
128
new vscode . NotebookCellData ( vscode . NotebookCellKind . Markup , 'Hey' , 'markdown' ) ,
@@ -353,7 +335,7 @@ suite('Notebook Document', function () {
353
335
} ) ;
354
336
355
337
test ( 'dirty state - serializer' , async function ( ) {
356
- const resource = await utils . createRandomFile ( undefined , undefined , '.nbdserializer ' ) ;
338
+ const resource = await utils . createRandomFile ( undefined , undefined , '.nbdtest ' ) ;
357
339
const document = await vscode . workspace . openNotebookDocument ( resource ) ;
358
340
assert . strictEqual ( document . isDirty , false ) ;
359
341
0 commit comments