@theia/plugin 1.34.0-next.7 → 1.34.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/theia.d.ts +715 -334
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.34.0-next.7+a73305748",
3
+ "version": "1.34.0",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -27,10 +27,10 @@
27
27
  "watch": "theiaext watch"
28
28
  },
29
29
  "devDependencies": {
30
- "@theia/ext-scripts": "1.33.0"
30
+ "@theia/ext-scripts": "1.34.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "a73305748c89f9608c5f94ecc6d15924b49aaa0c"
35
+ "gitHead": "a8c403b103829a1b8b092ce741ef3826804f773b"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -3001,10 +3001,34 @@ export module '@theia/plugin' {
3001
3001
  */
3002
3002
  message?: string;
3003
3003
 
3004
+ /**
3005
+ * The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.
3006
+ */
3007
+ location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;
3008
+
3009
+ /**
3010
+ * Opt-out of the default terminal persistence on restart and reload.
3011
+ * This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.
3012
+ */
3013
+ isTransient?: boolean;
3014
+
3004
3015
  /**
3005
3016
  * Terminal attributes. Can be useful to apply some implementation specific information.
3006
3017
  */
3007
3018
  attributes?: { [key: string]: string | null };
3019
+
3020
+ /**
3021
+ * The icon path or {@link ThemeIcon} for the terminal.
3022
+ */
3023
+ iconPath?: ThemeIcon;
3024
+
3025
+ /**
3026
+ * The icon {@link ThemeColor} for the terminal.
3027
+ * The `terminal.ansi*` theme keys are
3028
+ * recommended for the best contrast and consistency across themes.
3029
+ * @stubbed
3030
+ */
3031
+ color?: ThemeColor;
3008
3032
  }
3009
3033
 
3010
3034
  /**
@@ -3067,6 +3091,30 @@ export module '@theia/plugin' {
3067
3091
  * control it.
3068
3092
  */
3069
3093
  pty: Pseudoterminal;
3094
+
3095
+ /**
3096
+ * The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.
3097
+ */
3098
+ location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;
3099
+
3100
+ /**
3101
+ * Opt-out of the default terminal persistence on restart and reload.
3102
+ * This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.
3103
+ */
3104
+ isTransient?: boolean;
3105
+
3106
+ /**
3107
+ * The icon path or {@link ThemeIcon} for the terminal.
3108
+ */
3109
+ iconPath?: ThemeIcon;
3110
+
3111
+ /**
3112
+ * The icon {@link ThemeColor} for the terminal.
3113
+ * The standard `terminal.ansi*` theme keys are
3114
+ * recommended for the best contrast and consistency across themes.
3115
+ * @stubbed
3116
+ */
3117
+ color?: ThemeColor;
3070
3118
  }
3071
3119
 
3072
3120
  /**
@@ -3207,6 +3255,79 @@ export module '@theia/plugin' {
3207
3255
  constructor(startIndex: number, length: number, tooltip?: string);
3208
3256
  }
3209
3257
 
3258
+ /**
3259
+ * The location of the {@link Terminal}.
3260
+ */
3261
+ export enum TerminalLocation {
3262
+ /**
3263
+ * In the terminal view
3264
+ */
3265
+ Panel = 1,
3266
+ /**
3267
+ * In the editor area
3268
+ */
3269
+ Editor = 2,
3270
+ }
3271
+
3272
+ /**
3273
+ * Assumes a {@link TerminalLocation} of editor and allows specifying a {@link ViewColumn} and
3274
+ * {@link TerminalEditorLocationOptions.preserveFocus preserveFocus } property
3275
+ */
3276
+ export interface TerminalEditorLocationOptions {
3277
+ /**
3278
+ * A view column in which the {@link Terminal terminal} should be shown in the editor area.
3279
+ * Use {@link ViewColumn.Active active} to open in the active editor group, other values are
3280
+ * adjusted to be `Min(column, columnCount + 1)`, the
3281
+ * {@link ViewColumn.Active active}-column is not adjusted. Use
3282
+ * {@linkcode ViewColumn.Beside} to open the editor to the side of the currently active one.
3283
+ */
3284
+ viewColumn: ViewColumn;
3285
+ /**
3286
+ * An optional flag that when `true` will stop the {@link Terminal} from taking focus.
3287
+ */
3288
+ preserveFocus?: boolean;
3289
+ }
3290
+
3291
+ /**
3292
+ * Uses the parent {@link Terminal}'s location for the terminal
3293
+ */
3294
+ export interface TerminalSplitLocationOptions {
3295
+ /**
3296
+ * The parent terminal to split this terminal beside. This works whether the parent terminal
3297
+ * is in the panel or the editor area.
3298
+ */
3299
+ parentTerminal: Terminal;
3300
+ }
3301
+
3302
+ /*
3303
+ * Provides a terminal profile for the contributed terminal profile when launched via the UI or
3304
+ * command.
3305
+ */
3306
+ export interface TerminalProfileProvider {
3307
+ /**
3308
+ * Provide the terminal profile.
3309
+ * @param token A cancellation token that indicates the result is no longer needed.
3310
+ * @returns The terminal profile.
3311
+ */
3312
+ provideTerminalProfile(token: CancellationToken): ProviderResult<TerminalProfile>;
3313
+ }
3314
+
3315
+ /**
3316
+ * A terminal profile defines how a terminal will be launched.
3317
+ */
3318
+ export class TerminalProfile {
3319
+ /**
3320
+ * The options that the terminal will launch with.
3321
+ */
3322
+ options: TerminalOptions | ExtensionTerminalOptions;
3323
+
3324
+ /**
3325
+ * Creates a new terminal profile.
3326
+ * @param options The options that the terminal will launch with.
3327
+ */
3328
+ constructor(options: TerminalOptions | ExtensionTerminalOptions);
3329
+ }
3330
+
3210
3331
  /**
3211
3332
  * A file decoration represents metadata that can be rendered with a file.
3212
3333
  */
