@theia/plugin 1.40.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/theia.d.ts CHANGED
@@ -30,6 +30,9 @@ import './theia.proposed.dropMetadata';
30
30
  import './theia.proposed.editSessionIdentityProvider';
31
31
  import './theia.proposed.extensionsAny';
32
32
  import './theia.proposed.externalUriOpener';
33
+ import './theia.proposed.notebookCellExecutionState';
34
+ import './theia.proposed.notebookKernelSource';
35
+ import './theia.proposed.notebookMessaging';
33
36
  import './theia.proposed.findTextInFiles';
34
37
  import './theia.proposed.fsChunks';
35
38
  import './theia.proposed.profileContentHandlers';
@@ -3585,6 +3588,12 @@ export module '@theia/plugin' {
3585
3588
  * A collection of mutations that an extension can apply to a process environment.
3586
3589
  */
3587
3590
  export interface EnvironmentVariableCollection {
3591
+
3592
+ /**
3593
+ * A description for the environment variable collection, this will be used to describe the changes in the UI.
3594
+ */
3595
+ description: string | MarkdownString | undefined;
3596
+
3588
3597
  /**
3589
3598
  * Whether the collection should be cached for the workspace and applied to the terminal
3590
3599
  * across window reloads. When true the collection will be active immediately such when the
@@ -4941,14 +4950,12 @@ export module '@theia/plugin' {
4941
4950
 
4942
4951
  /**
4943
4952
  * The currently visible {@link NotebookEditor notebook editors} or an empty array.
4944
- * @stubbed
4945
4953
  */
4946
4954
  export const visibleNotebookEditors: readonly NotebookEditor[];
4947
4955
 
4948
4956
  /**
4949
4957
  * An {@link Event} which fires when the {@link window.visibleNotebookEditors visible notebook editors}
4950
4958
  * has changed.
4951
- * @stubbed
4952
4959
  */
4953
4960
  export const onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>;
4954
4961
 
@@ -4956,7 +4963,6 @@ export module '@theia/plugin' {
4956
4963
  * The currently active {@link NotebookEditor notebook editor} or `undefined`. The active editor is the one
4957
4964
  * that currently has focus or, when none has focus, the one that has changed
4958
4965
  * input most recently.
4959
- * @stubbed
4960
4966
  */
4961
4967
  export const activeNotebookEditor: NotebookEditor | undefined;
4962
4968
 
@@ -4964,21 +4970,18 @@ export module '@theia/plugin' {
4964
4970
  * An {@link Event} which fires when the {@link window.activeNotebookEditor active notebook editor}
4965
4971
  * has changed. *Note* that the event also fires when the active editor changes
4966
4972
  * to `undefined`.
4967
- * @stubbed
4968
4973
  */
4969
4974
  export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
4970
4975
 
4971
4976
  /**
4972
4977
  * An {@link Event} which fires when the {@link NotebookEditor.selections notebook editor selections}
4973
4978
  * have changed.
4974
- * @stubbed
4975
4979
  */
4976
4980
  export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;
4977
4981
 
4978
4982
  /**
4979
4983
  * An {@link Event} which fires when the {@link NotebookEditor.visibleRanges notebook editor visible ranges}
4980
4984
  * have changed.
4981
- * @stubbed
4982
4985
  */
4983
4986
  export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;
4984
4987
 
@@ -4989,7 +4992,6 @@ export module '@theia/plugin' {
4989
4992
  * @param options {@link NotebookDocumentShowOptions Editor options} to configure the behavior of showing the {@link NotebookEditor notebook editor}.
4990
4993
  *
4991
4994
  * @return A promise that resolves to an {@link NotebookEditor notebook editor}.
4992
- * @stubbed
4993
4995
  */
4994
4996
  export function showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;
4995
4997
 
@@ -5944,6 +5946,44 @@ export module '@theia/plugin' {
5944
5946
  * array containing all selected tree items.
5945
5947
  */
5946
5948
  canSelectMany?: boolean;
5949
+
5950
+ /**
5951
+ * By default, when the children of a tree item have already been fetched, child checkboxes are automatically managed based on the checked state of the parent tree item.
5952
+ * If the tree item is collapsed by default (meaning that the children haven't yet been fetched) then child checkboxes will not be updated.
5953
+ * To override this behavior and manage child and parent checkbox state in the extension, set this to `true`.
5954
+ *
5955
+ * Examples where {@link TreeViewOptions.manageCheckboxStateManually} is false, the default behavior:
5956
+ *
5957
+ * 1. A tree item is checked, then its children are fetched. The children will be checked.
5958
+ *
5959
+ * 2. A tree item's parent is checked. The tree item and all of it's siblings will be checked.
5960
+ * - [ ] Parent
5961
+ * - [ ] Child 1
5962
+ * - [ ] Child 2
5963
+ * When the user checks Parent, the tree will look like this:
5964
+ * - [x] Parent
5965
+ * - [x] Child 1
5966
+ * - [x] Child 2
5967
+ *
5968
+ * 3. A tree item and all of it's siblings are checked. The parent will be checked.
5969
+ * - [ ] Parent
5970
+ * - [ ] Child 1
5971
+ * - [ ] Child 2
5972
+ * When the user checks Child 1 and Child 2, the tree will look like this:
5973
+ * - [x] Parent
5974
+ * - [x] Child 1
5975
+ * - [x] Child 2
5976
+ *
5977
+ * 4. A tree item is unchecked. The parent will be unchecked.
5978
+ * - [x] Parent
5979
+ * - [x] Child 1
5980
+ * - [x] Child 2
5981
+ * When the user unchecks Child 1, the tree will look like this:
5982
+ * - [ ] Parent
5983
+ * - [ ] Child 1
5984
+ * - [x] Child 2
5985
+ */
5986
+ manageCheckboxStateManually?: boolean;
5947
5987
  }
5948
5988
 
5949
5989
  /**
@@ -6157,6 +6197,16 @@ export module '@theia/plugin' {
6157
6197
  readonly value: number;
6158
6198
  }
6159
6199
 
6200
+ /**
6201
+ * An event describing the change in a tree item's checkbox state.
6202
+ */
6203
+ export interface TreeCheckboxChangeEvent<T> {
6204
+ /**
6205
+ * The items that were checked or unchecked.
6206
+ */
6207
+ readonly items: ReadonlyArray<[T, TreeItemCheckboxState]>;
6208
+ }
6209
+
6160
6210
  /**
6161
6211
  * Represents a Tree view
6162
6212
  */
@@ -6192,6 +6242,11 @@ export module '@theia/plugin' {
6192
6242
  */
6193
6243
  readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>;
6194
6244
 
6245
+ /**
6246
+ * An event to signal that an element or root has either been checked or unchecked.
6247
+ */
6248
+ readonly onDidChangeCheckboxState: Event<TreeCheckboxChangeEvent<T>>;
6249
+
6195
6250
  /**
6196
6251
  * An optional human-readable message that will be rendered in the view.
6197
6252
  * Setting the message to null, undefined, or empty string will remove the message from the view.
@@ -6364,6 +6419,12 @@ export module '@theia/plugin' {
6364
6419
  */
6365
6420
  accessibilityInformation?: AccessibilityInformation;
6366
6421
 
6422
+ /**
6423
+ * {@link TreeItemCheckboxState TreeItemCheckboxState} of the tree item.
6424
+ * {@link TreeDataProvider.onDidChangeTreeData onDidChangeTreeData} should be fired when {@link TreeItem.checkboxState checkboxState} changes.
6425
+ */
6426
+ checkboxState?: TreeItemCheckboxState | { readonly state: TreeItemCheckboxState; readonly tooltip?: string; readonly accessibilityInformation?: AccessibilityInformation };
6427
+
6367
6428
  /**
6368
6429
  * @param label A human-readable string describing this item
6369
6430
  * @param collapsibleState {@link TreeItemCollapsibleState TreeItemCollapsibleState} of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
@@ -6412,6 +6473,20 @@ export module '@theia/plugin' {
6412
6473
  highlights?: [number, number][];
6413
6474
  }
6414
6475
 
6476
+ /**
6477
+ * Checkbox state of the tree item
6478
+ */
6479
+ export enum TreeItemCheckboxState {
6480
+ /**
6481
+ * Determines an item is unchecked
6482
+ */
6483
+ Unchecked = 0,
6484
+ /**
6485
+ * Determines an item is checked
6486
+ */
6487
+ Checked = 1
6488
+ }
6489
+
6415
6490
  /**
6416
6491
  * Represents the configuration. It is a merged view of
6417
6492
  *
@@ -7079,7 +7154,6 @@ export module '@theia/plugin' {
7079
7154
  * All notebook documents currently known to the editor.
7080
7155
  *
7081
7156
  * @readonly
7082
- * @stubbed
7083
7157
  */
7084
7158
  export let notebookDocuments: readonly NotebookDocument[];
7085
7159
 
@@ -7096,7 +7170,6 @@ export module '@theia/plugin' {
7096
7170
 
7097
7171
  /**
7098
7172
  * An event that is emitted when a {@link NotebookDocument notebook} is opened.
7099
- * @stubbed
7100
7173
  */
7101
7174
  export const onDidOpenNotebookDocument: Event<NotebookDocument>;
7102
7175
 
@@ -7106,13 +7179,11 @@ export module '@theia/plugin' {
7106
7179
  * Note 1: There is no guarantee that this event fires when an editor tab is closed.
7107
7180
  *
7108
7181
  * Note 2: A notebook can be open but not shown in an editor which means this event can fire for a notebook that has not been shown in an editor.
7109
- * @stubbed
7110
7182
  */
7111
7183
  export const onDidCloseNotebookDocument: Event<NotebookDocument>;
7112
7184
 
7113
7185
  /**
7114
7186
  * An event that is emitted when a {@link NotebookDocument notebook} is saved.
7115
- * @stubbed
7116
7187
  */
7117
7188
  export const onDidSaveNotebookDocument: Event<NotebookDocument>;
7118
7189
 
@@ -7124,7 +7195,6 @@ export module '@theia/plugin' {
7124
7195
  * @param serializer a notebook serializer.
7125
7196
  * @param options Optional context options that define what parts of a notebook should be persisted
7126
7197
  * @return A {@link Disposable disposable} that unregisters this serializer when being disposed.
7127
- * @stubbed
7128
7198
  */
7129
7199
  export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable;
7130
7200
 
@@ -7178,7 +7248,6 @@ export module '@theia/plugin' {
7178
7248
 
7179
7249
  /**
7180
7250
  * An event that is emitted when a {@link Notebook notebook} has changed.
7181
- * @stubbed
7182
7251
  */
7183
7252
  export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;
7184
7253
 
@@ -7317,7 +7386,6 @@ export module '@theia/plugin' {
7317
7386
  *
7318
7387
  * @param uri The resource to open.
7319
7388
  * @return A promise that resolves to a {@link NotebookDocument notebook}.
7320
- * @stubbed
7321
7389
  */
7322
7390
  export function openNotebookDocument(uri: Uri): Thenable<NotebookDocument> | undefined;
7323
7391
 
@@ -7327,7 +7395,6 @@ export module '@theia/plugin' {
7327
7395
  * @param notebookType The notebook type that should be used.
7328
7396
  * @param content The initial contents of the notebook.
7329
7397
  * @return A promise that resolves to a {@link NotebookDocument notebook}.
7330
- * @stubbed
7331
7398
  */
7332
7399
  export function openNotebookDocument(notebookType: string, content?: NotebookData): Thenable<NotebookDocument> | undefined;
7333
7400
 
@@ -10051,6 +10118,30 @@ export module '@theia/plugin' {
10051
10118
  */
10052
10119
  set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata]>): void;
10053
10120
 
10121
+ /**
10122
+ * Set (and replace) text edits or snippet edits with metadata for a resource.
10123
+ *
10124
+ * @param uri A resource identifier.
10125
+ * @param edits An array of edits.
10126
+ */
10127
+ set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata]>): void;
10128
+
10129
+ /**
10130
+ * Set (and replace) notebook edits for a resource.
10131
+ *
10132
+ * @param uri A resource identifier.
10133
+ * @param edits An array of edits.
10134
+ */
10135
+ set(uri: Uri, edits: readonly NotebookEdit[]): void;
10136
+
10137
+ /**
10138
+ * Set (and replace) notebook edits with metadata for a resource.
10139
+ *
10140
+ * @param uri A resource identifier.
10141
+ * @param edits An array of edits.
10142
+ */
10143
+ set(uri: Uri, edits: ReadonlyArray<[NotebookEdit, WorkspaceEditEntryMetadata]>): void;
10144
+
10054
10145
  /**
10055
10146
  * Get the text edits for a resource.
10056
10147
  *
@@ -14438,13 +14529,11 @@ export module '@theia/plugin' {
14438
14529
 
14439
14530
  /**
14440
14531
  * The {@link NotebookDocument notebook document} associated with this notebook editor.
14441
- * @stubbed
14442
14532
  */
14443
14533
  readonly notebook: NotebookDocument;
14444
14534
 
14445
14535
  /**
14446
14536
  * The primary selection in this notebook editor.
14447
- * @stubbed
14448
14537
  */
14449
14538
  selection: NotebookRange;
14450
14539
 
@@ -14452,19 +14541,16 @@ export module '@theia/plugin' {
14452
14541
  * All selections in this notebook editor.
14453
14542
  *
14454
14543
  * The primary selection (or focused range) is `selections[0]`. When the document has no cells, the primary selection is empty `{ start: 0, end: 0 }`;
14455
- * @stubbed
14456
14544
  */
14457
14545
  selections: readonly NotebookRange[];
14458
14546
 
14459
14547
  /**
14460
14548
  * The current visible ranges in the editor (vertically).
14461
- * @stubbed
14462
14549
  */
14463
14550
  readonly visibleRanges: readonly NotebookRange[];
14464
14551
 
14465
14552
  /**
14466
14553
  * The column in which this editor shows.
14467
- * @stubbed
14468
14554
  */
14469
14555
  readonly viewColumn?: ViewColumn;
14470
14556
 
@@ -14484,7 +14570,6 @@ export module '@theia/plugin' {
14484
14570
  export interface NotebookRendererMessaging {
14485
14571
  /**
14486
14572
  * An event that fires when a message is received from a renderer.
14487
- * @stubbed
14488
14573
  */
14489
14574
  readonly onDidReceiveMessage: Event<{
14490
14575
  readonly editor: NotebookEditor;
@@ -14499,7 +14584,6 @@ export module '@theia/plugin' {
14499
14584
  * message is sent to all renderers.
14500
14585
  * @returns a boolean indicating whether the message was successfully
14501
14586
  * delivered to any renderer.
14502
- * @stubbed
14503
14587
  */
14504
14588
  postMessage(message: any, editor?: NotebookEditor): Thenable<boolean>;
14505
14589
  }
@@ -14533,7 +14617,6 @@ export module '@theia/plugin' {
14533
14617
  * The index of this cell in its {@link NotebookDocument.cellAt containing notebook}. The
14534
14618
  * index is updated when a cell is moved within its notebook. The index is `-1`
14535
14619
  * when the cell has been removed from its notebook.
14536
- * @stubbed
14537
14620
  */
14538
14621
  readonly index: number;
14539
14622
 
@@ -14544,31 +14627,26 @@ export module '@theia/plugin' {
14544
14627
 
14545
14628
  /**
14546
14629
  * The kind of this cell.
14547
- * @stubbed
14548
14630
  */
14549
14631
  readonly kind: NotebookCellKind;
14550
14632
 
14551
14633
  /**
14552
14634
  * The {@link TextDocument text} of this cell, represented as text document.
14553
- * @stubbed
14554
14635
  */
14555
14636
  readonly document: TextDocument;
14556
14637
 
14557
14638
  /**
14558
14639
  * The metadata of this cell. Can be anything but must be JSON-stringifyable.
14559
- * @stubbed
14560
14640
  */
14561
14641
  readonly metadata: { readonly [key: string]: any };
14562
14642
 
14563
14643
  /**
14564
14644
  * The outputs of this cell.
14565
- * @stubbed
14566
14645
  */
14567
14646
  readonly outputs: readonly NotebookCellOutput[];
14568
14647
 
14569
14648
  /**
14570
14649
  * The most recent {@link NotebookCellExecutionSummary execution summary} for this cell.
14571
- * @stubbed
14572
14650
  */
14573
14651
  readonly executionSummary: NotebookCellExecutionSummary | undefined;
14574
14652
  }
@@ -14584,7 +14662,6 @@ export module '@theia/plugin' {
14584
14662
  *
14585
14663
  * *Note* that most notebooks use the `file`-scheme, which means they are files on disk. However, **not** all notebooks are
14586
14664
  * saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.
14587
- * @stubbed
14588
14665
  *
14589
14666
  * @see {@link FileSystemProvider}
14590
14667
  */
@@ -14592,7 +14669,6 @@ export module '@theia/plugin' {
14592
14669
 
14593
14670
  /**
14594
14671
  * The type of notebook.
14595
- * @stubbed
14596
14672
  */
14597
14673
  readonly notebookType: string;
14598
14674
 
@@ -14620,13 +14696,11 @@ export module '@theia/plugin' {
14620
14696
 
14621
14697
  /**
14622
14698
  * Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.
14623
- * @stubbed
14624
14699
  */
14625
14700
  readonly metadata: { [key: string]: any };
14626
14701
 
14627
14702
  /**
14628
14703
  * The number of cells in the notebook.
14629
- * @stubbed
14630
14704
  */
14631
14705
  readonly cellCount: number;
14632
14706
 
@@ -14635,7 +14709,6 @@ export module '@theia/plugin' {
14635
14709
  *
14636
14710
  * @param index - The index of the cell to retrieve.
14637
14711
  * @return A {@link NotebookCell cell}.
14638
- * @stubbed
14639
14712
  */
14640
14713
  cellAt(index: number): NotebookCell;
14641
14714
 
@@ -14645,7 +14718,6 @@ export module '@theia/plugin' {
14645
14718
  *
14646
14719
  * @param range A notebook range.
14647
14720
  * @returns The cells contained by the range or all cells.
14648
- * @stubbed
14649
14721
  */
14650
14722
  getCells(range?: NotebookRange): NotebookCell[];
14651
14723
 
@@ -14654,7 +14726,6 @@ export module '@theia/plugin' {
14654
14726
  *
14655
14727
  * @return A promise that will resolve to true when the document
14656
14728
  * has been saved. Will return false if the file was not dirty or when save failed.
14657
- * @stubbed
14658
14729
  */
14659
14730
  save(): Thenable<boolean>;
14660
14731
  }
@@ -14668,7 +14739,6 @@ export module '@theia/plugin' {
14668
14739
 
14669
14740
  /**
14670
14741
  * The affected cell.
14671
- * @stubbed
14672
14742
  */
14673
14743
  readonly cell: NotebookCell;
14674
14744
 
@@ -14677,25 +14747,21 @@ export module '@theia/plugin' {
14677
14747
  *
14678
14748
  * *Note* that you should use the {@link workspace.onDidChangeTextDocument onDidChangeTextDocument}-event
14679
14749
  * for detailed change information, like what edits have been performed.
14680
- * @stubbed
14681
14750
  */
14682
14751
  readonly document: TextDocument | undefined;
14683
14752
 
14684
14753
  /**
14685
14754
  * The new metadata of the cell or `undefined` when it did not change.
14686
- * @stubbed
14687
14755
  */
14688
14756
  readonly metadata: { [key: string]: any } | undefined;
14689
14757
 
14690
14758
  /**
14691
14759
  * The new outputs of the cell or `undefined` when they did not change.
14692
- * @stubbed
14693
14760
  */
14694
14761
  readonly outputs: readonly NotebookCellOutput[] | undefined;
14695
14762
 
14696
14763
  /**
14697
14764
  * The new execution summary of the cell or `undefined` when it did not change.
14698
- * @stubbed
14699
14765
  */
14700
14766
  readonly executionSummary: NotebookCellExecutionSummary | undefined;
14701
14767
  }
@@ -14712,19 +14778,16 @@ export module '@theia/plugin' {
14712
14778
  *
14713
14779
  * Note that no cells have been {@link NotebookDocumentContentChange.removedCells removed}
14714
14780
  * when this range is {@link NotebookRange.isEmpty empty}.
14715
- * @stubbed
14716
14781
  */
14717
14782
  readonly range: NotebookRange;
14718
14783
 
14719
14784
  /**
14720
14785
  * Cells that have been added to the document.
14721
- * @stubbed
14722
14786
  */
14723
14787
  readonly addedCells: readonly NotebookCell[];
14724
14788
 
14725
14789
  /**
14726
14790
  * Cells that have been removed from the document.
14727
- * @stubbed
14728
14791
  */
14729
14792
  readonly removedCells: readonly NotebookCell[];
14730
14793
  }
@@ -14736,25 +14799,21 @@ export module '@theia/plugin' {
14736
14799
 
14737
14800
  /**
14738
14801
  * The affected notebook.
14739
- * @stubbed
14740
14802
  */
14741
14803
  readonly notebook: NotebookDocument;
14742
14804
 
14743
14805
  /**
14744
14806
  * The new metadata of the notebook or `undefined` when it did not change.
14745
- * @stubbed
14746
14807
  */
14747
14808
  readonly metadata: { [key: string]: any } | undefined;
14748
14809
 
14749
14810
  /**
14750
14811
  * An array of content changes describing added or removed {@link NotebookCell cells}.
14751
- * @stubbed
14752
14812
  */
14753
14813
  readonly contentChanges: readonly NotebookDocumentContentChange[];
14754
14814
 
14755
14815
  /**
14756
14816
  * An array of {@link NotebookDocumentCellChange cell changes}.
14757
- * @stubbed
14758
14817
  */
14759
14818
  readonly cellChanges: readonly NotebookDocumentCellChange[];
14760
14819
  }
@@ -14769,7 +14828,6 @@ export module '@theia/plugin' {
14769
14828
  export interface NotebookDocumentWillSaveEvent {
14770
14829
  /**
14771
14830
  * A cancellation token.
14772
- * @stubbed
14773
14831
  */
14774
14832
  readonly token: CancellationToken;
14775
14833
 
@@ -14826,19 +14884,16 @@ export module '@theia/plugin' {
14826
14884
 
14827
14885
  /**
14828
14886
  * The order in which the execution happened.
14829
- * @stubbed
14830
14887
  */
14831
14888
  readonly executionOrder?: number;
14832
14889
 
14833
14890
  /**
14834
14891
  * If the execution finished successfully.
14835
- * @stubbed
14836
14892
  */
14837
14893
  readonly success?: boolean;
14838
14894
 
14839
14895
  /**
14840
14896
  * The times at which execution started and ended, as unix timestamps
14841
- * @stubbed
14842
14897
  */
14843
14898
  readonly timing?: { readonly startTime: number; readonly endTime: number };
14844
14899
  }
@@ -14851,19 +14906,16 @@ export module '@theia/plugin' {
14851
14906
 
14852
14907
  /**
14853
14908
  * The zero-based start index of this range.
14854
- * @stubbed
14855
14909
  */
14856
14910
  readonly start: number;
14857
14911
 
14858
14912
  /**
14859
14913
  * The exclusive end index of this range (zero-based).
14860
- * @stubbed
14861
14914
  */
14862
14915
  readonly end: number;
14863
14916
 
14864
14917
  /**
14865
14918
  * `true` if `start` and `end` are equal.
14866
- * @stubbed
14867
14919
  */
14868
14920
  readonly isEmpty: boolean;
14869
14921
 
@@ -14873,7 +14925,6 @@ export module '@theia/plugin' {
14873
14925
  *
14874
14926
  * @param start start index
14875
14927
  * @param end end index.
14876
- * @stubbed
14877
14928
  */
14878
14929
  constructor(start: number, end: number);
14879
14930
 
@@ -14883,7 +14934,6 @@ export module '@theia/plugin' {
14883
14934
  * @param change An object that describes a change to this range.
14884
14935
  * @return A range that reflects the given change. Will return `this` range if the change
14885
14936
  * is not changing anything.
14886
- * @stubbed
14887
14937
  */
14888
14938
  with(change: { start?: number; end?: number }): NotebookRange;
14889
14939
  }
@@ -14987,13 +15037,11 @@ export module '@theia/plugin' {
14987
15037
  * vscode.NotebookCellOutputItem.text('Hey', 'text/plain'), // INVALID: repeated type, editor will pick just one
14988
15038
  * ])
14989
15039
  * ```
14990
- * @stubbed
14991
15040
  */
14992
15041
  items: NotebookCellOutputItem[];
14993
15042
 
14994
15043
  /**
14995
15044
  * Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable.
14996
- * @stubbed
14997
15045
  */
14998
15046
  metadata?: { [key: string]: any };
14999
15047
 
@@ -15002,7 +15050,6 @@ export module '@theia/plugin' {
15002
15050
  *
15003
15051
  * @param items Notebook output items.
15004
15052
  * @param metadata Optional metadata.
15005
- * @stubbed
15006
15053
  */
15007
15054
  constructor(items: NotebookCellOutputItem[], metadata?: { [key: string]: any });
15008
15055
  }
@@ -15014,26 +15061,22 @@ export module '@theia/plugin' {
15014
15061
 
15015
15062
  /**
15016
15063
  * The {@link NotebookCellKind kind} of this cell data.
15017
- * @stubbed
15018
15064
  */
15019
15065
  kind: NotebookCellKind;
15020
15066
 
15021
15067
  /**
15022
15068
  * The source value of this cell data - either source code or formatted text.
15023
- * @stubbed
15024
15069
  */
15025
15070
  value: string;
15026
15071
 
15027
15072
  /**
15028
15073
  * The language identifier of the source value of this cell data. Any value from
15029
15074
  * {@linkcode languages.getLanguages getLanguages} is possible.
15030
- * @stubbed
15031
15075
  */
15032
15076
  languageId: string;
15033
15077
 
15034
15078
  /**
15035
15079
  * The outputs of this cell data.
15036
- * @stubbed
15037
15080
  */
15038
15081
  outputs?: NotebookCellOutput[];
15039
15082
 
@@ -15044,7 +15087,6 @@ export module '@theia/plugin' {
15044
15087
 
15045
15088
  /**
15046
15089
  * The execution summary of this cell data.
15047
- * @stubbed
15048
15090
  */
15049
15091
  executionSummary?: NotebookCellExecutionSummary;
15050
15092
 
@@ -15055,7 +15097,6 @@ export module '@theia/plugin' {
15055
15097
  * @param kind The kind.
15056
15098
  * @param value The source value.
15057
15099
  * @param languageId The language identifier of the source value.
15058
- * @stubbed
15059
15100
  */
15060
15101
  constructor(kind: NotebookCellKind, value: string, languageId: string);
15061
15102
  }
@@ -15071,13 +15112,11 @@ export module '@theia/plugin' {
15071
15112
  export class NotebookData {
15072
15113
  /**
15073
15114
  * The cell data of this notebook data.
15074
- * @stubbed
15075
15115
  */
15076
15116
  cells: NotebookCellData[];
15077
15117
 
15078
15118
  /**
15079
15119
  * Arbitrary metadata of notebook data.
15080
- * @stubbed
15081
15120
  */
15082
15121
  metadata?: { [key: string]: any };
15083
15122
 
@@ -15085,7 +15124,6 @@ export module '@theia/plugin' {
15085
15124
  * Create new notebook data.
15086
15125
  *
15087
15126
  * @param cells An array of cell data.
15088
- * @stubbed
15089
15127
  */
15090
15128
  constructor(cells: NotebookCellData[]);
15091
15129
  }
@@ -15106,7 +15144,6 @@ export module '@theia/plugin' {
15106
15144
  * @param content Contents of a notebook file.
15107
15145
  * @param token A cancellation token.
15108
15146
  * @return Notebook data or a thenable that resolves to such.
15109
- * @stubbed
15110
15147
  */
15111
15148
  deserializeNotebook(content: Uint8Array, token: CancellationToken): NotebookData | Thenable<NotebookData>;
15112
15149
 
@@ -15116,7 +15153,6 @@ export module '@theia/plugin' {
15116
15153
  * @param data A notebook data structure.
15117
15154
  * @param token A cancellation token.
15118
15155
  * @returns An array of bytes or a thenable that resolves to such.
15119
- * @stubbed
15120
15156
  */
15121
15157
  serializeNotebook(data: NotebookData, token: CancellationToken): Uint8Array | Thenable<Uint8Array>;
15122
15158
  }
@@ -15132,7 +15168,6 @@ export module '@theia/plugin' {
15132
15168
  * Controls if output change events will trigger notebook document content change events and
15133
15169
  * if it will be used in the diff editor, defaults to false. If the content provider doesn't
15134
15170
  * persist the outputs in the file document, this should be set to true.
15135
- * @stubbed
15136
15171
  */
15137
15172
  transientOutputs?: boolean;
15138
15173
 
@@ -15141,7 +15176,6 @@ export module '@theia/plugin' {
15141
15176
  * change events and if it will be used in the diff editor, defaults to false. If the
15142
15177
  * content provider doesn't persist a metadata property in the file document, it should be
15143
15178
  * set to true.
15144
- * @stubbed
15145
15179
  */
15146
15180
  transientCellMetadata?: { [key: string]: boolean | undefined };
15147
15181
 
@@ -15150,7 +15184,6 @@ export module '@theia/plugin' {
15150
15184
  * content change event and if it will be used in the diff editor, defaults to false. If the
15151
15185
  * content provider doesn't persist a metadata property in the file document, it should be
15152
15186
  * set to true.
15153
- * @stubbed
15154
15187
  */
15155
15188
  transientDocumentMetadata?: { [key: string]: boolean | undefined };
15156
15189
  }
@@ -15165,13 +15198,11 @@ export module '@theia/plugin' {
15165
15198
  * will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.
15166
15199
  * Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently
15167
15200
  * active one.
15168
- * @stubbed
15169
15201
  */
15170
15202
  readonly viewColumn?: ViewColumn;
15171
15203
 
15172
15204
  /**
15173
15205
  * An optional flag that when `true` will stop the {@link NotebookEditor notebook editor} from taking focus.
15174
- * @stubbed
15175
15206
  */
15176
15207
  readonly preserveFocus?: boolean;
15177
15208
 
@@ -15179,13 +15210,11 @@ export module '@theia/plugin' {
15179
15210
  * An optional flag that controls if an {@link NotebookEditor notebook editor}-tab shows as preview. Preview tabs will
15180
15211
  * be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends
15181
15212
  * on the `workbench.editor.enablePreview`-setting.
15182
- * @stubbed
15183
15213
  */
15184
15214
  readonly preview?: boolean;
15185
15215
 
15186
15216
  /**
15187
15217
  * An optional selection to apply for the document in the {@link NotebookEditor notebook editor}.
15188
- * @stubbed
15189
15218
  */
15190
15219
  readonly selections?: readonly NotebookRange[];
15191
15220
  }
@@ -15248,7 +15277,6 @@ export module '@theia/plugin' {
15248
15277
  *
15249
15278
  * @param range The range of cells to replace
15250
15279
  * @param newCells The new notebook cells.
15251
- * @stubbed
15252
15280
  */
15253
15281
  static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;
15254
15282
 
@@ -15257,7 +15285,6 @@ export module '@theia/plugin' {
15257
15285
  *
15258
15286
  * @param index The index to insert cells at.
15259
15287
  * @param newCells The new notebook cells.
15260
- * @stubbed
15261
15288
  */
15262
15289
  static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;
15263
15290
 
@@ -15265,7 +15292,6 @@ export module '@theia/plugin' {
15265
15292
  * Utility to create an edit that deletes cells in a notebook.
15266
15293
  *
15267
15294
  * @param range The range of cells to delete.
15268
- * @stubbed
15269
15295
  */
15270
15296
  static deleteCells(range: NotebookRange): NotebookEdit;
15271
15297
 
@@ -15274,7 +15300,6 @@ export module '@theia/plugin' {
15274
15300
  *
15275
15301
  * @param index The index of the cell to update.
15276
15302
  * @param newCellMetadata The new metadata for the cell.
15277
- * @stubbed
15278
15303
  */
15279
15304
  static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;
15280
15305
 
@@ -15282,31 +15307,26 @@ export module '@theia/plugin' {
15282
15307
  * Utility to create an edit that updates the notebook's metadata.
15283
15308
  *
15284
15309
  * @param newNotebookMetadata The new metadata for the notebook.
15285
- * @stubbed
15286
15310
  */
15287
15311
  static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;
15288
15312
 
15289
15313
  /**
15290
15314
  * Range of the cells being edited. May be empty.
15291
- * @stubbed
15292
15315
  */
15293
15316
  range: NotebookRange;
15294
15317
 
15295
15318
  /**
15296
15319
  * New cells being inserted. May be empty.
15297
- * @stubbed
15298
15320
  */
15299
15321
  newCells: NotebookCellData[];
15300
15322
 
15301
15323
  /**
15302
15324
  * Optional new metadata for the cells.
15303
- * @stubbed
15304
15325
  */
15305
15326
  newCellMetadata?: { [key: string]: any };
15306
15327
 
15307
15328
  /**
15308
15329
  * Optional new metadata for the notebook.
15309
- * @stubbed
15310
15330
  */
15311
15331
  newNotebookMetadata?: { [key: string]: any };
15312
15332
 
@@ -15319,13 +15339,11 @@ export module '@theia/plugin' {
15319
15339
  export interface NotebookEditorSelectionChangeEvent {
15320
15340
  /**
15321
15341
  * The {@link NotebookEditor notebook editor} for which the selections have changed.
15322
- * @stubbed
15323
15342
  */
15324
15343
  readonly notebookEditor: NotebookEditor;
15325
15344
 
15326
15345
  /**
15327
15346
  * The new value for the {@link NotebookEditor.selections notebook editor's selections}.
15328
- * @stubbed
15329
15347
  */
15330
15348
  readonly selections: readonly NotebookRange[];
15331
15349
  }
@@ -15336,13 +15354,11 @@ export module '@theia/plugin' {
15336
15354
  export interface NotebookEditorVisibleRangesChangeEvent {
15337
15355
  /**
15338
15356
  * The {@link NotebookEditor notebook editor} for which the visible ranges have changed.
15339
- * @stubbed
15340
15357
  */
15341
15358
  readonly notebookEditor: NotebookEditor;
15342
15359
 
15343
15360
  /**
15344
15361
  * The new value for the {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.
15345
- * @stubbed
15346
15362
  */
15347
15363
  readonly visibleRanges: readonly NotebookRange[];
15348
15364
  }
@@ -15383,13 +15399,11 @@ export module '@theia/plugin' {
15383
15399
  *
15384
15400
  * _Note_ that controllers are remembered by their identifier and that extensions should use
15385
15401
  * stable identifiers across sessions.
15386
- * @stubbed
15387
15402
  */
15388
15403
  readonly id: string;
15389
15404
 
15390
15405
  /**
15391
15406
  * The notebook type this controller is for.
15392
- * @stubbed
15393
15407
  */
15394
15408
  readonly notebookType: string;
15395
15409
 
@@ -15407,32 +15421,27 @@ export module '@theia/plugin' {
15407
15421
  * myController.supportedLanguages = undefined; // falsy
15408
15422
  * myController.supportedLanguages = []; // falsy
15409
15423
  * ```
15410
- * @stubbed
15411
15424
  */
15412
15425
  supportedLanguages?: string[];
15413
15426
 
15414
15427
  /**
15415
15428
  * The human-readable label of this notebook controller.
15416
- * @stubbed
15417
15429
  */
15418
15430
  label: string;
15419
15431
 
15420
15432
  /**
15421
15433
  * The human-readable description which is rendered less prominent.
15422
- * @stubbed
15423
15434
  */
15424
15435
  description?: string;
15425
15436
 
15426
15437
  /**
15427
15438
  * The human-readable detail which is rendered less prominent.
15428
- * @stubbed
15429
15439
  */
15430
15440
  detail?: string;
15431
15441
 
15432
15442
  /**
15433
15443
  * Whether this controller supports execution order so that the
15434
15444
  * editor can render placeholders for them.
15435
- * @stubbed
15436
15445
  */
15437
15446
  supportsExecutionOrder?: boolean;
15438
15447
 
@@ -15448,14 +15457,12 @@ export module '@theia/plugin' {
15448
15457
  *
15449
15458
  * @param cell The notebook cell for which to create the execution.
15450
15459
  * @returns A notebook cell execution.
15451
- * @stubbed
15452
15460
  */
15453
15461
  createNotebookCellExecution(cell: NotebookCell): NotebookCellExecution;
15454
15462
 
15455
15463
  /**
15456
15464
  * The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All,
15457
15465
  * Run Selection etc. The execute handler is responsible for creating and managing {@link NotebookCellExecution execution}-objects.
15458
- * @stubbed
15459
15466
  */
15460
15467
  executeHandler: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>;
15461
15468
 
@@ -15470,7 +15477,6 @@ export module '@theia/plugin' {
15470
15477
  *
15471
15478
  * _Note_ that supporting {@link NotebookCellExecution.token cancellation tokens} is preferred and that interrupt handlers should
15472
15479
  * only be used when tokens cannot be supported.
15473
- * @stubbed
15474
15480
  */
15475
15481
  interruptHandler?: (notebook: NotebookDocument) => void | Thenable<void>;
15476
15482
 
@@ -15483,7 +15489,6 @@ export module '@theia/plugin' {
15483
15489
  *
15484
15490
  * _Note_ that controller selection is persisted (by the controllers {@link NotebookController.id id}) and restored as soon as a
15485
15491
  * controller is re-created or as a notebook is {@link workspace.onDidOpenNotebookDocument opened}.
15486
- * @stubbed
15487
15492
  */
15488
15493
  readonly onDidChangeSelectedNotebooks: Event<{ readonly notebook: NotebookDocument; readonly selected: boolean }>;
15489
15494
 
@@ -15493,13 +15498,11 @@ export module '@theia/plugin' {
15493
15498
  *
15494
15499
  * @param notebook The notebook for which a priority is set.
15495
15500
  * @param affinity A controller affinity
15496
- * @stubbed
15497
15501
  */
15498
15502
  updateNotebookAffinity(notebook: NotebookDocument, affinity: NotebookControllerAffinity): void;
15499
15503
 
15500
15504
  /**
15501
15505
  * Dispose and free associated resources.
15502
- * @stubbed
15503
15506
  */
15504
15507
  dispose(): void;
15505
15508
  }
@@ -15516,7 +15519,6 @@ export module '@theia/plugin' {
15516
15519
 
15517
15520
  /**
15518
15521
  * The {@link NotebookCell cell} for which this execution has been created.
15519
- * @stubbed
15520
15522
  */
15521
15523
  readonly cell: NotebookCell;
15522
15524
 
@@ -15526,13 +15528,11 @@ export module '@theia/plugin' {
15526
15528
  *
15527
15529
  * _Note_ that the cancellation token will not be triggered when the {@link NotebookController controller}
15528
15530
  * that created this execution uses an {@link NotebookController.interruptHandler interrupt-handler}.
15529
- * @stubbed
15530
15531
  */
15531
15532
  readonly token: CancellationToken;
15532
15533
 
15533
15534
  /**
15534
15535
  * Set and unset the order of this cell execution.
15535
- * @stubbed
15536
15536
  */
15537
15537
  executionOrder: number | undefined;
15538
15538
 
@@ -15541,7 +15541,6 @@ export module '@theia/plugin' {
15541
15541
  *
15542
15542
  * @param startTime The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock
15543
15543
  * that shows for how long a cell has been running. If not given, the clock won't be shown.
15544
- * @stubbed
15545
15544
  */
15546
15545
  start(startTime?: number): void;
15547
15546
 
@@ -15552,7 +15551,6 @@ export module '@theia/plugin' {
15552
15551
  * If false, a red X is shown.
15553
15552
  * If undefined, no check or X icon is shown.
15554
15553
  * @param endTime The time that execution finished, in milliseconds in the Unix epoch.
15555
- * @stubbed
15556
15554
  */
15557
15555
  end(success: boolean | undefined, endTime?: number): void;
15558
15556
 
@@ -15562,7 +15560,6 @@ export module '@theia/plugin' {
15562
15560
  * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
15563
15561
  * this execution.
15564
15562
  * @return A thenable that resolves when the operation finished.
15565
- * @stubbed
15566
15563
  */
15567
15564
  clearOutput(cell?: NotebookCell): Thenable<void>;
15568
15565
 
@@ -15573,7 +15570,6 @@ export module '@theia/plugin' {
15573
15570
  * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
15574
15571
  * this execution.
15575
15572
  * @return A thenable that resolves when the operation finished.
15576
- * @stubbed
15577
15573
  */
15578
15574
  replaceOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;
15579
15575
 
@@ -15584,7 +15580,6 @@ export module '@theia/plugin' {
15584
15580
  * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
15585
15581
  * this execution.
15586
15582
  * @return A thenable that resolves when the operation finished.
15587
- * @stubbed
15588
15583
  */
15589
15584
  appendOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;
15590
15585
 
@@ -15594,7 +15589,6 @@ export module '@theia/plugin' {
15594
15589
  * @param items Output items that replace the items of existing output.
15595
15590
  * @param output Output object that already exists.
15596
15591
  * @return A thenable that resolves when the operation finished.
15597
- * @stubbed
15598
15592
  */
15599
15593
  replaceOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;
15600
15594
 
@@ -15604,7 +15598,6 @@ export module '@theia/plugin' {
15604
15598
  * @param items Output items that are append to existing output.
15605
15599
  * @param output Output object that already exists.
15606
15600
  * @return A thenable that resolves when the operation finished.
15607
- * @stubbed
15608
15601
  */
15609
15602
  appendOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;
15610
15603
  }
@@ -15631,7 +15624,6 @@ export module '@theia/plugin' {
15631
15624
  export class NotebookCellStatusBarItem {
15632
15625
  /**
15633
15626
  * The text to show for the item.
15634
- * @stubbed
15635
15627
  */
15636
15628
  text: string;
15637
15629
 
@@ -15648,25 +15640,21 @@ export module '@theia/plugin' {
15648
15640
  *
15649
15641
  * Note that if this is a {@linkcode Command} object, only the {@linkcode Command.command command} and {@linkcode Command.arguments arguments}
15650
15642
  * are used by the editor.
15651
- * @stubbed
15652
15643
  */
15653
15644
  command?: string | Command;
15654
15645
 
15655
15646
  /**
15656
15647
  * A tooltip to show when the item is hovered.
15657
- * @stubbed
15658
15648
  */
15659
15649
  tooltip?: string;
15660
15650
 
15661
15651
  /**
15662
15652
  * The priority of the item. A higher value item will be shown more to the left.
15663
- * @stubbed
15664
15653
  */
15665
15654
  priority?: number;
15666
15655
 
15667
15656
  /**
15668
15657
  * Accessibility information used when a screen reader interacts with this item.
15669
- * @stubbed
15670
15658
  */
15671
15659
  accessibilityInformation?: AccessibilityInformation;
15672
15660
 
@@ -15674,7 +15662,6 @@ export module '@theia/plugin' {
15674
15662
  * Creates a new NotebookCellStatusBarItem.
15675
15663
  * @param text The text to show for the item.
15676
15664
  * @param alignment Whether the item is aligned to the left or right.
15677
- * @stubbed
15678
15665
  */
15679
15666
  constructor(text: string, alignment: NotebookCellStatusBarAlignment);
15680
15667
  }
@@ -15685,7 +15672,6 @@ export module '@theia/plugin' {
15685
15672
  export interface NotebookCellStatusBarItemProvider {
15686
15673
  /**
15687
15674
  * An optional event to signal that statusbar items have changed. The provide method will be called again.
15688
- * @stubbed
15689
15675
  */
15690
15676
  onDidChangeCellStatusBarItems?: Event<void>;
15691
15677
 
@@ -15694,7 +15680,6 @@ export module '@theia/plugin' {
15694
15680
  * @param cell The cell for which to return items.
15695
15681
  * @param token A token triggered if this request should be cancelled.
15696
15682
  * @return One or more {@link NotebookCellStatusBarItem cell statusbar items}
15697
- * @stubbed
15698
15683
  */
15699
15684
  provideCellStatusBarItems(cell: NotebookCell, token: CancellationToken): ProviderResult<NotebookCellStatusBarItem | NotebookCellStatusBarItem[]>;
15700
15685
  }
@@ -15716,7 +15701,6 @@ export module '@theia/plugin' {
15716
15701
  * @param label The label of the controller.
15717
15702
  * @param handler The execute-handler of the controller.
15718
15703
  * @returns a new instance of {@link NotebookController}
15719
- * @stubbed
15720
15704
  */
15721
15705
  export function createNotebookController(
15722
15706
  id: string,
@@ -15732,7 +15716,6 @@ export module '@theia/plugin' {
15732
15716
  * - Note 2: A renderer only has access to messaging if requiresMessaging is set to always or optional in its notebookRenderer contribution.
15733
15717
  * @param rendererId The renderer ID to communicate with
15734
15718
  * @returns A new notebook renderer messaging object.
15735
- * @stubbed
15736
15719
  */
15737
15720
  export function createRendererMessaging(rendererId: string): NotebookRendererMessaging;
15738
15721
 
@@ -15741,630 +15724,629 @@ export module '@theia/plugin' {
15741
15724
  * @param notebookType The notebook type to register for.
15742
15725
  * @param provider A cell status bar provider.
15743
15726
  * @returns A Disposable that unregisters this provider when being disposed.
15744
- * @stubbed
15745
15727
  */
15746
15728
  export function registerNotebookCellStatusBarItemProvider(notebookType: string, provider: NotebookCellStatusBarItemProvider): Disposable;
15747
15729
  }
15748
- }
15749
-
15750
- /**
15751
- * Namespace for testing functionality. Tests are published by registering
15752
- * {@link TestController} instances, then adding {@link TestItem TestItems}.
15753
- * Controllers may also describe how to run tests by creating one or more
15754
- * {@link TestRunProfile} instances.
15755
- */
15756
- export namespace tests {
15757
- /**
15758
- * Creates a new test controller.
15759
- *
15760
- * @param id Identifier for the controller, must be globally unique.
15761
- * @param label A human-readable label for the controller.
15762
- * @returns An instance of the {@link TestController}.
15763
- * @stubbed
15764
- */
15765
- export function createTestController(id: string, label: string): TestController;
15766
- }
15767
-
15768
- /**
15769
- * The kind of executions that {@link TestRunProfile TestRunProfiles} control.
15770
- */
15771
- export enum TestRunProfileKind {
15772
- Run = 1,
15773
- Debug = 2,
15774
- Coverage = 3,
15775
- }
15776
15730
 
15777
- /**
15778
- * Tags can be associated with {@link TestItem TestItems} and
15779
- * {@link TestRunProfile TestRunProfiles}. A profile with a tag can only
15780
- * execute tests that include that tag in their {@link TestItem.tags} array.
15781
- */
15782
- export class TestTag {
15783
15731
  /**
15784
- * ID of the test tag. `TestTag` instances with the same ID are considered
15785
- * to be identical.
15732
+ * Namespace for testing functionality. Tests are published by registering
15733
+ * {@link TestController} instances, then adding {@link TestItem TestItems}.
15734
+ * Controllers may also describe how to run tests by creating one or more
15735
+ * {@link TestRunProfile} instances.
15786
15736
  */
15787
- readonly id: string;
15737
+ export namespace tests {
15738
+ /**
15739
+ * Creates a new test controller.
15740
+ *
15741
+ * @param id Identifier for the controller, must be globally unique.
15742
+ * @param label A human-readable label for the controller.
15743
+ * @returns An instance of the {@link TestController}.
15744
+ * @stubbed
15745
+ */
15746
+ export function createTestController(id: string, label: string): TestController;
15747
+ }
15788
15748
 
15789
15749
  /**
15790
- * Creates a new TestTag instance.
15791
- * @param id ID of the test tag.
15750
+ * The kind of executions that {@link TestRunProfile TestRunProfiles} control.
15792
15751
  */
15793
- constructor(id: string);
15794
- }
15752
+ export enum TestRunProfileKind {
15753
+ Run = 1,
15754
+ Debug = 2,
15755
+ Coverage = 3,
15756
+ }
15795
15757
 
15796
- /**
15797
- * A TestRunProfile describes one way to execute tests in a {@link TestController}.
15798
- */
15799
- export interface TestRunProfile {
15800
15758
  /**
15801
- * Label shown to the user in the UI.
15802
- *
15803
- * Note that the label has some significance if the user requests that
15804
- * tests be re-run in a certain way. For example, if tests were run
15805
- * normally and the user requests to re-run them in debug mode, the editor
15806
- * will attempt use a configuration with the same label of the `Debug`
15807
- * kind. If there is no such configuration, the default will be used.
15808
- * @stubbed
15759
+ * Tags can be associated with {@link TestItem TestItems} and
15760
+ * {@link TestRunProfile TestRunProfiles}. A profile with a tag can only
15761
+ * execute tests that include that tag in their {@link TestItem.tags} array.
15809
15762
  */
15810
- label: string;
15763
+ export class TestTag {
15764
+ /**
15765
+ * ID of the test tag. `TestTag` instances with the same ID are considered
15766
+ * to be identical.
15767
+ */
15768
+ readonly id: string;
15811
15769
 
15812
- /**
15813
- * Configures what kind of execution this profile controls. If there
15814
- * are no profiles for a kind, it will not be available in the UI.
15815
- * @stubbed
15816
- */
15817
- readonly kind: TestRunProfileKind;
15770
+ /**
15771
+ * Creates a new TestTag instance.
15772
+ * @param id ID of the test tag.
15773
+ */
15774
+ constructor(id: string);
15775
+ }
15818
15776
 
15819
15777
  /**
15820
- * Controls whether this profile is the default action that will
15821
- * be taken when its kind is actioned. For example, if the user clicks
15822
- * the generic "run all" button, then the default profile for
15823
- * {@link TestRunProfileKind.Run} will be executed, although the
15824
- * user can configure this.
15825
- * @stubbed
15778
+ * A TestRunProfile describes one way to execute tests in a {@link TestController}.
15826
15779
  */
15827
- isDefault: boolean;
15780
+ export interface TestRunProfile {
15781
+ /**
15782
+ * Label shown to the user in the UI.
15783
+ *
15784
+ * Note that the label has some significance if the user requests that
15785
+ * tests be re-run in a certain way. For example, if tests were run
15786
+ * normally and the user requests to re-run them in debug mode, the editor
15787
+ * will attempt use a configuration with the same label of the `Debug`
15788
+ * kind. If there is no such configuration, the default will be used.
15789
+ * @stubbed
15790
+ */
15791
+ label: string;
15828
15792
 
15829
- /**
15830
- * Whether this profile supports continuous running of requests. If so,
15831
- * then {@link TestRunRequest.continuous} may be set to `true`. Defaults
15832
- * to false.
15833
- * @stubbed
15834
- */
15835
- supportsContinuousRun: boolean;
15793
+ /**
15794
+ * Configures what kind of execution this profile controls. If there
15795
+ * are no profiles for a kind, it will not be available in the UI.
15796
+ * @stubbed
15797
+ */
15798
+ readonly kind: TestRunProfileKind;
15836
15799
 
15837
- /**
15838
- * Associated tag for the profile. If this is set, only {@link TestItem}
15839
- * instances with the same tag will be eligible to execute in this profile.
15840
- * @stubbed
15841
- */
15842
- tag: TestTag | undefined;
15800
+ /**
15801
+ * Controls whether this profile is the default action that will
15802
+ * be taken when its kind is actioned. For example, if the user clicks
15803
+ * the generic "run all" button, then the default profile for
15804
+ * {@link TestRunProfileKind.Run} will be executed, although the
15805
+ * user can configure this.
15806
+ * @stubbed
15807
+ */
15808
+ isDefault: boolean;
15843
15809
 
15844
- /**
15845
- * If this method is present, a configuration gear will be present in the
15846
- * UI, and this method will be invoked when it's clicked. When called,
15847
- * you can take other editor actions, such as showing a quick pick or
15848
- * opening a configuration file.
15849
- * @stubbed
15850
- */
15851
- configureHandler: (() => void) | undefined;
15810
+ /**
15811
+ * Whether this profile supports continuous running of requests. If so,
15812
+ * then {@link TestRunRequest.continuous} may be set to `true`. Defaults
15813
+ * to false.
15814
+ * @stubbed
15815
+ */
15816
+ supportsContinuousRun: boolean;
15852
15817
 
15853
- /**
15854
- * Handler called to start a test run. When invoked, the function should call
15855
- * {@link TestController.createTestRun} at least once, and all test runs
15856
- * associated with the request should be created before the function returns
15857
- * or the returned promise is resolved.
15858
- *
15859
- * If {@link supportsContinuousRun} is set, then {@link TestRunRequest.continuous}
15860
- * may be `true`. In this case, the profile should observe changes to
15861
- * source code and create new test runs by calling {@link TestController.createTestRun},
15862
- * until the cancellation is requested on the `token`.
15863
- *
15864
- * @param request Request information for the test run.
15865
- * @param cancellationToken Token that signals the used asked to abort the
15866
- * test run. If cancellation is requested on this token, all {@link TestRun}
15867
- * instances associated with the request will be
15868
- * automatically cancelled as well.
15869
- * @stubbed
15870
- */
15871
- runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void;
15818
+ /**
15819
+ * Associated tag for the profile. If this is set, only {@link TestItem}
15820
+ * instances with the same tag will be eligible to execute in this profile.
15821
+ * @stubbed
15822
+ */
15823
+ tag: TestTag | undefined;
15872
15824
 
15873
- /**
15874
- * Deletes the run profile.
15875
- * @stubbed
15876
- */
15877
- dispose(): void;
15878
- }
15825
+ /**
15826
+ * If this method is present, a configuration gear will be present in the
15827
+ * UI, and this method will be invoked when it's clicked. When called,
15828
+ * you can take other editor actions, such as showing a quick pick or
15829
+ * opening a configuration file.
15830
+ * @stubbed
15831
+ */
15832
+ configureHandler: (() => void) | undefined;
15879
15833
 
15880
- /**
15881
- * Entry point to discover and execute tests. It contains {@link TestController.items} which
15882
- * are used to populate the editor UI, and is associated with
15883
- * {@link TestController.createRunProfile run profiles} to allow
15884
- * for tests to be executed.
15885
- */
15886
- export interface TestController {
15887
- /**
15888
- * The id of the controller passed in {@link vscode.tests.createTestController}.
15889
- * This must be globally unique.
15890
- * @stubbed
15891
- */
15892
- readonly id: string;
15834
+ /**
15835
+ * Handler called to start a test run. When invoked, the function should call
15836
+ * {@link TestController.createTestRun} at least once, and all test runs
15837
+ * associated with the request should be created before the function returns
15838
+ * or the returned promise is resolved.
15839
+ *
15840
+ * If {@link supportsContinuousRun} is set, then {@link TestRunRequest.continuous}
15841
+ * may be `true`. In this case, the profile should observe changes to
15842
+ * source code and create new test runs by calling {@link TestController.createTestRun},
15843
+ * until the cancellation is requested on the `token`.
15844
+ *
15845
+ * @param request Request information for the test run.
15846
+ * @param cancellationToken Token that signals the used asked to abort the
15847
+ * test run. If cancellation is requested on this token, all {@link TestRun}
15848
+ * instances associated with the request will be
15849
+ * automatically cancelled as well.
15850
+ * @stubbed
15851
+ */
15852
+ runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void;
15893
15853
 
15894
- /**
15895
- * Human-readable label for the test controller.
15896
- * @stubbed
15897
- */
15898
- label: string;
15854
+ /**
15855
+ * Deletes the run profile.
15856
+ * @stubbed
15857
+ */
15858
+ dispose(): void;
15859
+ }
15899
15860
 
15900
15861
  /**
15901
- * A collection of "top-level" {@link TestItem} instances, which can in
15902
- * turn have their own {@link TestItem.children children} to form the
15903
- * "test tree."
15904
- *
15905
- * The extension controls when to add tests. For example, extensions should
15906
- * add tests for a file when {@link vscode.workspace.onDidOpenTextDocument}
15907
- * fires in order for decorations for tests within a file to be visible.
15908
- *
15909
- * However, the editor may sometimes explicitly request children using the
15910
- * {@link resolveHandler} See the documentation on that method for more details.
15911
- * @stubbed
15862
+ * Entry point to discover and execute tests. It contains {@link TestController.items} which
15863
+ * are used to populate the editor UI, and is associated with
15864
+ * {@link TestController.createRunProfile run profiles} to allow
15865
+ * for tests to be executed.
15912
15866
  */
15913
- readonly items: TestItemCollection;
15867
+ export interface TestController {
15868
+ /**
15869
+ * The id of the controller passed in {@link vscode.tests.createTestController}.
15870
+ * This must be globally unique.
15871
+ * @stubbed
15872
+ */
15873
+ readonly id: string;
15914
15874
 
15915
- /**
15916
- * Creates a profile used for running tests. Extensions must create
15917
- * at least one profile in order for tests to be run.
15918
- * @param label A human-readable label for this profile.
15919
- * @param kind Configures what kind of execution this profile manages.
15920
- * @param runHandler Function called to start a test run.
15921
- * @param isDefault Whether this is the default action for its kind.
15922
- * @param tag Profile test tag.
15923
- * @param supportsContinuousRun Whether the profile supports continuous running.
15924
- * @returns An instance of a {@link TestRunProfile}, which is automatically
15925
- * associated with this controller.
15926
- * @stubbed
15927
- */
15928
- createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void, isDefault?: boolean, tag?: TestTag, supportsContinuousRun?: boolean): TestRunProfile;
15875
+ /**
15876
+ * Human-readable label for the test controller.
15877
+ * @stubbed
15878
+ */
15879
+ label: string;
15929
15880
 
15930
- /**
15931
- * A function provided by the extension that the editor may call to request
15932
- * children of a test item, if the {@link TestItem.canResolveChildren} is
15933
- * `true`. When called, the item should discover children and call
15934
- * {@link vscode.tests.createTestItem} as children are discovered.
15935
- *
15936
- * Generally the extension manages the lifecycle of test items, but under
15937
- * certain conditions the editor may request the children of a specific
15938
- * item to be loaded. For example, if the user requests to re-run tests
15939
- * after reloading the editor, the editor may need to call this method
15940
- * to resolve the previously-run tests.
15941
- *
15942
- * The item in the explorer will automatically be marked as "busy" until
15943
- * the function returns or the returned thenable resolves.
15944
- *
15945
- * @param item An unresolved test item for which children are being
15946
- * requested, or `undefined` to resolve the controller's initial {@link TestController.items items}.
15947
- * @stubbed
15948
- */
15949
- resolveHandler?: (item: TestItem | undefined) => Thenable<void> | void;
15881
+ /**
15882
+ * A collection of "top-level" {@link TestItem} instances, which can in
15883
+ * turn have their own {@link TestItem.children children} to form the
15884
+ * "test tree."
15885
+ *
15886
+ * The extension controls when to add tests. For example, extensions should
15887
+ * add tests for a file when {@link vscode.workspace.onDidOpenTextDocument}
15888
+ * fires in order for decorations for tests within a file to be visible.
15889
+ *
15890
+ * However, the editor may sometimes explicitly request children using the
15891
+ * {@link resolveHandler} See the documentation on that method for more details.
15892
+ * @stubbed
15893
+ */
15894
+ readonly items: TestItemCollection;
15950
15895
 
15951
- /**
15952
- * If this method is present, a refresh button will be present in the
15953
- * UI, and this method will be invoked when it's clicked. When called,
15954
- * the extension should scan the workspace for any new, changed, or
15955
- * removed tests.
15956
- *
15957
- * It's recommended that extensions try to update tests in realtime, using
15958
- * a {@link FileSystemWatcher} for example, and use this method as a fallback.
15959
- *
15960
- * @returns A thenable that resolves when tests have been refreshed.
15961
- * @stubbed
15962
- */
15963
- refreshHandler: ((token: CancellationToken) => Thenable<void> | void) | undefined;
15896
+ /**
15897
+ * Creates a profile used for running tests. Extensions must create
15898
+ * at least one profile in order for tests to be run.
15899
+ * @param label A human-readable label for this profile.
15900
+ * @param kind Configures what kind of execution this profile manages.
15901
+ * @param runHandler Function called to start a test run.
15902
+ * @param isDefault Whether this is the default action for its kind.
15903
+ * @param tag Profile test tag.
15904
+ * @param supportsContinuousRun Whether the profile supports continuous running.
15905
+ * @returns An instance of a {@link TestRunProfile}, which is automatically
15906
+ * associated with this controller.
15907
+ * @stubbed
15908
+ */
15909
+ createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void, isDefault?: boolean, tag?: TestTag, supportsContinuousRun?: boolean): TestRunProfile;
15964
15910
 
15965
- /**
15966
- * Creates a {@link TestRun}. This should be called by the
15967
- * {@link TestRunProfile} when a request is made to execute tests, and may
15968
- * also be called if a test run is detected externally. Once created, tests
15969
- * that are included in the request will be moved into the queued state.
15970
- *
15971
- * All runs created using the same `request` instance will be grouped
15972
- * together. This is useful if, for example, a single suite of tests is
15973
- * run on multiple platforms.
15974
- *
15975
- * @param request Test run request. Only tests inside the `include` may be
15976
- * modified, and tests in its `exclude` are ignored.
15977
- * @param name The human-readable name of the run. This can be used to
15978
- * disambiguate multiple sets of results in a test run. It is useful if
15979
- * tests are run across multiple platforms, for example.
15980
- * @param persist Whether the results created by the run should be
15981
- * persisted in the editor. This may be false if the results are coming from
15982
- * a file already saved externally, such as a coverage information file.
15983
- * @returns An instance of the {@link TestRun}. It will be considered "running"
15984
- * from the moment this method is invoked until {@link TestRun.end} is called.
15985
- * @stubbed
15986
- */
15987
- createTestRun(request: TestRunRequest, name?: string, persist?: boolean): TestRun;
15988
-
15989
- /**
15990
- * Creates a new managed {@link TestItem} instance. It can be added into
15991
- * the {@link TestItem.children} of an existing item, or into the
15992
- * {@link TestController.items}.
15993
- *
15994
- * @param id Identifier for the TestItem. The test item's ID must be unique
15995
- * in the {@link TestItemCollection} it's added to.
15996
- * @param label Human-readable label of the test item.
15997
- * @param uri URI this TestItem is associated with. May be a file or directory.
15998
- * @stubbed
15999
- */
16000
- createTestItem(id: string, label: string, uri?: Uri): TestItem;
15911
+ /**
15912
+ * A function provided by the extension that the editor may call to request
15913
+ * children of a test item, if the {@link TestItem.canResolveChildren} is
15914
+ * `true`. When called, the item should discover children and call
15915
+ * {@link vscode.tests.createTestItem} as children are discovered.
15916
+ *
15917
+ * Generally the extension manages the lifecycle of test items, but under
15918
+ * certain conditions the editor may request the children of a specific
15919
+ * item to be loaded. For example, if the user requests to re-run tests
15920
+ * after reloading the editor, the editor may need to call this method
15921
+ * to resolve the previously-run tests.
15922
+ *
15923
+ * The item in the explorer will automatically be marked as "busy" until
15924
+ * the function returns or the returned thenable resolves.
15925
+ *
15926
+ * @param item An unresolved test item for which children are being
15927
+ * requested, or `undefined` to resolve the controller's initial {@link TestController.items items}.
15928
+ * @stubbed
15929
+ */
15930
+ resolveHandler?: (item: TestItem | undefined) => Thenable<void> | void;
16001
15931
 
16002
- /**
16003
- * Unregisters the test controller, disposing of its associated tests
16004
- * and unpersisted results.
16005
- * @stubbed
16006
- */
16007
- dispose(): void;
16008
- }
15932
+ /**
15933
+ * If this method is present, a refresh button will be present in the
15934
+ * UI, and this method will be invoked when it's clicked. When called,
15935
+ * the extension should scan the workspace for any new, changed, or
15936
+ * removed tests.
15937
+ *
15938
+ * It's recommended that extensions try to update tests in realtime, using
15939
+ * a {@link FileSystemWatcher} for example, and use this method as a fallback.
15940
+ *
15941
+ * @returns A thenable that resolves when tests have been refreshed.
15942
+ * @stubbed
15943
+ */
15944
+ refreshHandler: ((token: CancellationToken) => Thenable<void> | void) | undefined;
16009
15945
 
16010
- /**
16011
- * A TestRunRequest is a precursor to a {@link TestRun}, which in turn is
16012
- * created by passing a request to {@link tests.runTests}. The TestRunRequest
16013
- * contains information about which tests should be run, which should not be
16014
- * run, and how they are run (via the {@link TestRunRequest.profile profile}).
16015
- *
16016
- * In general, TestRunRequests are created by the editor and pass to
16017
- * {@link TestRunProfile.runHandler}, however you can also create test
16018
- * requests and runs outside of the `runHandler`.
16019
- */
16020
- export class TestRunRequest {
16021
- /**
16022
- * A filter for specific tests to run. If given, the extension should run
16023
- * all of the included tests and all their children, excluding any tests
16024
- * that appear in {@link TestRunRequest.exclude}. If this property is
16025
- * undefined, then the extension should simply run all tests.
16026
- *
16027
- * The process of running tests should resolve the children of any test
16028
- * items who have not yet been resolved.
16029
- */
16030
- readonly include: readonly TestItem[] | undefined;
15946
+ /**
15947
+ * Creates a {@link TestRun}. This should be called by the
15948
+ * {@link TestRunProfile} when a request is made to execute tests, and may
15949
+ * also be called if a test run is detected externally. Once created, tests
15950
+ * that are included in the request will be moved into the queued state.
15951
+ *
15952
+ * All runs created using the same `request` instance will be grouped
15953
+ * together. This is useful if, for example, a single suite of tests is
15954
+ * run on multiple platforms.
15955
+ *
15956
+ * @param request Test run request. Only tests inside the `include` may be
15957
+ * modified, and tests in its `exclude` are ignored.
15958
+ * @param name The human-readable name of the run. This can be used to
15959
+ * disambiguate multiple sets of results in a test run. It is useful if
15960
+ * tests are run across multiple platforms, for example.
15961
+ * @param persist Whether the results created by the run should be
15962
+ * persisted in the editor. This may be false if the results are coming from
15963
+ * a file already saved externally, such as a coverage information file.
15964
+ * @returns An instance of the {@link TestRun}. It will be considered "running"
15965
+ * from the moment this method is invoked until {@link TestRun.end} is called.
15966
+ * @stubbed
15967
+ */
15968
+ createTestRun(request: TestRunRequest, name?: string, persist?: boolean): TestRun;
15969
+
15970
+ /**
15971
+ * Creates a new managed {@link TestItem} instance. It can be added into
15972
+ * the {@link TestItem.children} of an existing item, or into the
15973
+ * {@link TestController.items}.
15974
+ *
15975
+ * @param id Identifier for the TestItem. The test item's ID must be unique
15976
+ * in the {@link TestItemCollection} it's added to.
15977
+ * @param label Human-readable label of the test item.
15978
+ * @param uri URI this TestItem is associated with. May be a file or directory.
15979
+ * @stubbed
15980
+ */
15981
+ createTestItem(id: string, label: string, uri?: Uri): TestItem;
15982
+
15983
+ /**
15984
+ * Unregisters the test controller, disposing of its associated tests
15985
+ * and unpersisted results.
15986
+ * @stubbed
15987
+ */
15988
+ dispose(): void;
15989
+ }
16031
15990
 
16032
15991
  /**
16033
- * An array of tests the user has marked as excluded from the test included
16034
- * in this run; exclusions should apply after inclusions.
15992
+ * A TestRunRequest is a precursor to a {@link TestRun}, which in turn is
15993
+ * created by passing a request to {@link tests.runTests}. The TestRunRequest
15994
+ * contains information about which tests should be run, which should not be
15995
+ * run, and how they are run (via the {@link TestRunRequest.profile profile}).
16035
15996
  *
16036
- * May be omitted if no exclusions were requested. Test controllers should
16037
- * not run excluded tests or any children of excluded tests.
15997
+ * In general, TestRunRequests are created by the editor and pass to
15998
+ * {@link TestRunProfile.runHandler}, however you can also create test
15999
+ * requests and runs outside of the `runHandler`.
16038
16000
  */
16039
- readonly exclude: readonly TestItem[] | undefined;
16001
+ export class TestRunRequest {
16002
+ /**
16003
+ * A filter for specific tests to run. If given, the extension should run
16004
+ * all of the included tests and all their children, excluding any tests
16005
+ * that appear in {@link TestRunRequest.exclude}. If this property is
16006
+ * undefined, then the extension should simply run all tests.
16007
+ *
16008
+ * The process of running tests should resolve the children of any test
16009
+ * items who have not yet been resolved.
16010
+ */
16011
+ readonly include: readonly TestItem[] | undefined;
16040
16012
 
16041
- /**
16042
- * The profile used for this request. This will always be defined
16043
- * for requests issued from the editor UI, though extensions may
16044
- * programmatically create requests not associated with any profile.
16045
- */
16046
- readonly profile: TestRunProfile | undefined;
16013
+ /**
16014
+ * An array of tests the user has marked as excluded from the test included
16015
+ * in this run; exclusions should apply after inclusions.
16016
+ *
16017
+ * May be omitted if no exclusions were requested. Test controllers should
16018
+ * not run excluded tests or any children of excluded tests.
16019
+ */
16020
+ readonly exclude: readonly TestItem[] | undefined;
16047
16021
 
16048
- /**
16049
- * Whether the profile should run continuously as source code changes. Only
16050
- * relevant for profiles that set {@link TestRunProfile.supportsContinuousRun}.
16051
- */
16052
- readonly continuous?: boolean;
16022
+ /**
16023
+ * The profile used for this request. This will always be defined
16024
+ * for requests issued from the editor UI, though extensions may
16025
+ * programmatically create requests not associated with any profile.
16026
+ */
16027
+ readonly profile: TestRunProfile | undefined;
16053
16028
 
16054
- /**
16055
- * @param include Array of specific tests to run, or undefined to run all tests
16056
- * @param exclude An array of tests to exclude from the run.
16057
- * @param profile The run profile used for this request.
16058
- * @param continuous Whether to run tests continuously as source changes.
16059
- */
16060
- constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean);
16061
- }
16029
+ /**
16030
+ * Whether the profile should run continuously as source code changes. Only
16031
+ * relevant for profiles that set {@link TestRunProfile.supportsContinuousRun}.
16032
+ */
16033
+ readonly continuous?: boolean;
16062
16034
 
16063
- /**
16064
- * Options given to {@link TestController.runTests}
16065
- */
16066
- export interface TestRun {
16067
- /**
16068
- * The human-readable name of the run. This can be used to
16069
- * disambiguate multiple sets of results in a test run. It is useful if
16070
- * tests are run across multiple platforms, for example.
16071
- * @stubbed
16072
- */
16073
- readonly name: string | undefined;
16035
+ /**
16036
+ * @param include Array of specific tests to run, or undefined to run all tests
16037
+ * @param exclude An array of tests to exclude from the run.
16038
+ * @param profile The run profile used for this request.
16039
+ * @param continuous Whether to run tests continuously as source changes.
16040
+ */
16041
+ constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean);
16042
+ }
16074
16043
 
16075
16044
  /**
16076
- * A cancellation token which will be triggered when the test run is
16077
- * canceled from the UI.
16078
- * @stubbed
16045
+ * Options given to {@link TestController.runTests}
16079
16046
  */
16080
- readonly token: CancellationToken;
16047
+ export interface TestRun {
16048
+ /**
16049
+ * The human-readable name of the run. This can be used to
16050
+ * disambiguate multiple sets of results in a test run. It is useful if
16051
+ * tests are run across multiple platforms, for example.
16052
+ * @stubbed
16053
+ */
16054
+ readonly name: string | undefined;
16081
16055
 
16082
- /**
16083
- * Whether the test run will be persisted across reloads by the editor.
16084
- * @stubbed
16085
- */
16086
- readonly isPersisted: boolean;
16056
+ /**
16057
+ * A cancellation token which will be triggered when the test run is
16058
+ * canceled from the UI.
16059
+ * @stubbed
16060
+ */
16061
+ readonly token: CancellationToken;
16087
16062
 
16088
- /**
16089
- * Indicates a test is queued for later execution.
16090
- * @param test Test item to update.
16091
- * @stubbed
16092
- */
16093
- enqueued(test: TestItem): void;
16063
+ /**
16064
+ * Whether the test run will be persisted across reloads by the editor.
16065
+ * @stubbed
16066
+ */
16067
+ readonly isPersisted: boolean;
16094
16068
 
16095
- /**
16096
- * Indicates a test has started running.
16097
- * @param test Test item to update.
16098
- * @stubbed
16099
- */
16100
- started(test: TestItem): void;
16069
+ /**
16070
+ * Indicates a test is queued for later execution.
16071
+ * @param test Test item to update.
16072
+ * @stubbed
16073
+ */
16074
+ enqueued(test: TestItem): void;
16101
16075
 
16102
- /**
16103
- * Indicates a test has been skipped.
16104
- * @param test Test item to update.
16105
- * @stubbed
16106
- */
16107
- skipped(test: TestItem): void;
16076
+ /**
16077
+ * Indicates a test has started running.
16078
+ * @param test Test item to update.
16079
+ * @stubbed
16080
+ */
16081
+ started(test: TestItem): void;
16108
16082
 
16109
- /**
16110
- * Indicates a test has failed. You should pass one or more
16111
- * {@link TestMessage TestMessages} to describe the failure.
16112
- * @param test Test item to update.
16113
- * @param message Messages associated with the test failure.
16114
- * @param duration How long the test took to execute, in milliseconds.
16115
- * @stubbed
16116
- */
16117
- failed(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;
16083
+ /**
16084
+ * Indicates a test has been skipped.
16085
+ * @param test Test item to update.
16086
+ * @stubbed
16087
+ */
16088
+ skipped(test: TestItem): void;
16118
16089
 
16119
- /**
16120
- * Indicates a test has errored. You should pass one or more
16121
- * {@link TestMessage TestMessages} to describe the failure. This differs
16122
- * from the "failed" state in that it indicates a test that couldn't be
16123
- * executed at all, from a compilation error for example.
16124
- * @param test Test item to update.
16125
- * @param message Messages associated with the test failure.
16126
- * @param duration How long the test took to execute, in milliseconds.
16127
- * @stubbed
16128
- */
16129
- errored(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;
16090
+ /**
16091
+ * Indicates a test has failed. You should pass one or more
16092
+ * {@link TestMessage TestMessages} to describe the failure.
16093
+ * @param test Test item to update.
16094
+ * @param message Messages associated with the test failure.
16095
+ * @param duration How long the test took to execute, in milliseconds.
16096
+ * @stubbed
16097
+ */
16098
+ failed(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;
16130
16099
 
16131
- /**
16132
- * Indicates a test has passed.
16133
- * @param test Test item to update.
16134
- * @param duration How long the test took to execute, in milliseconds.
16135
- * @stubbed
16136
- */
16137
- passed(test: TestItem, duration?: number): void;
16100
+ /**
16101
+ * Indicates a test has errored. You should pass one or more
16102
+ * {@link TestMessage TestMessages} to describe the failure. This differs
16103
+ * from the "failed" state in that it indicates a test that couldn't be
16104
+ * executed at all, from a compilation error for example.
16105
+ * @param test Test item to update.
16106
+ * @param message Messages associated with the test failure.
16107
+ * @param duration How long the test took to execute, in milliseconds.
16108
+ * @stubbed
16109
+ */
16110
+ errored(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void;
16138
16111
 
16139
- /**
16140
- * Appends raw output from the test runner. On the user's request, the
16141
- * output will be displayed in a terminal. ANSI escape sequences,
16142
- * such as colors and text styles, are supported.
16143
- *
16144
- * @param output Output text to append.
16145
- * @param location Indicate that the output was logged at the given
16146
- * location.
16147
- * @param test Test item to associate the output with.
16148
- * @stubbed
16149
- */
16150
- appendOutput(output: string, location?: Location, test?: TestItem): void;
16112
+ /**
16113
+ * Indicates a test has passed.
16114
+ * @param test Test item to update.
16115
+ * @param duration How long the test took to execute, in milliseconds.
16116
+ * @stubbed
16117
+ */
16118
+ passed(test: TestItem, duration?: number): void;
16151
16119
 
16152
- /**
16153
- * Signals that the end of the test run. Any tests included in the run whose
16154
- * states have not been updated will have their state reset.
16155
- * @stubbed
16156
- */
16157
- end(): void;
16158
- }
16120
+ /**
16121
+ * Appends raw output from the test runner. On the user's request, the
16122
+ * output will be displayed in a terminal. ANSI escape sequences,
16123
+ * such as colors and text styles, are supported.
16124
+ *
16125
+ * @param output Output text to append.
16126
+ * @param location Indicate that the output was logged at the given
16127
+ * location.
16128
+ * @param test Test item to associate the output with.
16129
+ * @stubbed
16130
+ */
16131
+ appendOutput(output: string, location?: Location, test?: TestItem): void;
16159
16132
 
16160
- /**
16161
- * Collection of test items, found in {@link TestItem.children} and
16162
- * {@link TestController.items}.
16163
- */
16164
- export interface TestItemCollection extends Iterable<[id: string, testItem: TestItem]> {
16165
- /**
16166
- * Gets the number of items in the collection.
16167
- * @stubbed
16168
- */
16169
- readonly size: number;
16133
+ /**
16134
+ * Signals that the end of the test run. Any tests included in the run whose
16135
+ * states have not been updated will have their state reset.
16136
+ * @stubbed
16137
+ */
16138
+ end(): void;
16139
+ }
16170
16140
 
16171
16141
  /**
16172
- * Replaces the items stored by the collection.
16173
- * @param items Items to store.
16174
- * @stubbed
16142
+ * Collection of test items, found in {@link TestItem.children} and
16143
+ * {@link TestController.items}.
16175
16144
  */
16176
- replace(items: readonly TestItem[]): void;
16145
+ export interface TestItemCollection extends Iterable<[id: string, testItem: TestItem]> {
16146
+ /**
16147
+ * Gets the number of items in the collection.
16148
+ * @stubbed
16149
+ */
16150
+ readonly size: number;
16177
16151
 
16178
- /**
16179
- * Iterate over each entry in this collection.
16180
- *
16181
- * @param callback Function to execute for each entry.
16182
- * @param thisArg The `this` context used when invoking the handler function.
16183
- * @stubbed
16184
- */
16185
- forEach(callback: (item: TestItem, collection: TestItemCollection) => unknown, thisArg?: any): void;
16152
+ /**
16153
+ * Replaces the items stored by the collection.
16154
+ * @param items Items to store.
16155
+ * @stubbed
16156
+ */
16157
+ replace(items: readonly TestItem[]): void;
16186
16158
 
16187
- /**
16188
- * Adds the test item to the children. If an item with the same ID already
16189
- * exists, it'll be replaced.
16190
- * @param item Item to add.
16191
- * @stubbed
16192
- */
16193
- add(item: TestItem): void;
16159
+ /**
16160
+ * Iterate over each entry in this collection.
16161
+ *
16162
+ * @param callback Function to execute for each entry.
16163
+ * @param thisArg The `this` context used when invoking the handler function.
16164
+ * @stubbed
16165
+ */
16166
+ forEach(callback: (item: TestItem, collection: TestItemCollection) => unknown, thisArg?: any): void;
16194
16167
 
16195
- /**
16196
- * Removes a single test item from the collection.
16197
- * @param itemId Item ID to delete.
16198
- * @stubbed
16199
- */
16200
- delete(itemId: string): void;
16168
+ /**
16169
+ * Adds the test item to the children. If an item with the same ID already
16170
+ * exists, it'll be replaced.
16171
+ * @param item Item to add.
16172
+ * @stubbed
16173
+ */
16174
+ add(item: TestItem): void;
16201
16175
 
16202
- /**
16203
- * Efficiently gets a test item by ID, if it exists, in the children.
16204
- * @param itemId Item ID to get.
16205
- * @returns The found item or undefined if it does not exist.
16206
- * @stubbed
16207
- */
16208
- get(itemId: string): TestItem | undefined;
16209
- }
16176
+ /**
16177
+ * Removes a single test item from the collection.
16178
+ * @param itemId Item ID to delete.
16179
+ * @stubbed
16180
+ */
16181
+ delete(itemId: string): void;
16210
16182
 
16211
- /**
16212
- * An item shown in the "test explorer" view.
16213
- *
16214
- * A `TestItem` can represent either a test suite or a test itself, since
16215
- * they both have similar capabilities.
16216
- */
16217
- export interface TestItem {
16218
- /**
16219
- * Identifier for the `TestItem`. This is used to correlate
16220
- * test results and tests in the document with those in the workspace
16221
- * (test explorer). This cannot change for the lifetime of the `TestItem`,
16222
- * and must be unique among its parent's direct children.
16223
- * @stubbed
16224
- */
16225
- readonly id: string;
16183
+ /**
16184
+ * Efficiently gets a test item by ID, if it exists, in the children.
16185
+ * @param itemId Item ID to get.
16186
+ * @returns The found item or undefined if it does not exist.
16187
+ * @stubbed
16188
+ */
16189
+ get(itemId: string): TestItem | undefined;
16190
+ }
16226
16191
 
16227
16192
  /**
16228
- * URI this `TestItem` is associated with. May be a file or directory.
16229
- * @stubbed
16193
+ * An item shown in the "test explorer" view.
16194
+ *
16195
+ * A `TestItem` can represent either a test suite or a test itself, since
16196
+ * they both have similar capabilities.
16230
16197
  */
16231
- readonly uri: Uri | undefined;
16198
+ export interface TestItem {
16199
+ /**
16200
+ * Identifier for the `TestItem`. This is used to correlate
16201
+ * test results and tests in the document with those in the workspace
16202
+ * (test explorer). This cannot change for the lifetime of the `TestItem`,
16203
+ * and must be unique among its parent's direct children.
16204
+ * @stubbed
16205
+ */
16206
+ readonly id: string;
16232
16207
 
16233
- /**
16234
- * The children of this test item. For a test suite, this may contain the
16235
- * individual test cases or nested suites.
16236
- * @stubbed
16237
- */
16238
- readonly children: TestItemCollection;
16208
+ /**
16209
+ * URI this `TestItem` is associated with. May be a file or directory.
16210
+ * @stubbed
16211
+ */
16212
+ readonly uri: Uri | undefined;
16239
16213
 
16240
- /**
16241
- * The parent of this item. It's set automatically, and is undefined
16242
- * top-level items in the {@link TestController.items} and for items that
16243
- * aren't yet included in another item's {@link TestItem.children children}.
16244
- * @stubbed
16245
- */
16246
- readonly parent: TestItem | undefined;
16214
+ /**
16215
+ * The children of this test item. For a test suite, this may contain the
16216
+ * individual test cases or nested suites.
16217
+ * @stubbed
16218
+ */
16219
+ readonly children: TestItemCollection;
16247
16220
 
16248
- /**
16249
- * Tags associated with this test item. May be used in combination with
16250
- * {@link TestRunProfile.tags}, or simply as an organizational feature.
16251
- * @stubbed
16252
- */
16253
- tags: readonly TestTag[];
16221
+ /**
16222
+ * The parent of this item. It's set automatically, and is undefined
16223
+ * top-level items in the {@link TestController.items} and for items that
16224
+ * aren't yet included in another item's {@link TestItem.children children}.
16225
+ * @stubbed
16226
+ */
16227
+ readonly parent: TestItem | undefined;
16254
16228
 
16255
- /**
16256
- * Indicates whether this test item may have children discovered by resolving.
16257
- *
16258
- * If true, this item is shown as expandable in the Test Explorer view and
16259
- * expanding the item will cause {@link TestController.resolveHandler}
16260
- * to be invoked with the item.
16261
- *
16262
- * Default to `false`.
16263
- * @stubbed
16264
- */
16265
- canResolveChildren: boolean;
16229
+ /**
16230
+ * Tags associated with this test item. May be used in combination with
16231
+ * {@link TestRunProfile.tags}, or simply as an organizational feature.
16232
+ * @stubbed
16233
+ */
16234
+ tags: readonly TestTag[];
16266
16235
 
16267
- /**
16268
- * Controls whether the item is shown as "busy" in the Test Explorer view.
16269
- * This is useful for showing status while discovering children.
16270
- *
16271
- * Defaults to `false`.
16272
- * @stubbed
16273
- */
16274
- busy: boolean;
16236
+ /**
16237
+ * Indicates whether this test item may have children discovered by resolving.
16238
+ *
16239
+ * If true, this item is shown as expandable in the Test Explorer view and
16240
+ * expanding the item will cause {@link TestController.resolveHandler}
16241
+ * to be invoked with the item.
16242
+ *
16243
+ * Default to `false`.
16244
+ * @stubbed
16245
+ */
16246
+ canResolveChildren: boolean;
16275
16247
 
16276
- /**
16277
- * Display name describing the test case.
16278
- * @stubbed
16279
- */
16280
- label: string;
16248
+ /**
16249
+ * Controls whether the item is shown as "busy" in the Test Explorer view.
16250
+ * This is useful for showing status while discovering children.
16251
+ *
16252
+ * Defaults to `false`.
16253
+ * @stubbed
16254
+ */
16255
+ busy: boolean;
16281
16256
 
16282
- /**
16283
- * Optional description that appears next to the label.
16284
- * @stubbed
16285
- */
16286
- description?: string;
16257
+ /**
16258
+ * Display name describing the test case.
16259
+ * @stubbed
16260
+ */
16261
+ label: string;
16287
16262
 
16288
- /**
16289
- * A string that should be used when comparing this item
16290
- * with other items. When `falsy` the {@link TestItem.label label}
16291
- * is used.
16292
- * @stubbed
16293
- */
16294
- sortText?: string | undefined;
16263
+ /**
16264
+ * Optional description that appears next to the label.
16265
+ * @stubbed
16266
+ */
16267
+ description?: string;
16295
16268
 
16296
- /**
16297
- * Location of the test item in its {@link TestItem.uri uri}.
16298
- *
16299
- * This is only meaningful if the `uri` points to a file.
16300
- * @stubbed
16301
- */
16302
- range: Range | undefined;
16269
+ /**
16270
+ * A string that should be used when comparing this item
16271
+ * with other items. When `falsy` the {@link TestItem.label label}
16272
+ * is used.
16273
+ * @stubbed
16274
+ */
16275
+ sortText?: string | undefined;
16303
16276
 
16304
- /**
16305
- * Optional error encountered while loading the test.
16306
- *
16307
- * Note that this is not a test result and should only be used to represent errors in
16308
- * test discovery, such as syntax errors.
16309
- * @stubbed
16310
- */
16311
- error: string | MarkdownString | undefined;
16312
- }
16277
+ /**
16278
+ * Location of the test item in its {@link TestItem.uri uri}.
16279
+ *
16280
+ * This is only meaningful if the `uri` points to a file.
16281
+ * @stubbed
16282
+ */
16283
+ range: Range | undefined;
16313
16284
 
16314
- /**
16315
- * Message associated with the test state. Can be linked to a specific
16316
- * source range -- useful for assertion failures, for example.
16317
- */
16318
- export class TestMessage {
16319
- /**
16320
- * Human-readable message text to display.
16321
- */
16322
- message: string | MarkdownString;
16285
+ /**
16286
+ * Optional error encountered while loading the test.
16287
+ *
16288
+ * Note that this is not a test result and should only be used to represent errors in
16289
+ * test discovery, such as syntax errors.
16290
+ * @stubbed
16291
+ */
16292
+ error: string | MarkdownString | undefined;
16293
+ }
16323
16294
 
16324
16295
  /**
16325
- * Expected test output. If given with {@link TestMessage.actualOutput actualOutput }, a diff view will be shown.
16296
+ * Message associated with the test state. Can be linked to a specific
16297
+ * source range -- useful for assertion failures, for example.
16326
16298
  */
16327
- expectedOutput?: string;
16299
+ export class TestMessage {
16300
+ /**
16301
+ * Human-readable message text to display.
16302
+ */
16303
+ message: string | MarkdownString;
16328
16304
 
16329
- /**
16330
- * Actual test output. If given with {@link TestMessage.expectedOutput expectedOutput }, a diff view will be shown.
16331
- */
16332
- actualOutput?: string;
16305
+ /**
16306
+ * Expected test output. If given with {@link TestMessage.actualOutput actualOutput }, a diff view will be shown.
16307
+ */
16308
+ expectedOutput?: string;
16333
16309
 
16334
- /**
16335
- * Associated file location.
16336
- */
16337
- location?: Location;
16310
+ /**
16311
+ * Actual test output. If given with {@link TestMessage.expectedOutput expectedOutput }, a diff view will be shown.
16312
+ */
16313
+ actualOutput?: string;
16338
16314
 
16339
- /**
16340
- * Creates a new TestMessage that will present as a diff in the editor.
16341
- * @param message Message to display to the user.
16342
- * @param expected Expected output.
16343
- * @param actual Actual output.
16344
- */
16345
- static diff(message: string | MarkdownString, expected: string, actual: string): TestMessage;
16315
+ /**
16316
+ * Associated file location.
16317
+ */
16318
+ location?: Location;
16319
+
16320
+ /**
16321
+ * Creates a new TestMessage that will present as a diff in the editor.
16322
+ * @param message Message to display to the user.
16323
+ * @param expected Expected output.
16324
+ * @param actual Actual output.
16325
+ */
16326
+ static diff(message: string | MarkdownString, expected: string, actual: string): TestMessage;
16327
+
16328
+ /**
16329
+ * Creates a new TestMessage instance.
16330
+ * @param message The message to show to the user.
16331
+ */
16332
+ constructor(message: string | MarkdownString);
16333
+ }
16346
16334
 
16347
16335
  /**
16348
- * Creates a new TestMessage instance.
16349
- * @param message The message to show to the user.
16336
+ * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
16337
+ * and others. This API makes no assumption about what promise library is being used which
16338
+ * enables reusing existing code without migrating to a specific promise implementation. Still,
16339
+ * we recommend the use of native promises which are available in this editor.
16350
16340
  */
16351
- constructor(message: string | MarkdownString);
16352
- }
16341
+ interface Thenable<T> {
16342
+ /**
16343
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
16344
+ * @param onfulfilled The callback to execute when the Promise is resolved.
16345
+ * @param onrejected The callback to execute when the Promise is rejected.
16346
+ * @returns A Promise for the completion of which ever callback is executed.
16347
+ */
16348
+ then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
16349
+ then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
16350
+ }
16353
16351
 
16354
- /**
16355
- * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise,
16356
- * and others. This API makes no assumption about what promise library is being used which
16357
- * enables reusing existing code without migrating to a specific promise implementation. Still,
16358
- * we recommend the use of native promises which are available in this editor.
16359
- */
16360
- interface Thenable<T> {
16361
- /**
16362
- * Attaches callbacks for the resolution and/or rejection of the Promise.
16363
- * @param onfulfilled The callback to execute when the Promise is resolved.
16364
- * @param onrejected The callback to execute when the Promise is rejected.
16365
- * @returns A Promise for the completion of which ever callback is executed.
16366
- */
16367
- then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
16368
- then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
16369
16352
  }
16370
-