@@ -213,15 +213,15 @@ describe('editorContext', function () {
213
213
} )
214
214
} )
215
215
216
- describe ( 'extractCellsSliceContext ' , function ( ) {
216
+ describe ( 'getNotebookCellsSliceContext ' , function ( ) {
217
217
it ( 'Should extract content from cells in reverse order up to maxLength from prefix cells' , function ( ) {
218
218
const mockCells = [
219
219
createNotebookCell ( createMockDocument ( 'First cell content' ) ) ,
220
220
createNotebookCell ( createMockDocument ( 'Second cell content' ) ) ,
221
221
createNotebookCell ( createMockDocument ( 'Third cell content' ) ) ,
222
222
]
223
223
224
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , false )
224
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , false )
225
225
assert . strictEqual ( result , 'First cell content\nSecond cell content\nThird cell content\n' )
226
226
} )
227
227
@@ -232,7 +232,7 @@ describe('editorContext', function () {
232
232
createNotebookCell ( createMockDocument ( 'Third cell content' ) ) ,
233
233
]
234
234
235
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , true )
235
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , true )
236
236
assert . strictEqual ( result , 'First cell content\nSecond cell content\nThird cell content\n' )
237
237
} )
238
238
@@ -244,7 +244,7 @@ describe('editorContext', function () {
244
244
createNotebookCell ( createMockDocument ( 'Fourth' ) ) ,
245
245
]
246
246
// Should only include part of second cell and the last two cells
247
- const result = EditorContext . extractCellsSliceContext ( mockCells , 15 , 'python' , false )
247
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 15 , 'python' , false )
248
248
assert . strictEqual ( result , 'd\nThird\nFourth\n' )
249
249
} )
250
250
@@ -257,17 +257,17 @@ describe('editorContext', function () {
257
257
]
258
258
259
259
// Should only include first cell and part of second cell
260
- const result = EditorContext . extractCellsSliceContext ( mockCells , 15 , 'python' , true )
260
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 15 , 'python' , true )
261
261
assert . strictEqual ( result , 'First\nSecond\nTh' )
262
262
} )
263
263
264
264
it ( 'Should handle empty cells array from prefix cells' , function ( ) {
265
- const result = EditorContext . extractCellsSliceContext ( [ ] , 100 , 'python' , false )
265
+ const result = EditorContext . getNotebookCellsSliceContext ( [ ] , 100 , 'python' , false )
266
266
assert . strictEqual ( result , '' )
267
267
} )
268
268
269
269
it ( 'Should handle empty cells array from suffix cells' , function ( ) {
270
- const result = EditorContext . extractCellsSliceContext ( [ ] , 100 , 'python' , true )
270
+ const result = EditorContext . getNotebookCellsSliceContext ( [ ] , 100 , 'python' , true )
271
271
assert . strictEqual ( result , '' )
272
272
} )
273
273
@@ -276,7 +276,7 @@ describe('editorContext', function () {
276
276
createNotebookCell ( createMockDocument ( '# Heading\nThis is markdown' ) , vscode . NotebookCellKind . Markup ) ,
277
277
createNotebookCell ( createMockDocument ( 'def example():\n return "test"' ) ) ,
278
278
]
279
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , false )
279
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , false )
280
280
assert . strictEqual ( result , '# # Heading\n# This is markdown\ndef example():\n return "test"\n' )
281
281
} )
282
282
@@ -286,7 +286,7 @@ describe('editorContext', function () {
286
286
createNotebookCell ( createMockDocument ( 'def example():\n return "test"' ) ) ,
287
287
]
288
288
289
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , true )
289
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , true )
290
290
assert . strictEqual ( result , '# # Heading\n# This is markdown\ndef example():\n return "test"\n' )
291
291
} )
292
292
@@ -295,7 +295,7 @@ describe('editorContext', function () {
295
295
createNotebookCell ( createMockDocument ( '# Heading\nThis is markdown' ) , vscode . NotebookCellKind . Markup ) ,
296
296
createNotebookCell ( createMockDocument ( 'def example():\n return "test"' ) ) ,
297
297
]
298
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'java' , false )
298
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'java' , false )
299
299
assert . strictEqual ( result , '// # Heading\n// This is markdown\n// def example():\n// return "test"\n' )
300
300
} )
301
301
@@ -305,7 +305,7 @@ describe('editorContext', function () {
305
305
createNotebookCell ( createMockDocument ( 'println(1 + 1);' , 'somefile.ipynb' , 'java' ) ) ,
306
306
]
307
307
308
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'java' , true )
308
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'java' , true )
309
309
assert . strictEqual ( result , '// # Heading\n// This is markdown\nprintln(1 + 1);\n' )
310
310
} )
311
311
@@ -317,7 +317,7 @@ describe('editorContext', function () {
317
317
) ,
318
318
createNotebookCell ( createMockDocument ( 'def example():\n return "test"' ) ) ,
319
319
]
320
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , false )
320
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , false )
321
321
assert . strictEqual ( result , '# println(1 + 1);\ndef example():\n return "test"\n' )
322
322
} )
323
323
@@ -329,7 +329,7 @@ describe('editorContext', function () {
329
329
) ,
330
330
createNotebookCell ( createMockDocument ( 'def example():\n return "test"' ) ) ,
331
331
]
332
- const result = EditorContext . extractCellsSliceContext ( mockCells , 100 , 'python' , true )
332
+ const result = EditorContext . getNotebookCellsSliceContext ( mockCells , 100 , 'python' , true )
333
333
assert . strictEqual ( result , '# println(1 + 1);\ndef example():\n return "test"\n' )
334
334
} )
335
335
} )
0 commit comments