@@ -3779,9 +3900,11 @@ export module '@theia/plugin' {
3779
3900
  /**
3780
3901
  * Controls whether command uris are enabled in webview content or not.
3781
3902
  *
3782
- * Defaults to false.
3903
+ * Defaults to `false` (command uris are disabled).
3904
+ *
3905
+ * If you pass in an array, only the commands in the array are allowed.
3783
3906
  */
3784
- readonly enableCommandUris?: boolean;
3907
+ readonly enableCommandUris?: boolean | readonly string[];
3785
3908
 
3786
3909
  /**
3787
3910
  * Root paths from which the webview can load local (filesystem) resources using the `theia-resource:` scheme.
@@ -4934,7 +5057,7 @@ export module '@theia/plugin' {
4934
5057
  *
4935
5058
  * @return New webview panel.
4936
5059
  */
4937
- export function createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | WebviewPanelShowOptions,
5060
+ export function createWebviewPanel(viewType: string, title: string, showOptions: ViewColumn | { readonly viewColumn: ViewColumn; readonly preserveFocus?: boolean },
4938
5061
  options?: WebviewPanelOptions & WebviewOptions): WebviewPanel;
4939
5062
 
4940
5063
  /**
@@ -5224,6 +5347,12 @@ export module '@theia/plugin' {
5224
5347
  * @return Disposable that unregisters the provider.
5225
5348
  */
5226
5349
  export function registerTerminalLinkProvider(provider: TerminalLinkProvider): Disposable;
5350
+ /**
5351
+ * Registers a provider for a contributed terminal profile.
5352
+ * @param id The ID of the contributed terminal profile.
5353
+ * @param provider The terminal profile provider.
5354
+ */
5355
+ export function registerTerminalProfileProvider(id: string, provider: TerminalProfileProvider): Disposable;
5227
5356
 
5228
5357
  /**
5229
5358
  * Register a file decoration provider.
@@ -5323,6 +5452,17 @@ export module '@theia/plugin' {
5323
5452
  */
5324
5453
  password: boolean;
5325
5454
 
5455
+ /**
5456
+ * Selection range in the input value. Defined as tuple of two number where the
5457
+ * first is the inclusive start index and the second the exclusive end index. When `undefined` the whole
5458
+ * pre-filled value will be selected, when empty (start equals end) only the cursor will be set,
5459
+ * otherwise the defined range will be selected.
5460
+ *
5461
+ * This property does not get updated when the user types or makes a selection,
5462
+ * but it can be updated by the extension.
5463
+ */
5464
+ valueSelection: readonly [number, number] | undefined;
5465
+
5326
5466
  /**
5327
5467
  * An event signaling when the value has changed.
5328
5468
  */
@@ -5527,6 +5667,17 @@ export module '@theia/plugin' {
5527
5667
  * Whether to show collapse all action or not.
5528
5668
  */
5529
5669
  showCollapseAll?: boolean;
5670
+
5671
+ /**
5672
+ * An optional interface to implement drag and drop in the tree view.
5673
+ */
5674
+ dragAndDropController?: TreeDragAndDropController<T>;
5675
+ /**
5676
+ * Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree,
5677
+ * the first argument to the command is the tree item that the command was executed on and the second argument is an
5678
+ * array containing all selected tree items.
5679
+ */
5680
+ canSelectMany?: boolean;
5530
5681
  }
5531
5682
 
5532
5683
  /**
@@ -5565,6 +5716,165 @@ export module '@theia/plugin' {
5565
5716
 
5566
5717
  }
5567
5718
 
5719
+ /**
5720
+ * A file associated with a {@linkcode DataTransferItem}.
5721
+ */
5722
+ export interface DataTransferFile {
5723
+ /**
5724
+ * The name of the file.
5725
+ */
5726
+ readonly name: string;
5727
+
5728
+ /**
5729
+ * The full file path of the file.
5730
+ *
5731
+ * May be `undefined` on web.
5732
+ */
5733
+ readonly uri?: Uri;
5734
+
5735
+ /**
5736
+ * The full file contents of the file.
5737
+ */
5738
+ data(): Thenable<Uint8Array>;
5739
+ }
5740
+
5741
+ /**
5742
+ * Encapsulates data transferred during drag and drop operations.
5743
+ */
5744
+ export class DataTransferItem {
5745
+ /**
5746
+ * Get a string representation of this item.
5747
+ *
5748
+ * If {@linkcode DataTransferItem.value} is an object, this returns the result of json stringifying {@linkcode DataTransferItem.value} value.
5749
+ */
5750
+ asString(): Thenable<string>;
5751
+
5752
+ /**
5753
+ * Try getting the {@link DataTransferFile file} associated with this data transfer item.
5754
+ *
5755
+ * Note that the file object is only valid for the scope of the drag and drop operation.
5756
+ *
5757
+ * @returns The file for the data transfer or `undefined` if the item is either not a file or the
5758
+ * file data cannot be accessed.
5759
+ */
5760
+ asFile(): DataTransferFile | undefined;
5761
+
5762
+ /**
5763
+ * Custom data stored on this item.
5764
+ *
5765
+ * You can use `value` to share data across operations. The original object can be retrieved so long as the extension that
5766
+ * created the `DataTransferItem` runs in the same extension host.
5767
+ */
5768
+ readonly value: any;
5769
+
5770
+ /**
5771
+ * @param value Custom data stored on this item. Can be retrieved using {@linkcode DataTransferItem.value}.
5772
+ */
5773
+ constructor(value: any);
5774
+ }
5775
+
5776
+ /**
5777
+ * A map containing a mapping of the mime type of the corresponding transferred data.
5778
+ *
5779
+ * Drag and drop controllers that implement {@link TreeDragAndDropController.handleDrag `handleDrag`} can add additional mime types to the
5780
+ * data transfer. These additional mime types will only be included in the `handleDrop` when the the drag was initiated from
5781
+ * an element in the same drag and drop controller.
5782
+ */
5783
+ export class DataTransfer implements Iterable<[mimeType: string, item: DataTransferItem]> {
5784
+ /**
5785
+ * Retrieves the data transfer item for a given mime type.
5786
+ *
5787
+ * @param mimeType The mime type to get the data transfer item for, such as `text/plain` or `image/png`.
5788
+ *
5789
+ * Special mime types:
5790
+ * - `text/uri-list` — A string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,
5791
+ * set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.
5792
+ */
5793
+ get(mimeType: string): DataTransferItem | undefined;
5794
+
5795
+ /**
5796
+ * Sets a mime type to data transfer item mapping.
5797
+ * @param mimeType The mime type to set the data for.
5798
+ * @param value The data transfer item for the given mime type.
5799
+ */
5800
+ set(mimeType: string, value: DataTransferItem): void;
5801
+
5802
+ /**
5803
+ * Allows iteration through the data transfer items.
5804
+ *
5805
+ * @param callbackfn Callback for iteration through the data transfer items.
5806
+ * @param thisArg The `this` context used when invoking the handler function.
5807
+ */
5808
+ forEach(callbackfn: (item: DataTransferItem, mimeType: string, dataTransfer: DataTransfer) => void, thisArg?: any): void;
5809
+
5810
+ /**
5811
+ * Get a new iterator with the `[mime, item]` pairs for each element in this data transfer.
5812
+ */
5813
+ [Symbol.iterator](): IterableIterator<[mimeType: string, item: DataTransferItem]>;
5814
+ }
5815
+
5816
+ /**
5817
+ * Provides support for drag and drop in `TreeView`.
5818
+ */
5819
+ export interface TreeDragAndDropController<T> {
5820
+
5821
+ /**
5822
+ * The mime types that the {@link TreeDragAndDropController.handleDrop `handleDrop`} method of this `DragAndDropController` supports.
5823
+ * This could be well-defined, existing, mime types, and also mime types defined by the extension.
5824
+ *
5825
+ * To support drops from trees, you will need to add the mime type of that tree.
5826
+ * This includes drops from within the same tree.
5827
+ * The mime type of a tree is recommended to be of the format `application/vnd.code.tree.<treeidlowercase>`.
5828
+ *
5829
+ * Use the special `files` mime type to support all types of dropped files {@link DataTransferFile files}, regardless of the file's actual mime type.
5830
+ *
5831
+ * To learn the mime type of a dragged item:
5832
+ * 1. Set up your `DragAndDropController`
5833
+ * 2. Use the Developer: Set Log Level... command to set the level to "Debug"
5834
+ * 3. Open the developer tools and drag the item with unknown mime type over your tree. The mime types will be logged to the developer console
5835
+ *
5836
+ * Note that mime types that cannot be sent to the extension will be omitted.
5837
+ */
5838
+ readonly dropMimeTypes: readonly string[];
5839
+
5840
+ /**
5841
+ * The mime types that the {@link TreeDragAndDropController.handleDrag `handleDrag`} method of this `TreeDragAndDropController` may add to the tree data transfer.
5842
+ * This could be well-defined, existing, mime types, and also mime types defined by the extension.
5843
+ *
5844
+ * The recommended mime type of the tree (`application/vnd.code.tree.<treeidlowercase>`) will be automatically added.
5845
+ */
5846
+ readonly dragMimeTypes: readonly string[];
5847
+
5848
+ /**
5849
+ * When the user starts dragging items from this `DragAndDropController`, `handleDrag` will be called.
5850
+ * Extensions can use `handleDrag` to add their {@link DataTransferItem `DataTransferItem`} items to the drag and drop.
5851
+ *
5852
+ * When the items are dropped on **another tree item** in **the same tree**, your `DataTransferItem` objects
5853
+ * will be preserved. Use the recommended mime type for the tree (`application/vnd.code.tree.<treeidlowercase>`) to add
5854
+ * tree objects in a data transfer. See the documentation for `DataTransferItem` for how best to take advantage of this.
5855
+ *
5856
+ * To add a data transfer item that can be dragged into the editor, use the application specific mime type "text/uri-list".
5857
+ * The data for "text/uri-list" should be a string with `toString()`ed Uris separated by newlines. To specify a cursor position in the file,
5858
+ * set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.
5859
+ *
5860
+ * @param source The source items for the drag and drop operation.
5861
+ * @param dataTransfer The data transfer associated with this drag.
5862
+ * @param token A cancellation token indicating that drag has been cancelled.
5863
+ */
5864
+ handleDrag?(source: readonly T[], dataTransfer: DataTransfer, token: CancellationToken): Thenable<void> | void;
5865
+
5866
+ /**
5867
+ * Called when a drag and drop action results in a drop on the tree that this `DragAndDropController` belongs to.
5868
+ *
5869
+ * Extensions should fire {@link TreeDataProvider.onDidChangeTreeData onDidChangeTreeData} for any elements that need to be refreshed.
5870
+ *
5871
+ * @param dataTransfer The data transfer items of the source of the drag.
5872
+ * @param target The target tree element that the drop is occurring on. When undefined, the target is the root.
5873
+ * @param token A cancellation token indicating that the drop has been cancelled.
5874
+ */
5875
+ handleDrop?(target: T | undefined, dataTransfer: DataTransfer, token: CancellationToken): Thenable<void> | void;
5876
+ }
5877
+
5568
5878
  /**
5569
5879
  * Represents a Tree view
5570
5880
  */
@@ -7461,7 +7771,7 @@ export module '@theia/plugin' {
7461
7771
  * The `activeSignatureHelp` has its [`SignatureHelp.activeSignature`] field updated based on
7462
7772
  * the user arrowing through available signatures.
7463
7773
  */
7464
- readonly activeSignatureHelp?: SignatureHelp;
7774
+ readonly activeSignatureHelp: SignatureHelp | undefined;
7465
7775
  }
7466
7776
 
7467
7777
  /**
@@ -8769,11 +9079,21 @@ export module '@theia/plugin' {
8769
9079
  source?: string;
8770
9080
 
8771
9081
  /**
8772
- * A code or identifier for this diagnostics. Will not be surfaced
8773
- * to the user, but should be used for later processing, e.g. when
8774
- * providing {@link CodeActionContext code actions}.
9082
+ * A code or identifier for this diagnostic.
9083
+ * Should be used for later processing, e.g. when providing {@link CodeActionContext code actions}.
8775
9084
  */
8776
- code?: string | number;
9085
+ code?: string | number | {
9086
+ /**
9087
+ * A code or identifier for this diagnostic.
9088
+ * Should be used for later processing, e.g. when providing {@link CodeActionContext code actions}.
9089
+ */
9090
+ value: string | number;
9091
+
9092
+ /**
9093
+ * A target URI to open with more information about the diagnostic error.
9094
+ */
9095
+ target: Uri;
9096
+ };
8777
9097
 
8778
9098
  /**
8779
9099
  * An array of related diagnostic information, e.g. when symbol-names within
@@ -9388,7 +9708,15 @@ export module '@theia/plugin' {
9388
9708
  * @param uri A resource identifier.
9389
9709
  * @param edits An array of text edits.
9390
9710
  */
9391
- set(uri: Uri, edits: TextEdit[]): void;
9711
+ set(uri: Uri, edits: ReadonlyArray<TextEdit | SnippetTextEdit>): void;
9712
+
9713
+ /**
9714
+ * Set (and replace) text edits or snippet edits with metadata for a resource.
9715
+ *
9716
+ * @param uri A resource identifier.
9717
+ * @param edits An array of edits.
9718
+ */
9719
+ set(uri: Uri, edits: ReadonlyArray<[TextEdit | SnippetTextEdit, WorkspaceEditEntryMetadata]>): void;
9392
9720
 
9393
9721
  /**
9394
9722
  * Get the text edits for a resource.
@@ -10710,6 +11038,11 @@ export module '@theia/plugin' {
10710
11038
  * Controls whether the input box is visible (default is true).
10711
11039
  */
10712
11040
  visible: boolean;
11041
+
11042
+ /**
11043
+ * Controls whether the input box is enabled (default is `true`).
11044
+ */
11045
+ enabled: boolean;
10713
11046
  }
