@theia/plugin 1.25.0-next.2 → 1.25.0-next.20

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.2+ce495c5fb38",
3
+ "version": "1.25.0-next.20+c78d302e4cd",
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": "ce495c5fb3845dd48ccb525e43fdf24a34d04a16"
35
+ "gitHead": "c78d302e4cddfec1acbe60933fc3ac3ec6f0932d"
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
  */
@@ -2447,6 +2481,14 @@ export module '@theia/plugin' {
2447
2481
  */
2448
2482
  export interface StatusBarItem {
2449
2483
 
2484
+ /**
2485
+ * The identifier of this item.
2486
+ *
2487
+ * *Note*: if no identifier was provided by the {@linkcode window.createStatusBarItem}
2488
+ * method, the identifier will match the {@link Extension.id extension identifier}.
2489
+ */
2490
+ readonly id: string;
2491
+
2450
2492
  /**
2451
2493
  * The alignment of this item.
2452
2494
  */
@@ -2458,6 +2500,13 @@ export module '@theia/plugin' {
2458
2500
  */
2459
2501
  readonly priority: number;
2460
2502
 
2503
+ /**
2504
+ * The name of the entry, like 'Python Language Indicator', 'Git Status' etc.
2505
+ * Try to keep the length of the name short, yet descriptive enough that
2506
+ * users can understand what the status bar item is about.
2507
+ */
2508
+ name: string | undefined;
2509
+
2461
2510
  /**
2462
2511
  * The text to show for the entry. To set a text with icon use the following pattern in text string:
2463
2512
  * $(fontawesomeClassName)
@@ -2474,11 +2523,30 @@ export module '@theia/plugin' {
2474
2523
  */
2475
2524
  color: string | ThemeColor | undefined;
2476
2525
 
2526
+ /**
2527
+ * The background color for this entry.
2528
+ *
2529
+ * *Note*: only the following colors are supported:
2530
+ * * `new ThemeColor('statusBarItem.errorBackground')`
2531
+ * * `new ThemeColor('statusBarItem.warningBackground')`
2532
+ *
2533
+ * More background colors may be supported in the future.
2534
+ *
2535
+ * *Note*: when a background color is set, the statusbar may override
2536
+ * the `color` choice to ensure the entry is readable in all themes.
2537
+ */
2538
+ backgroundColor: ThemeColor | undefined;
2539
+
2477
2540
  /**
2478
2541
  * The identifier of a command to run on click.
2479
2542
  */
2480
2543
  command: string | Command | undefined;
2481
2544
 
2545
+ /**
2546
+ * Accessibility information used when a screen reader interacts with this StatusBar item.
2547
+ */
2548
+ accessibilityInformation: AccessibilityInformation | undefined;
2549
+
2482
2550
  /**
2483
2551
  * Shows the entry in the status bar.
2484
2552
  */
@@ -5239,6 +5307,13 @@ export module '@theia/plugin' {
5239
5307
  */
5240
5308
  contextValue?: string;
5241
5309
 
5310
+ /**
5311
+ * Accessibility information used when screen reader interacts with this tree item.
5312
+ * Generally, a TreeItem has no need to set the `role` of the accessibilityInformation;
5313
+ * however, there are cases where a TreeItem is not displayed in a tree-like way where setting the `role` may make sense.
5314
+ */
5315
+ accessibilityInformation?: AccessibilityInformation;
5316
+
5242
5317
  /**
5243
5318
  * @param label A human-readable string describing this item
5244
5319
  * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
@@ -6833,8 +6908,7 @@ export module '@theia/plugin' {
6833
6908
  * thenable.
6834
6909
  *
6835
6910
  */
6836
- export type ProviderResult<T> = T | undefined | PromiseLike<T | undefined>;
6837
-
6911
+ export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
6838
6912
  /**
6839
6913
  * A symbol kind.
6840
6914
  */
@@ -7909,7 +7983,7 @@ export module '@theia/plugin' {
7909
7983
  *
7910
7984
  * A code action can be any command that is [known](#commands.getCommands) to the system.
7911
7985
  */
7912
- export interface CodeActionProvider {
7986
+ export interface CodeActionProvider<T extends CodeAction = CodeAction> {
7913
7987
  /**
7914
7988
  * Provide commands for the given document and range.
7915
7989
  *
@@ -7921,12 +7995,7 @@ export module '@theia/plugin' {
7921
7995
  * @return An array of commands, quick fixes, or refactorings or a thenable of such. The lack of a result can be
7922
7996
  * signaled by returning `undefined`, `null`, or an empty array.
7923
7997
  */
7924
- provideCodeActions(
7925
- document: TextDocument,
7926
- range: Range | Selection,
7927
- context: CodeActionContext,
7928
- token: CancellationToken | undefined
7929
- ): ProviderResult<(Command | CodeAction)[]>;
7998
+ provideCodeActions(document: TextDocument, range: Range | Selection, context: CodeActionContext, token: CancellationToken | undefined): ProviderResult<(Command | T)[]>;
7930
7999
 
7931
8000
  /**
7932
8001
  * Given a code action fill in its `edit`-property. Changes to
@@ -7942,7 +8011,7 @@ export module '@theia/plugin' {
7942
8011
  * @return The resolved code action or a thenable that resolves to such. It is OK to return the given
7943
8012
  * `item`. When no result is returned, the given `item` will be used.
7944
8013
  */
7945
- resolveCodeAction?(codeAction: CodeAction, token: CancellationToken | undefined): ProviderResult<CodeAction>;
8014
+ resolveCodeAction?(codeAction: T, token: CancellationToken | undefined): ProviderResult<T>;
7946
8015
  }
7947
8016
 
7948
8017
  /**