5
5
6
6
import * as assert from 'assert' ;
7
7
import { join } from 'path' ;
8
- import { CancellationTokenSource , commands , MarkdownString , TabKindNotebook , Position , QuickPickItem , Selection , StatusBarAlignment , TabKindTextDiff , TextEditor , TextEditorSelectionChangeKind , TextEditorViewColumnChangeEvent , TabKindText , Uri , ViewColumn , window , workspace } from 'vscode' ;
8
+ import { CancellationTokenSource , commands , MarkdownString , TabInputNotebook , Position , QuickPickItem , Selection , StatusBarAlignment , TextEditor , TextEditorSelectionChangeKind , TextEditorViewColumnChangeEvent , TabInputText , Uri , ViewColumn , window , workspace , TabInputTextDiff } from 'vscode' ;
9
9
import { assertNoRpc , closeAllEditors , createRandomFile , pathEquals } from '../utils' ;
10
10
11
11
@@ -371,28 +371,28 @@ suite('vscode API - window', () => {
371
371
} ) ;
372
372
373
373
//#region Tabs API tests
374
- test ( 'Tabs - move tab' , async function ( ) {
375
- const [ docA , docB , docC ] = await Promise . all ( [
376
- workspace . openTextDocument ( await createRandomFile ( ) ) ,
377
- workspace . openTextDocument ( await createRandomFile ( ) ) ,
378
- workspace . openTextDocument ( await createRandomFile ( ) )
379
- ] ) ;
374
+ // test('Tabs - move tab', async function () {
375
+ // const [docA, docB, docC] = await Promise.all([
376
+ // workspace.openTextDocument(await createRandomFile()),
377
+ // workspace.openTextDocument(await createRandomFile()),
378
+ // workspace.openTextDocument(await createRandomFile())
379
+ // ]);
380
380
381
- await window . showTextDocument ( docA , { viewColumn : ViewColumn . One , preview : false } ) ;
382
- await window . showTextDocument ( docB , { viewColumn : ViewColumn . One , preview : false } ) ;
383
- await window . showTextDocument ( docC , { viewColumn : ViewColumn . Two , preview : false } ) ;
381
+ // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false });
382
+ // await window.showTextDocument(docB, { viewColumn: ViewColumn.One, preview: false });
383
+ // await window.showTextDocument(docC, { viewColumn: ViewColumn.Two, preview: false });
384
384
385
- const tabGroups = window . tabGroups ;
386
- assert . strictEqual ( tabGroups . all . length , 2 ) ;
385
+ // const tabGroups = window.tabGroups;
386
+ // assert.strictEqual(tabGroups.all.length, 2);
387
387
388
- const group1Tabs = tabGroups . all [ 0 ] . tabs ;
389
- assert . strictEqual ( group1Tabs . length , 2 ) ;
388
+ // const group1Tabs = tabGroups.all[0].tabs;
389
+ // assert.strictEqual(group1Tabs.length, 2);
390
390
391
- const group2Tabs = tabGroups . all [ 1 ] . tabs ;
392
- assert . strictEqual ( group2Tabs . length , 1 ) ;
391
+ // const group2Tabs = tabGroups.all[1].tabs;
392
+ // assert.strictEqual(group2Tabs.length, 1);
393
393
394
- await tabGroups . move ( group1Tabs [ 0 ] , ViewColumn . One , 1 ) ;
395
- } ) ;
394
+ // await tabGroups.move(group1Tabs[0], ViewColumn.One, 1);
395
+ // });
396
396
397
397
// TODO @lramos 15 re-enable these once shape is more stable
398
398
test ( 'Tabs - vscode.open & vscode.diff' , async function ( ) {
@@ -423,14 +423,14 @@ suite('vscode API - window', () => {
423
423
424
424
const tabs = window . tabGroups . all . map ( g => g . tabs ) . flat ( 1 ) ;
425
425
assert . strictEqual ( tabs . length , 5 ) ;
426
- assert . ok ( tabs [ 0 ] . kind instanceof TabKindText ) ;
427
- assert . strictEqual ( tabs [ 0 ] . kind . uri . toString ( ) , docA . uri . toString ( ) ) ;
428
- assert . ok ( tabs [ 1 ] . kind instanceof TabKindText ) ;
429
- assert . strictEqual ( tabs [ 1 ] . kind . uri . toString ( ) , docB . uri . toString ( ) ) ;
430
- assert . ok ( tabs [ 2 ] . kind instanceof TabKindText ) ;
431
- assert . strictEqual ( tabs [ 2 ] . kind . uri . toString ( ) , docC . uri . toString ( ) ) ;
432
- assert . ok ( tabs [ 3 ] . kind instanceof TabKindText ) ;
433
- assert . strictEqual ( tabs [ 3 ] . kind . uri . toString ( ) , commandFile . toString ( ) ) ;
426
+ assert . ok ( tabs [ 0 ] . input instanceof TabInputText ) ;
427
+ assert . strictEqual ( tabs [ 0 ] . input . uri . toString ( ) , docA . uri . toString ( ) ) ;
428
+ assert . ok ( tabs [ 1 ] . input instanceof TabInputText ) ;
429
+ assert . strictEqual ( tabs [ 1 ] . input . uri . toString ( ) , docB . uri . toString ( ) ) ;
430
+ assert . ok ( tabs [ 2 ] . input instanceof TabInputText ) ;
431
+ assert . strictEqual ( tabs [ 2 ] . input . uri . toString ( ) , docC . uri . toString ( ) ) ;
432
+ assert . ok ( tabs [ 3 ] . input instanceof TabInputText ) ;
433
+ assert . strictEqual ( tabs [ 3 ] . input . uri . toString ( ) , commandFile . toString ( ) ) ;
434
434
} ) ;
435
435
436
436
test ( 'Tabs - Ensure tabs getter is correct' , async function ( ) {
@@ -459,17 +459,17 @@ suite('vscode API - window', () => {
459
459
assert . strictEqual ( tabs . length , 5 ) ;
460
460
461
461
// All resources should match the text documents as they're the only tabs currently open
462
- assert . ok ( tabs [ 0 ] . kind instanceof TabKindText ) ;
463
- assert . strictEqual ( tabs [ 0 ] . kind . uri . toString ( ) , docA . uri . toString ( ) ) ;
464
- assert . ok ( tabs [ 1 ] . kind instanceof TabKindNotebook ) ;
465
- assert . strictEqual ( tabs [ 1 ] . kind . uri . toString ( ) , notebookDoc . uri . toString ( ) ) ;
466
- assert . ok ( tabs [ 2 ] . kind instanceof TabKindText ) ;
467
- assert . strictEqual ( tabs [ 2 ] . kind . uri . toString ( ) , docB . uri . toString ( ) ) ;
468
- assert . ok ( tabs [ 3 ] . kind instanceof TabKindText ) ;
469
- assert . strictEqual ( tabs [ 3 ] . kind . uri . toString ( ) , docC . uri . toString ( ) ) ;
462
+ assert . ok ( tabs [ 0 ] . input instanceof TabInputText ) ;
463
+ assert . strictEqual ( tabs [ 0 ] . input . uri . toString ( ) , docA . uri . toString ( ) ) ;
464
+ assert . ok ( tabs [ 1 ] . input instanceof TabInputNotebook ) ;
465
+ assert . strictEqual ( tabs [ 1 ] . input . uri . toString ( ) , notebookDoc . uri . toString ( ) ) ;
466
+ assert . ok ( tabs [ 2 ] . input instanceof TabInputText ) ;
467
+ assert . strictEqual ( tabs [ 2 ] . input . uri . toString ( ) , docB . uri . toString ( ) ) ;
468
+ assert . ok ( tabs [ 3 ] . input instanceof TabInputText ) ;
469
+ assert . strictEqual ( tabs [ 3 ] . input . uri . toString ( ) , docC . uri . toString ( ) ) ;
470
470
// Diff editor and side by side editor report the right side as the resource
471
- assert . ok ( tabs [ 4 ] . kind instanceof TabKindTextDiff ) ;
472
- assert . strictEqual ( tabs [ 4 ] . kind . modified . toString ( ) , rightDiff . toString ( ) ) ;
471
+ assert . ok ( tabs [ 4 ] . input instanceof TabInputTextDiff ) ;
472
+ assert . strictEqual ( tabs [ 4 ] . input . modified . toString ( ) , rightDiff . toString ( ) ) ;
473
473
474
474
assert . strictEqual ( tabs [ 0 ] . group . viewColumn , ViewColumn . One ) ;
475
475
assert . strictEqual ( tabs [ 1 ] . group . viewColumn , ViewColumn . One ) ;
@@ -495,20 +495,20 @@ suite('vscode API - window', () => {
495
495
await window . showTextDocument ( docA , { viewColumn : ViewColumn . One , preview : false } ) ;
496
496
let activeTab = getActiveTabInActiveGroup ( ) ;
497
497
assert . ok ( activeTab ) ;
498
- assert . ok ( activeTab . kind instanceof TabKindText ) ;
499
- assert . strictEqual ( activeTab . kind . uri . toString ( ) , docA . uri . toString ( ) ) ;
498
+ assert . ok ( activeTab . input instanceof TabInputText ) ;
499
+ assert . strictEqual ( activeTab . input . uri . toString ( ) , docA . uri . toString ( ) ) ;
500
500
501
501
await window . showTextDocument ( docB , { viewColumn : ViewColumn . Two , preview : false } ) ;
502
502
activeTab = getActiveTabInActiveGroup ( ) ;
503
503
assert . ok ( activeTab ) ;
504
- assert . ok ( activeTab . kind instanceof TabKindText ) ;
505
- assert . strictEqual ( activeTab . kind . uri . toString ( ) , docB . uri . toString ( ) ) ;
504
+ assert . ok ( activeTab . input instanceof TabInputText ) ;
505
+ assert . strictEqual ( activeTab . input . uri . toString ( ) , docB . uri . toString ( ) ) ;
506
506
507
507
await window . showTextDocument ( docC , { viewColumn : ViewColumn . Three , preview : false } ) ;
508
508
activeTab = getActiveTabInActiveGroup ( ) ;
509
509
assert . ok ( activeTab ) ;
510
- assert . ok ( activeTab . kind instanceof TabKindText ) ;
511
- assert . strictEqual ( activeTab . kind . uri . toString ( ) , docC . uri . toString ( ) ) ;
510
+ assert . ok ( activeTab . input instanceof TabInputText ) ;
511
+ assert . strictEqual ( activeTab . input . uri . toString ( ) , docC . uri . toString ( ) ) ;
512
512
513
513
await commands . executeCommand ( 'workbench.action.closeActiveEditor' ) ;
514
514
await commands . executeCommand ( 'workbench.action.closeActiveEditor' ) ;
0 commit comments