10714
11047
 
10715
11048
  interface QuickDiffProvider {
@@ -13138,331 +13471,331 @@ export module '@theia/plugin' {
13138
13471
  /**
13139
13472
  * The tab represents a single text based resource.
13140
13473
  */
13141
- export class TabInputText {
13142
- /**
13143
- * The uri represented by the tab.
13144
- * @stubbed
13145
- */
13146
- readonly uri: Uri;
13147
- /**
13148
- * Constructs a text tab input with the given URI.
13149
- * @param uri The URI of the tab.
13150
- * @stubbed
13151
- */
13152
- constructor(uri: Uri);
13153
- }
13154
-
13155
- /**
13156
- * The tab represents two text based resources
13157
- * being rendered as a diff.
13158
- */
13159
- export class TabInputTextDiff {
13160
- /**
13161
- * The uri of the original text resource.
13162
- * @stubbed
13163
- */
13164
- readonly original: Uri;
13165
- /**
13166
- * The uri of the modified text resource.
13167
- * @stubbed
13168
- */
13169
- readonly modified: Uri;
13170
- /**
13171
- * Constructs a new text diff tab input with the given URIs.
13172
- * @param original The uri of the original text resource.
13173
- * @param modified The uri of the modified text resource.
13174
- * @stubbed
13175
- */
13176
- constructor(original: Uri, modified: Uri);
13177
- }
13178
-
13179
- /**
13180
- * The tab represents a custom editor.
13181
- */
13182
- export class TabInputCustom {
13183
- /**
13184
- * The uri that the tab is representing.
13185
- * @stubbed
13186
- */
13187
- readonly uri: Uri;
13188
- /**
13189
- * The type of custom editor.
13190
- * @stubbed
13191
- */
13192
- readonly viewType: string;
13193
- /**
13194
- * Constructs a custom editor tab input.
13195
- * @param uri The uri of the tab.
13196
- * @param viewType The viewtype of the custom editor.
13197
- * @stubbed
13198
- */
13199
- constructor(uri: Uri, viewType: string);
13200
- }
13201
-
13202
- /**
13203
- * The tab represents a webview.
13204
- */
13205
- export class TabInputWebview {
13206
- /**
13207
- * The type of webview. Maps to WebviewPanel's viewType
13208
- * @stubbed
13209
- */
13210
- readonly viewType: string;
13211
- /**
13212
- * Constructs a webview tab input with the given view type.
13213
- * @param viewType The type of webview. Maps to WebviewPanel's viewType
13214
- * @stubbed
13215
- */
13216
- constructor(viewType: string);
13217
- }
13218
-
13219
- /**
13220
- * The tab represents a notebook.
13221
- */
13222
- export class TabInputNotebook {
13223
- /**
13224
- * The uri that the tab is representing.
13225
- * @stubbed
13226
- */
13227
- readonly uri: Uri;
13228
- /**
13229
- * The type of notebook. Maps to NotebookDocuments's notebookType
13230
- * @stubbed
13231
- */
13232
- readonly notebookType: string;
13233
- /**
13234
- * Constructs a new tab input for a notebook.
13235
- * @param uri The uri of the notebook.
13236
- * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13237
- * @stubbed
13238
- */
13239
- constructor(uri: Uri, notebookType: string);
13240
- }
13241
-
13242
- /**
13243
- * The tabs represents two notebooks in a diff configuration.
13244
- */
13245
- export class TabInputNotebookDiff {
13246
- /**
13247
- * The uri of the original notebook.
13248
- * @stubbed
13249
- */
13250
- readonly original: Uri;
13251
- /**
13252
- * The uri of the modified notebook.
13253
- * @stubbed
13254
- */
13255
- readonly modified: Uri;
13256
- /**
13257
- * The type of notebook. Maps to NotebookDocuments's notebookType
13258
- * @stubbed
13259
- */
13260
- readonly notebookType: string;
13261
- /**
13262
- * Constructs a notebook diff tab input.
13263
- * @param original The uri of the original unmodified notebook.
13264
- * @param modified The uri of the modified notebook.
13265
- * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13266
- * @stubbed
13267
- */
13268
- constructor(original: Uri, modified: Uri, notebookType: string);
13269
- }
13270
-
13271
- /**
13272
- * The tab represents a terminal in the editor area.
13273
- */
13274
- export class TabInputTerminal {
13275
- /**
13276
- * Constructs a terminal tab input.
13277
- * @stubbed
13278
- */
13279
- constructor();
13280
- }
13281
-
13282
- /**
13283
- * Represents a tab within a {@link TabGroup group of tabs}.
13284
- * Tabs are merely the graphical representation within the editor area.
13285
- * A backing editor is not a guarantee.
13286
- */
13287
- export interface Tab {
13288
-
13289
- /**
13290
- * The text displayed on the tab.
13291
- * @stubbed
13292
- */
13293
- readonly label: string;
13294
-
13295
- /**
13296
- * The group which the tab belongs to.
13297
- * @stubbed
13298
- */
13299
- readonly group: TabGroup;
13300
-
13301
- /**
13302
- * Defines the structure of the tab i.e. text, notebook, custom, etc.
13303
- * Resource and other useful properties are defined on the tab kind.
13304
- * @stubbed
13305
- */
13306
- readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;
13307
-
13308
- /**
13309
- * Whether or not the tab is currently active.
13310
- * This is dictated by being the selected tab in the group.
13311
- * @stubbed
13312
- */
13313
- readonly isActive: boolean;
13314
-
13315
- /**
13316
- * Whether or not the dirty indicator is present on the tab.
13317
- * @stubbed
13318
- */
13319
- readonly isDirty: boolean;
13320
-
13321
- /**
13322
- * Whether or not the tab is pinned (pin icon is present).
13323
- * @stubbed
13324
- */
13325
- readonly isPinned: boolean;
13326
-
13327
- /**
13328
- * Whether or not the tab is in preview mode.
13329
- * @stubbed
13330
- */
13331
- readonly isPreview: boolean;
13332
- }
13333
-
13334
- /**
13335
- * An event describing change to tabs.
13336
- */
13337
- export interface TabChangeEvent {
13338
- /**
13339
- * The tabs that have been opened.
13340
- * @stubbed
13341
- */
13342
- readonly opened: readonly Tab[];
13343
- /**
13344
- * The tabs that have been closed.
13345
- * @stubbed
13346
- */
13347
- readonly closed: readonly Tab[];
13348
- /**
13349
- * Tabs that have changed, e.g have changed
13350
- * their {@link Tab.isActive active} state.
13351
- * @stubbed
13352
- */
13353
- readonly changed: readonly Tab[];
13354
- }
13355
-
13356
- /**
13357
- * An event describing changes to tab groups.
13358
- */
13359
- export interface TabGroupChangeEvent {
13360
- /**
13361
- * Tab groups that have been opened.
13362
- * @stubbed
13363
- */
13364
- readonly opened: readonly TabGroup[];
13365
- /**
13366
- * Tab groups that have been closed.
13367
- * @stubbed
13368
- */
13369
- readonly closed: readonly TabGroup[];
13370
- /**
13371
- * Tab groups that have changed, e.g have changed
13372
- * their {@link TabGroup.isActive active} state.
13373
- * @stubbed
13374
- */
13375
- readonly changed: readonly TabGroup[];
13376
- }
13377
-
13378
- /**
13379
- * Represents a group of tabs. A tab group itself consists of multiple tabs.
13380
- */
13381
- export interface TabGroup {
13382
- /**
13383
- * Whether or not the group is currently active.
13384
- *
13385
- * *Note* that only one tab group is active at a time, but that multiple tab
13386
- * groups can have an {@link TabGroup.aciveTab active tab}.
13387
- *
13388
- * @see {@link Tab.isActive}
13389
- * @stubbed
13390
- */
13391
- readonly isActive: boolean;
13392
-
13393
- /**
13394
- * The view column of the group.
13395
- * @stubbed
13396
- */
13397
- readonly viewColumn: ViewColumn;
13398
-
13399
- /**
13400
- * The active {@link Tab tab} in the group. This is the tab whose contents are currently
13401
- * being rendered.
13402
- *
13403
- * *Note* that there can be one active tab per group but there can only be one {@link TabGroups.activeTabGroup active group}.
13404
- * @stubbed
13405
- */
13406
- readonly activeTab: Tab | undefined;
13407
-
13408
- /**
13409
- * The list of tabs contained within the group.
13410
- * This can be empty if the group has no tabs open.
13411
- * @stubbed
13412
- */
13413
- readonly tabs: readonly Tab[];
13414
- }
13415
-
13416
- /**
13417
- * Represents the main editor area which consists of multple groups which contain tabs.
13418
- */
13419
- export interface TabGroups {
13420
- /**
13421
- * All the groups within the group container.
13422
- * @stubbed
13423
- */
13424
- readonly all: readonly TabGroup[];
13425
-
13426
- /**
13427
- * The currently active group.
13428
- * @stubbed
13429
- */
13430
- readonly activeTabGroup: TabGroup;
13431
-
13432
- /**
13433
- * An {@link Event event} which fires when {@link TabGroup tab groups} have changed.
13434
- * @stubbed
13435
- */
13436
- readonly onDidChangeTabGroups: Event<TabGroupChangeEvent>;
13437
-
13438
- /**
13439
- * An {@link Event event} which fires when {@link Tab tabs} have changed.
13440
- * @stubbed
13441
- */
13442
- readonly onDidChangeTabs: Event<TabChangeEvent>;
13443
-
13444
- /**
13445
- * Closes the tab. This makes the tab object invalid and the tab
13446
- * should no longer be used for further actions.
13447
- * Note: In the case of a dirty tab, a confirmation dialog will be shown which may be cancelled. If cancelled the tab is still valid
13448
- *
13449
- * @param tab The tab to close.
13450
- * @param preserveFocus When `true` focus will remain in its current position. If `false` it will jump to the next tab.
13451
- * @returns A promise that resolves to `true` when all tabs have been closed.
13452
- * @stubbed
13453
- */
13454
- close(tab: Tab | readonly Tab[], preserveFocus?: boolean): Thenable<boolean>;
13455
-
13456
- /**
13457
- * Closes the tab group. This makes the tab group object invalid and the tab group
13458
- * should no longer be used for further actions.
13459
- * @param tabGroup The tab group to close.
13460
- * @param preserveFocus When `true` focus will remain in its current position.
13461
- * @returns A promise that resolves to `true` when all tab groups have been closed.
13462
- * @stubbed
13463
- */
13464
- close(tabGroup: TabGroup | readonly TabGroup[], preserveFocus?: boolean): Thenable<boolean>;
13465
- }
13474
+ export class TabInputText {
13475
+ /**
13476
+ * The uri represented by the tab.
13477
+ * @stubbed
13478
+ */
13479
+ readonly uri: Uri;
13480
+ /**
13481
+ * Constructs a text tab input with the given URI.
13482
+ * @param uri The URI of the tab.
13483
+ * @stubbed
13484
+ */
13485
+ constructor(uri: Uri);
13486
+ }
13487
+
13488
+ /**
13489
+ * The tab represents two text based resources
13490
+ * being rendered as a diff.
13491
+ */
13492
+ export class TabInputTextDiff {
13493
+ /**
13494
+ * The uri of the original text resource.
13495
+ * @stubbed
13496
+ */
13497
+ readonly original: Uri;
13498
+ /**
13499
+ * The uri of the modified text resource.
13500
+ * @stubbed
13501
+ */
13502
+ readonly modified: Uri;
13503
+ /**
13504
+ * Constructs a new text diff tab input with the given URIs.
13505
+ * @param original The uri of the original text resource.
13506
+ * @param modified The uri of the modified text resource.
13507
+ * @stubbed
13508
+ */
13509
+ constructor(original: Uri, modified: Uri);
13510
+ }
13511
+
13512
+ /**
13513
+ * The tab represents a custom editor.
13514
+ */
13515
+ export class TabInputCustom {
13516
+ /**
13517
+ * The uri that the tab is representing.
13518
+ * @stubbed
13519
+ */
13520
+ readonly uri: Uri;
13521
+ /**
13522
+ * The type of custom editor.
13523
+ * @stubbed
13524
+ */
13525
+ readonly viewType: string;
13526
+ /**
13527
+ * Constructs a custom editor tab input.
13528
+ * @param uri The uri of the tab.
13529
+ * @param viewType The viewtype of the custom editor.
13530
+ * @stubbed
13531
+ */
13532
+ constructor(uri: Uri, viewType: string);
13533
+ }
13534
+
13535
+ /**
13536
+ * The tab represents a webview.
13537
+ */
13538
+ export class TabInputWebview {
13539
+ /**
13540
+ * The type of webview. Maps to WebviewPanel's viewType
13541
+ * @stubbed
13542
+ */
13543
+ readonly viewType: string;
13544
+ /**
13545
+ * Constructs a webview tab input with the given view type.
13546
+ * @param viewType The type of webview. Maps to WebviewPanel's viewType
13547
+ * @stubbed
13548
+ */
13549
+ constructor(viewType: string);
13550
+ }
13551
+
13552
+ /**
13553
+ * The tab represents a notebook.
13554
+ */
13555
+ export class TabInputNotebook {
13556
+ /**
13557
+ * The uri that the tab is representing.
13558
+ * @stubbed
13559
+ */
13560
+ readonly uri: Uri;
13561
+ /**
13562
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13563
+ * @stubbed
13564
+ */
13565
+ readonly notebookType: string;
13566
+ /**
13567
+ * Constructs a new tab input for a notebook.
13568
+ * @param uri The uri of the notebook.
13569
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13570
+ * @stubbed
13571
+ */
13572
+ constructor(uri: Uri, notebookType: string);
13573
+ }
13574
+
13575
+ /**
13576
+ * The tabs represents two notebooks in a diff configuration.
13577
+ */
13578
+ export class TabInputNotebookDiff {
13579
+ /**
13580
+ * The uri of the original notebook.
13581
+ * @stubbed
13582
+ */
13583
+ readonly original: Uri;
13584
+ /**
13585
+ * The uri of the modified notebook.
13586
+ * @stubbed
13587
+ */
13588
+ readonly modified: Uri;
13589
+ /**
13590
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13591
+ * @stubbed
13592
+ */
13593
+ readonly notebookType: string;
13594
+ /**
13595
+ * Constructs a notebook diff tab input.
13596
+ * @param original The uri of the original unmodified notebook.
13597
+ * @param modified The uri of the modified notebook.
13598
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13599
+ * @stubbed
13600
+ */
13601
+ constructor(original: Uri, modified: Uri, notebookType: string);
13602
+ }
13603
+
13604
+ /**
13605
+ * The tab represents a terminal in the editor area.
13606
+ */
13607
+ export class TabInputTerminal {
13608
+ /**
13609
+ * Constructs a terminal tab input.
13610
+ * @stubbed
13611
+ */
13612
+ constructor();
13613
+ }
13614
+
13615
+ /**
13616
+ * Represents a tab within a {@link TabGroup group of tabs}.
13617
+ * Tabs are merely the graphical representation within the editor area.
13618
+ * A backing editor is not a guarantee.
13619
+ */
13620
+ export interface Tab {
13621
+
13622
+ /**
13623
+ * The text displayed on the tab.
13624
+ * @stubbed
13625
+ */
13626
+ readonly label: string;
13627
+
13628
+ /**
13629
+ * The group which the tab belongs to.
13630
+ * @stubbed
13631
+ */
13632
+ readonly group: TabGroup;
13633
+
13634
+ /**
13635
+ * Defines the structure of the tab i.e. text, notebook, custom, etc.
13636
+ * Resource and other useful properties are defined on the tab kind.
13637
+ * @stubbed
13638
+ */
13639
+ readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;
13640
+
13641
+ /**
13642
+ * Whether or not the tab is currently active.
13643
+ * This is dictated by being the selected tab in the group.
13644
+ * @stubbed
13645
+ */
13646
+ readonly isActive: boolean;
13647
+
13648
+ /**
13649
+ * Whether or not the dirty indicator is present on the tab.
13650
+ * @stubbed
13651
+ */
13652
+ readonly isDirty: boolean;
13653
+
13654
+ /**
13655
+ * Whether or not the tab is pinned (pin icon is present).
13656
+ * @stubbed
13657
+ */
13658
+ readonly isPinned: boolean;
13659
+
13660
+ /**
13661
+ * Whether or not the tab is in preview mode.
13662
+ * @stubbed
13663
+ */
13664
+ readonly isPreview: boolean;
13665
+ }
13666
+
13667
+ /**
13668
+ * An event describing change to tabs.
13669
+ */
13670
+ export interface TabChangeEvent {
13671
+ /**
13672
+ * The tabs that have been opened.
13673
+ * @stubbed
13674
+ */
13675
+ readonly opened: readonly Tab[];
13676
+ /**
13677
+ * The tabs that have been closed.
13678
+ * @stubbed
13679
+ */
13680
+ readonly closed: readonly Tab[];
13681
+ /**
13682
+ * Tabs that have changed, e.g have changed
13683
+ * their {@link Tab.isActive active} state.
13684
+ * @stubbed
13685
+ */
13686
+ readonly changed: readonly Tab[];
13687
+ }
13688
+
13689
+ /**
13690
+ * An event describing changes to tab groups.
13691
+ */
13692
+ export interface TabGroupChangeEvent {
13693
+ /**
13694
+ * Tab groups that have been opened.
13695
+ * @stubbed
13696
+ */
13697
+ readonly opened: readonly TabGroup[];
13698
+ /**
13699
+ * Tab groups that have been closed.
13700
+ * @stubbed
13701
+ */
13702
+ readonly closed: readonly TabGroup[];
13703
+ /**
13704
+ * Tab groups that have changed, e.g have changed
13705
+ * their {@link TabGroup.isActive active} state.
13706
+ * @stubbed
13707
+ */
13708
+ readonly changed: readonly TabGroup[];
13709
+ }
13710
+
13711
+ /**
13712
+ * Represents a group of tabs. A tab group itself consists of multiple tabs.
13713
+ */
13714
+ export interface TabGroup {
13715
+ /**
13716
+ * Whether or not the group is currently active.
13717
+ *
13718
+ * *Note* that only one tab group is active at a time, but that multiple tab
13719
+ * groups can have an {@link TabGroup.aciveTab active tab}.
13720
+ *
13721
+ * @see {@link Tab.isActive}
13722
+ * @stubbed
13723
+ */
13724
+ readonly isActive: boolean;
13725
+
13726
+ /**
13727
+ * The view column of the group.
13728
+ * @stubbed
13729
+ */
13730
+ readonly viewColumn: ViewColumn;
13731
+
13732
+ /**
13733
+ * The active {@link Tab tab} in the group. This is the tab whose contents are currently
13734
+ * being rendered.
13735
+ *
13736
+ * *Note* that there can be one active tab per group but there can only be one {@link TabGroups.activeTabGroup active group}.
13737
+ * @stubbed
13738
+ */
13739
+ readonly activeTab: Tab | undefined;
13740
+
13741
+ /**
13742
+ * The list of tabs contained within the group.
13743
+ * This can be empty if the group has no tabs open.
13744
+ * @stubbed
13745
+ */
13746
+ readonly tabs: readonly Tab[];
13747
+ }
13748
+
13749
+ /**
13750
+ * Represents the main editor area which consists of multple groups which contain tabs.
13751
+ */
13752
+ export interface TabGroups {
13753
+ /**
13754
+ * All the groups within the group container.
13755
+ * @stubbed
13756
+ */
13757
+ readonly all: readonly TabGroup[];
13758
+
13759
+ /**
13760
+ * The currently active group.
13761
+ * @stubbed
13762
+ */
13763
+ readonly activeTabGroup: TabGroup;
13764
+
13765
+ /**
13766
+ * An {@link Event event} which fires when {@link TabGroup tab groups} have changed.
13767
+ * @stubbed
13768
+ */
13769
+ readonly onDidChangeTabGroups: Event<TabGroupChangeEvent>;
13770
+
13771
+ /**
13772
+ * An {@link Event event} which fires when {@link Tab tabs} have changed.
13773
+ * @stubbed
13774
+ */
13775
+ readonly onDidChangeTabs: Event<TabChangeEvent>;
13776
+
13777
+ /**
13778
+ * Closes the tab. This makes the tab object invalid and the tab
13779
+ * should no longer be used for further actions.
13780
+ * Note: In the case of a dirty tab, a confirmation dialog will be shown which may be cancelled. If cancelled the tab is still valid
13781
+ *
13782
+ * @param tab The tab to close.
13783
+ * @param preserveFocus When `true` focus will remain in its current position. If `false` it will jump to the next tab.
13784
+ * @returns A promise that resolves to `true` when all tabs have been closed.
13785
+ * @stubbed
13786
+ */
13787
+ close(tab: Tab | readonly Tab[], preserveFocus?: boolean): Thenable<boolean>;
13788
+
13789
+ /**
13790
+ * Closes the tab group. This makes the tab group object invalid and the tab group
13791
+ * should no longer be used for further actions.
13792
+ * @param tabGroup The tab group to close.
13793
+ * @param preserveFocus When `true` focus will remain in its current position.
13794
+ * @returns A promise that resolves to `true` when all tab groups have been closed.
13795
+ * @stubbed
13796
+ */
13797
+ close(tabGroup: TabGroup | readonly TabGroup[], preserveFocus?: boolean): Thenable<boolean>;
13798
+ }
13466
13799
 
13467
13800
  /**
13468
13801
  * Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
@@ -14196,6 +14529,54 @@ export module '@theia/plugin' {
14196
14529
  readonly selections?: readonly NotebookRange[];
14197
14530
  }
14198
14531
 
14532
+ /**
14533
+ * A snippet edit represents an interactive edit that is performed by
14534
+ * the editor.
14535
+ *
14536
+ * *Note* that a snippet edit can always be performed as a normal {@link TextEdit text edit}.
14537
+ * This will happen when no matching editor is open or when a {@link WorkspaceEdit workspace edit}
14538
+ * contains snippet edits for multiple files. In that case only those that match the active editor
14539
+ * will be performed as snippet edits and the others as normal text edits.
14540
+ */
14541
+ export class SnippetTextEdit {
14542
+
14543
+ /**
14544
+ * Utility to create a replace snippet edit.
14545
+ *
14546
+ * @param range A range.
14547
+ * @param snippet A snippet string.
14548
+ * @return A new snippet edit object.
14549
+ */
14550
+ static replace(range: Range, snippet: SnippetString): SnippetTextEdit;
14551
+
14552
+ /**
14553
+ * Utility to create an insert snippet edit.
14554
+ *
14555
+ * @param position A position, will become an empty range.
14556
+ * @param snippet A snippet string.
14557
+ * @return A new snippet edit object.
14558
+ */
14559
+ static insert(position: Position, snippet: SnippetString): SnippetTextEdit;
14560
+
14561
+ /**
14562
+ * The range this edit applies to.
14563
+ */
14564
+ range: Range;
14565
+
14566
+ /**
14567
+ * The {@link SnippetString snippet} this edit will perform.
14568
+ */
14569
+ snippet: SnippetString;
14570
+
14571
+ /**
14572
+ * Create a new snippet edit.
14573
+ *
14574
+ * @param range A range.
14575
+ * @param snippet A snippet string.
14576
+ */
14577
+ constructor(range: Range, snippet: SnippetString);
14578
+ }
14579
+
14199
14580
  /**
14200
14581
  * A notebook edit represents edits that should be applied to the contents of a notebook.
14201
14582
  */