|
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, WorkspaceEdit } from 'vscode'; |
9 |
| -import { asPromise, assertNoRpc, closeAllEditors, createRandomFile, pathEquals } from '../utils'; |
| 8 | +import { CancellationTokenSource, commands, MarkdownString, TabKindNotebook, Position, QuickPickItem, Selection, StatusBarAlignment, TabKindTextDiff, TextEditor, TextEditorSelectionChangeKind, TextEditorViewColumnChangeEvent, TabKindText, Uri, ViewColumn, window, workspace } from 'vscode'; |
| 9 | +import { assertNoRpc, closeAllEditors, createRandomFile, pathEquals } from '../utils'; |
10 | 10 |
|
11 | 11 |
|
12 | 12 | suite('vscode API - window', () => {
|
@@ -517,113 +517,118 @@ suite('vscode API - window', () => {
|
517 | 517 | assert.ok(!getActiveTabInActiveGroup());
|
518 | 518 | });
|
519 | 519 |
|
520 |
| - test('Tabs - verify pinned state', async () => { |
| 520 | + // TODO@lramos15 https://github.com/microsoft/vscode/issues/145846 |
| 521 | + // Should ensure to either use existing tab API for modifications |
| 522 | + // or commands that operate on a dedicated editor that is passed |
| 523 | + // in as an argument |
521 | 524 |
|
522 |
| - const [docA] = await Promise.all([ |
523 |
| - workspace.openTextDocument(await createRandomFile()) |
524 |
| - ]); |
| 525 | + // test('Tabs - verify pinned state', async () => { |
525 | 526 |
|
526 |
| - await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
| 527 | + // const [docA] = await Promise.all([ |
| 528 | + // workspace.openTextDocument(await createRandomFile()) |
| 529 | + // ]); |
527 | 530 |
|
528 |
| - const tab = window.tabGroups.activeTabGroup?.activeTab; |
529 |
| - assert.ok(tab); |
| 531 | + // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
530 | 532 |
|
531 |
| - assert.strictEqual(tab.isPinned, false); |
| 533 | + // const tab = window.tabGroups.activeTabGroup?.activeTab; |
| 534 | + // assert.ok(tab); |
532 | 535 |
|
533 |
| - let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 536 | + // assert.strictEqual(tab.isPinned, false); |
534 | 537 |
|
535 |
| - await commands.executeCommand('workbench.action.pinEditor'); |
536 |
| - await onDidChangeTab; |
| 538 | + // let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
537 | 539 |
|
538 |
| - assert.strictEqual(tab.isPinned, true); |
| 540 | + // await commands.executeCommand('workbench.action.pinEditor'); |
| 541 | + // await onDidChangeTab; |
539 | 542 |
|
540 |
| - onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 543 | + // assert.strictEqual(tab.isPinned, true); |
541 | 544 |
|
542 |
| - await commands.executeCommand('workbench.action.unpinEditor'); |
543 |
| - await onDidChangeTab; |
| 545 | + // onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
544 | 546 |
|
545 |
| - assert.strictEqual(tab.isPinned, false); |
546 |
| - }); |
| 547 | + // await commands.executeCommand('workbench.action.unpinEditor'); |
| 548 | + // await onDidChangeTab; |
547 | 549 |
|
548 |
| - test('Tabs - verify preview state', async () => { |
| 550 | + // assert.strictEqual(tab.isPinned, false); |
| 551 | + // }); |
549 | 552 |
|
550 |
| - const [docA] = await Promise.all([ |
551 |
| - workspace.openTextDocument(await createRandomFile()) |
552 |
| - ]); |
| 553 | + // test('Tabs - verify preview state', async () => { |
553 | 554 |
|
554 |
| - await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: true }); |
| 555 | + // const [docA] = await Promise.all([ |
| 556 | + // workspace.openTextDocument(await createRandomFile()) |
| 557 | + // ]); |
555 | 558 |
|
556 |
| - const tab = window.tabGroups.activeTabGroup?.activeTab; |
557 |
| - assert.ok(tab); |
| 559 | + // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: true }); |
558 | 560 |
|
559 |
| - assert.strictEqual(tab.isPreview, true); |
| 561 | + // const tab = window.tabGroups.activeTabGroup?.activeTab; |
| 562 | + // assert.ok(tab); |
560 | 563 |
|
561 |
| - let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 564 | + // assert.strictEqual(tab.isPreview, true); |
562 | 565 |
|
563 |
| - await commands.executeCommand('workbench.action.keepEditor'); |
564 |
| - await onDidChangeTab; |
| 566 | + // let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
565 | 567 |
|
566 |
| - assert.strictEqual(tab.isPreview, false); |
567 |
| - }); |
| 568 | + // await commands.executeCommand('workbench.action.keepEditor'); |
| 569 | + // await onDidChangeTab; |
568 | 570 |
|
569 |
| - test('Tabs - verify dirty state', async () => { |
| 571 | + // assert.strictEqual(tab.isPreview, false); |
| 572 | + // }); |
570 | 573 |
|
571 |
| - const [docA] = await Promise.all([ |
572 |
| - workspace.openTextDocument(await createRandomFile()) |
573 |
| - ]); |
| 574 | + // test('Tabs - verify dirty state', async () => { |
574 | 575 |
|
575 |
| - await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: true }); |
| 576 | + // const [docA] = await Promise.all([ |
| 577 | + // workspace.openTextDocument(await createRandomFile()) |
| 578 | + // ]); |
576 | 579 |
|
577 |
| - const tab = window.tabGroups.activeTabGroup?.activeTab; |
578 |
| - assert.ok(tab); |
| 580 | + // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: true }); |
579 | 581 |
|
580 |
| - assert.strictEqual(tab.isDirty, false); |
581 |
| - assert.strictEqual(docA.isDirty, false); |
| 582 | + // const tab = window.tabGroups.activeTabGroup?.activeTab; |
| 583 | + // assert.ok(tab); |
582 | 584 |
|
583 |
| - let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 585 | + // assert.strictEqual(tab.isDirty, false); |
| 586 | + // assert.strictEqual(docA.isDirty, false); |
584 | 587 |
|
585 |
| - const edit = new WorkspaceEdit(); |
586 |
| - edit.insert(docA.uri, new Position(0, 0), 'var abc = 0;'); |
587 |
| - await workspace.applyEdit(edit); |
| 588 | + // let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
588 | 589 |
|
589 |
| - await onDidChangeTab; |
| 590 | + // const edit = new WorkspaceEdit(); |
| 591 | + // edit.insert(docA.uri, new Position(0, 0), 'var abc = 0;'); |
| 592 | + // await workspace.applyEdit(edit); |
590 | 593 |
|
591 |
| - assert.strictEqual(tab.isDirty, true); |
| 594 | + // await onDidChangeTab; |
592 | 595 |
|
593 |
| - onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 596 | + // assert.strictEqual(tab.isDirty, true); |
594 | 597 |
|
595 |
| - await commands.executeCommand('workbench.action.files.save'); |
| 598 | + // onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
596 | 599 |
|
597 |
| - await onDidChangeTab; |
| 600 | + // await commands.executeCommand('workbench.action.files.save'); |
598 | 601 |
|
599 |
| - assert.strictEqual(tab.isDirty, false); |
600 |
| - }); |
| 602 | + // await onDidChangeTab; |
601 | 603 |
|
602 |
| - test('Tabs - verify active state', async () => { |
| 604 | + // assert.strictEqual(tab.isDirty, false); |
| 605 | + // }); |
603 | 606 |
|
604 |
| - const [docA, docB] = await Promise.all([ |
605 |
| - workspace.openTextDocument(await createRandomFile()), |
606 |
| - workspace.openTextDocument(await createRandomFile()), |
607 |
| - ]); |
| 607 | + // test('Tabs - verify active state', async () => { |
608 | 608 |
|
609 |
| - await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
610 |
| - await window.showTextDocument(docB, { viewColumn: ViewColumn.One, preview: false }); |
| 609 | + // const [docA, docB] = await Promise.all([ |
| 610 | + // workspace.openTextDocument(await createRandomFile()), |
| 611 | + // workspace.openTextDocument(await createRandomFile()), |
| 612 | + // ]); |
611 | 613 |
|
612 |
| - const tab = window.tabGroups.activeTabGroup?.tabs; |
613 |
| - assert.strictEqual(tab?.length, 2); |
| 614 | + // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
| 615 | + // await window.showTextDocument(docB, { viewColumn: ViewColumn.One, preview: false }); |
614 | 616 |
|
615 |
| - assert.strictEqual(tab[0].isActive, false); |
616 |
| - assert.strictEqual(tab[1].isActive, true); |
| 617 | + // const tab = window.tabGroups.activeTabGroup?.tabs; |
| 618 | + // assert.strictEqual(tab?.length, 2); |
617 | 619 |
|
618 |
| - let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
| 620 | + // assert.strictEqual(tab[0].isActive, false); |
| 621 | + // assert.strictEqual(tab[1].isActive, true); |
619 | 622 |
|
620 |
| - await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
| 623 | + // let onDidChangeTab = asPromise(window.tabGroups.onDidChangeTab); |
621 | 624 |
|
622 |
| - await onDidChangeTab; |
| 625 | + // await window.showTextDocument(docA, { viewColumn: ViewColumn.One, preview: false }); |
623 | 626 |
|
624 |
| - assert.strictEqual(tab[0].isActive, true); |
625 |
| - assert.strictEqual(tab[1].isActive, false); |
626 |
| - }); |
| 627 | + // await onDidChangeTab; |
| 628 | + |
| 629 | + // assert.strictEqual(tab[0].isActive, true); |
| 630 | + // assert.strictEqual(tab[1].isActive, false); |
| 631 | + // }); |
627 | 632 |
|
628 | 633 | /*
|
629 | 634 |
|
|
0 commit comments