@theia/plugin 1.25.0-next.1 → 1.25.0-next.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.25.0-next.1+bd604c313d2",
3
+ "version": "1.25.0-next.10+2a8f93e7737",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "bd604c313d2f2c15bb7f5cf1b21222fbe0a46f6d"
35
+ "gitHead": "2a8f93e77373fc202c9e389186ef729d3c64f3a9"
36
36
  }
@@ -642,6 +642,11 @@ export module '@theia/plugin' {
642
642
  */
643
643
  contextValue?: string;
644
644
 
645
+ /**
646
+ * Accessibility information used when screen reader interacts with this timeline item.
647
+ */
648
+ accessibilityInformation?: AccessibilityInformation;
649
+
645
650
  /**
646
651
  * @param label A human-readable string describing the timeline item
647
652
  * @param timestamp A timestamp (in milliseconds since 1 January 1970 00:00:00) for when the timeline item occurred
package/src/theia.d.ts CHANGED
@@ -496,6 +496,17 @@ export module '@theia/plugin' {
496
496
  */
497
497
  appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString;
498
498
 
499
+ /**
500
+ * Builder-function that appends a choice (`${1|a,b,c|}`) to
501
+ * the {@linkcode SnippetString.value value} of this snippet string.
502
+ *
503
+ * @param values The values for choices - the array of strings
504
+ * @param number The number of this tabstop, defaults to an auto-increment
505
+ * value starting at 1.
506
+ * @return This snippet string.
507
+ */
508
+ appendChoice(values: string[], number?: number): SnippetString;
509
+
499
510
  /**
500
511
  * Builder-function that appends a variable (`${VAR}`) to
501
512
  * the [`value`](#SnippetString.value) of this snippet string.
@@ -2180,6 +2191,11 @@ export module '@theia/plugin' {
2180
2191
  */
2181
2192
  matchOnDetail: boolean;
2182
2193
 
2194
+ /*
2195
+ * An optional flag to maintain the scroll position of the quick pick when the quick pick items are updated. Defaults to false.
2196
+ */
2197
+ keepScrollPosition?: boolean;
2198
+
2183
2199
  /**
2184
2200
  * Active items. This can be read and updated by the extension.
2185
2201
  */
@@ -2388,6 +2404,24 @@ export module '@theia/plugin' {
2388
2404
  export function getCommands(filterInternal?: boolean): PromiseLike<string[]>;
2389
2405
  }
2390
2406
 
2407
+ /**
2408
+ * Accessibility information which controls screen reader behavior.
2409
+ */
2410
+ export interface AccessibilityInformation {
2411
+ /**
2412
+ * Label to be read out by a screen reader once the item has focus.
2413
+ */
2414
+ readonly label: string;
2415
+
2416
+ /**
2417
+ * Role of the widget which defines how a screen reader interacts with it.
2418
+ * The role should be set in special cases when for example a tree-like element behaves like a checkbox.
2419
+ * If role is not specified the editor will pick the appropriate role automatically.
2420
+ * More about aria roles can be found here https://w3c.github.io/aria/#widget_roles
2421
+ */
2422
+ readonly role?: string;
2423
+ }
2424
+
2391
2425
  /**
2392
2426
  * Represents an action that is shown with a message.
2393
2427
  */
@@ -2479,6 +2513,11 @@ export module '@theia/plugin' {
2479
2513
  */
2480
2514
  command: string | Command | undefined;
2481
2515
 
2516
+ /**
2517
+ * Accessibility information used when a screen reader interacts with this StatusBar item.
2518
+ */
2519
+ accessibilityInformation: AccessibilityInformation | undefined;
2520
+
2482
2521
  /**
2483
2522
  * Shows the entry in the status bar.
2484
2523
  */
@@ -4211,36 +4250,43 @@ export module '@theia/plugin' {
4211
4250
 
4212
4251
  /**
4213
4252
  * Shows a selection list.
4214
- * @param items
4215
- * @param options
4216
- * @param token
4253
+ *
4254
+ * @param items An array of strings, or a promise that resolves to an array of strings.
4255
+ * @param options Configures the behavior of the selection list.
4256
+ * @param token A token that can be used to signal cancellation.
4257
+ * @return A promise that resolves to the selection or `undefined`.
4217
4258
  */
4218
- export function showQuickPick(items: string[] | PromiseLike<string[]>, options: QuickPickOptions, token?: CancellationToken): PromiseLike<string | undefined>;
4259
+ export function showQuickPick(readonly items: string[] | PromiseLike<readonly string[]>, options: QuickPickOptions, token?: CancellationToken): PromiseLike<string | undefined>;
4219
4260
 
4220
4261
  /**
4221
- * Shows a selection list with multiple selection allowed.
4262
+ * Shows a selection list allowing multiple selections.
4263
+ *
4264
+ * @param items An array of strings, or a promise that resolves to an array of strings.
4265
+ * @param options Configures the behavior of the selection list.
4266
+ * @param token A token that can be used to signal cancellation.
4267
+ * @return A promise that resolves to the selected items or `undefined`.
4222
4268
  */
4223
- export function showQuickPick(
4224
- items: string[] | PromiseLike<string[]>,
4225
- options: QuickPickOptions & { canPickMany: true },
4226
- token?: CancellationToken
4227
- ): PromiseLike<string[] | undefined>;
4269
+ export function showQuickPick(readonly items: string[] | PromiseLike<readonly string[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): PromiseLike<string[] | undefined>;
4228
4270
 
4229
4271
  /**
4230
4272
  * Shows a selection list.
4231
- * @param items
4232
- * @param options
4233
- * @param token
4273
+ *
4274
+ * @param items An array of items, or a promise that resolves to an array of items.
4275
+ * @param options Configures the behavior of the selection list.
4276
+ * @param token A token that can be used to signal cancellation.
4277
+ * @return A promise that resolves to the selected item or `undefined`.
4234
4278
  */
4235
- export function showQuickPick<T extends QuickPickItem>(items: T[] | PromiseLike<T[]>, options: QuickPickOptions, token?: CancellationToken): PromiseLike<T | undefined>;
4279
+ export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | PromiseLike<readonly T[]>, options: QuickPickOptions, token?: CancellationToken): PromiseLike<T | undefined>;
4236
4280
 
4237
4281
  /**
4238
- * Shows a selection list with multiple selection allowed.
4282
+ * Shows a selection list allowing multiple selections.
4283
+ *
4284
+ * @param items An array of items, or a promise that resolves to an array of items.
4285
+ * @param options Configures the behavior of the selection list.
4286
+ * @param token A token that can be used to signal cancellation.
4287
+ * @return A promise that resolves to the selected items or `undefined`.
4239
4288
  */
4240
- export function showQuickPick<T extends QuickPickItem>(items: T[] | PromiseLike<T[]>,
4241
- options: QuickPickOptions & { canPickMany: true },
4242
- token?: CancellationToken
4243
- ): PromiseLike<T[] | undefined>;
4289
+ export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | PromiseLike<readonly T[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): PromiseLike<T[] | undefined>;
4244
4290
 
4245
4291
  /**
4246
4292
  * Creates a [QuickPick](#QuickPick) to let the user pick an item from a list
@@ -5232,6 +5278,13 @@ export module '@theia/plugin' {
5232
5278
  */
5233
5279
  contextValue?: string;
5234
5280
 
5281
+ /**
5282
+ * Accessibility information used when screen reader interacts with this tree item.
5283
+ * Generally, a TreeItem has no need to set the `role` of the accessibilityInformation;
5284
+ * however, there are cases where a TreeItem is not displayed in a tree-like way where setting the `role` may make sense.
5285
+ */
5286
+ accessibilityInformation?: AccessibilityInformation;
5287
+
5235
5288
  /**
5236
5289
  * @param label A human-readable string describing this item
5237
5290
  * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
@@ -7902,7 +7955,7 @@ export module '@theia/plugin' {
7902
7955
  *
7903
7956
  * A code action can be any command that is [known](#commands.getCommands) to the system.
7904
7957
  */
7905
- export interface CodeActionProvider {
7958
+ export interface CodeActionProvider<T extends CodeAction = CodeAction> {
7906
7959
  /**
7907
7960
  * Provide commands for the given document and range.
7908
7961
  *
@@ -7914,12 +7967,7 @@ export module '@theia/plugin' {
7914
7967
  * @return An array of commands, quick fixes, or refactorings or a thenable of such. The lack of a result can be
7915
7968
  * signaled by returning `undefined`, `null`, or an empty array.
7916
7969
  */
7917
- provideCodeActions(
7918
- document: TextDocument,
7919
- range: Range | Selection,
7920
- context: CodeActionContext,
7921
- token: CancellationToken | undefined
7922
- ): ProviderResult<(Command | CodeAction)[]>;
7970
+ provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken | undefined): ProviderResult<(Command | T)[]>;
7923
7971
 
7924
7972
  /**
7925
7973
  * Given a code action fill in its `edit`-property. Changes to
@@ -7935,7 +7983,7 @@ export module '@theia/plugin' {
7935
7983
  * @return The resolved code action or a thenable that resolves to such. It is OK to return the given
7936
7984
  * `item`. When no result is returned, the given `item` will be used.
7937
7985
  */
7938
- resolveCodeAction?(codeAction: CodeAction, token: CancellationToken | undefined): ProviderResult<CodeAction>;
7986
+ resolveCodeAction?(codeAction: T, token: CancellationToken | undefined): ProviderResult<T>;
7939
7987
  }
7940
7988
 
7941
7989
  /**