@theia/plugin 1.29.0-next.7 → 1.30.0-next.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.29.0-next.7+5aeef6c0c68",
3
+ "version": "1.30.0-next.0+da356b53703",
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.28.0"
30
+ "@theia/ext-scripts": "1.29.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "5aeef6c0c683b4e91713ab736957e6655b486adc"
35
+ "gitHead": "da356b537037680cdc7283a695ebfbf0c00d2cf1"
36
36
  }
@@ -21,130 +21,6 @@
21
21
  * These API are NOT stable and subject to change. Use it on own risk.
22
22
  */
23
23
  export module '@theia/plugin' {
24
- // #region auth provider
25
-
26
- /**
27
- * An [event](#Event) which fires when an [AuthenticationProvider](#AuthenticationProvider) is added or removed.
28
- */
29
- export interface AuthenticationProvidersChangeEvent {
30
- /**
31
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added.
32
- */
33
- readonly added: ReadonlyArray<AuthenticationProviderInformation>;
34
-
35
- /**
36
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
37
- */
38
- readonly removed: ReadonlyArray<AuthenticationProviderInformation>;
39
- }
40
-
41
- /**
42
- * An [event](#Event) which fires when an [AuthenticationSession](#AuthenticationSession) is added, removed, or changed.
43
- */
44
- export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
45
- /**
46
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been added.
47
- */
48
- readonly added: ReadonlyArray<string>;
49
-
50
- /**
51
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been removed.
52
- */
53
- readonly removed: ReadonlyArray<string>;
54
-
55
- /**
56
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been changed.
57
- */
58
- readonly changed: ReadonlyArray<string>;
59
- }
60
-
61
- /**
62
- * **WARNING** When writing an AuthenticationProvider, `id` should be treated as part of your extension's
63
- * API, changing it is a breaking change for all extensions relying on the provider. The id is
64
- * treated case-sensitively.
65
- */
66
- export interface AuthenticationProvider {
67
- /**
68
- * Used as an identifier for extensions trying to work with a particular
69
- * provider: 'microsoft', 'github', etc. id must be unique, registering
70
- * another provider with the same id will fail.
71
- */
72
- readonly id: string;
73
-
74
- /**
75
- * The human-readable name of the provider.
76
- */
77
- readonly label: string;
78
-
79
- /**
80
- * Whether it is possible to be signed into multiple accounts at once with this provider
81
- */
82
- readonly supportsMultipleAccounts: boolean;
83
-
84
- /**
85
- * Returns an array of current sessions.
86
- */
87
- getSessions(): Thenable<ReadonlyArray<AuthenticationSession>>;
88
-
89
- /**
90
- * Prompts a user to login.
91
- */
92
- login(scopes: string[]): Thenable<AuthenticationSession>;
93
-
94
- /**
95
- * Removes the session corresponding to session id.
96
- * @param sessionId The session id to log out of
97
- */
98
- logout(sessionId: string): Thenable<void>;
99
- }
100
-
101
- export namespace authentication {
102
- /**
103
- * Register an authentication provider.
104
- *
105
- * There can only be one provider per id and an error is being thrown when an id
106
- * has already been used by another provider.
107
- *
108
- * @param provider The authentication provider provider.
109
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
110
- */
111
- export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable;
112
-
113
- /**
114
- * Fires with the provider id that was registered or unregistered.
115
- */
116
- export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
117
-
118
- /**
119
- * @deprecated
120
- * The ids of the currently registered authentication providers.
121
- * @returns An array of the ids of authentication providers that are currently registered.
122
- */
123
- export function getProviderIds(): Thenable<ReadonlyArray<string>>;
124
-
125
- /**
126
- * @deprecated
127
- * An array of the ids of authentication providers that are currently registered.
128
- */
129
- export const providerIds: ReadonlyArray<string>;
130
-
131
- /**
132
- * An array of the information of authentication providers that are currently registered.
133
- */
134
- export const providers: ReadonlyArray<AuthenticationProviderInformation>;
135
-
136
- /**
137
- * @deprecated
138
- * Logout of a specific session.
139
- * @param providerId The id of the provider to use
140
- * @param sessionId The session id to remove
141
- * provider
142
- */
143
- export function logout(providerId: string, sessionId: string): Thenable<void>;
144
- }
145
-
146
- // #endregion
147
-
148
24
  /**
149
25
  * The contiguous set of modified lines in a diff.
150
26
  */
package/src/theia.d.ts CHANGED
@@ -2353,6 +2353,32 @@ export module '@theia/plugin' {
2353
2353
  ignoreFocusOut?: boolean;
2354
2354
  }
2355
2355
 
2356
+ /**
2357
+ * Impacts the behavior and appearance of the validation message.
2358
+ */
2359
+ export enum InputBoxValidationSeverity {
2360
+ Info = 1,
2361
+ Warning = 2,
2362
+ Error = 3
2363
+ }
2364
+
2365
+ /**
2366
+ * Object to configure the behavior of the validation message.
2367
+ */
2368
+ export interface InputBoxValidationMessage {
2369
+ /**
2370
+ * The validation message to display.
2371
+ */
2372
+ readonly message: string;
2373
+
2374
+ /**
2375
+ * The severity of the validation message.
2376
+ * NOTE: When using `InputBoxValidationSeverity.Error`, the user will not be allowed to accept (hit ENTER) the input.
2377
+ * `Info` and `Warning` will still allow the InputBox to accept the input.
2378
+ */
2379
+ readonly severity: InputBoxValidationSeverity;
2380
+ }
2381
+
2356
2382
  /**
2357
2383
  * Options to configure the behavior of the input box UI.
2358
2384
  */
@@ -2401,10 +2427,10 @@ export module '@theia/plugin' {
2401
2427
  * to the user.
2402
2428
  *
2403
2429
  * @param value The current value of the input box.
2404
- * @return A human readable string which is presented as diagnostic message.
2405
- * Return `undefined`, or the empty string when 'value' is valid.
2430
+ * @return Either a human-readable string which is presented as an error message or an {@link InputBoxValidationMessage}
2431
+ * which can provide a specific message severity. Return `undefined`, `null`, or the empty string when 'value' is valid.
2406
2432
  */
2407
- validateInput?: (input: string) => Promise<string | null | undefined> | undefined;
2433
+ validateInput?: (input: string) => Promise<string | InputBoxValidationMessage | null | undefined> | undefined;
2408
2434
 
2409
2435
  /**
2410
2436
  * An optional function that will be called on Enter key.
@@ -4465,7 +4491,7 @@ export module '@theia/plugin' {
4465
4491
  * @param token A token that can be used to signal cancellation.
4466
4492
  * @return A promise that resolves to the selection or `undefined`.
4467
4493
  */
4468
- export function showQuickPick(readonly items: string[] | Thenable<readonly string[]>, options: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>;
4494
+ export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>;
4469
4495
 
4470
4496
  /**
4471
4497
  * Shows a selection list allowing multiple selections.
@@ -4475,7 +4501,7 @@ export module '@theia/plugin' {
4475
4501
  * @param token A token that can be used to signal cancellation.
4476
4502
  * @return A promise that resolves to the selected items or `undefined`.
4477
4503
  */
4478
- export function showQuickPick(readonly items: string[] | Thenable<readonly string[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): Thenable<string[] | undefined>;
4504
+ export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): Thenable<string[] | undefined>;
4479
4505
 
4480
4506
  /**
4481
4507
  * Shows a selection list.
@@ -4485,7 +4511,7 @@ export module '@theia/plugin' {
4485
4511
  * @param token A token that can be used to signal cancellation.
4486
4512
  * @return A promise that resolves to the selected item or `undefined`.
4487
4513
  */
4488
- export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>;
4514
+ export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>;
4489
4515
 
4490
4516
  /**
4491
4517
  * Shows a selection list allowing multiple selections.
@@ -5065,8 +5091,10 @@ export module '@theia/plugin' {
5065
5091
 
5066
5092
  /**
5067
5093
  * An optional validation message indicating a problem with the current input value.
5094
+ * By returning a string, the InputBox will use a default {@link InputBoxValidationSeverity} of Error.
5095
+ * Returning undefined clears the validation message.
5068
5096
  */
5069
- validationMessage: string | undefined;
5097
+ validationMessage: string | InputBoxValidationMessage | undefined;
5070
5098
  }
5071
5099
 
5072
5100
  /**
@@ -9276,6 +9304,18 @@ export module '@theia/plugin' {
9276
9304
  */
9277
9305
  export function registerHoverProvider(selector: DocumentSelector, provider: HoverProvider): Disposable;
9278
9306
 
9307
+ /**
9308
+ * Register a provider that locates evaluatable expressions in text documents.
9309
+ * The editor will evaluate the expression in the active debug session and will show the result in the debug hover.
9310
+ *
9311
+ * If multiple providers are registered for a language an arbitrary provider will be used.
9312
+ *
9313
+ * @param selector A selector that defines the documents this provider is applicable to.
9314
+ * @param provider An evaluatable expression provider.
9315
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
9316
+ */
9317
+ export function registerEvaluatableExpressionProvider(selector: DocumentSelector, provider: EvaluatableExpressionProvider): Disposable;
9318
+
9279
9319
  /**
9280
9320
  * Register a workspace symbol provider.
9281
9321
  *
@@ -9589,6 +9629,54 @@ export module '@theia/plugin' {
9589
9629
  provideHover(document: TextDocument, position: Position, token: CancellationToken | undefined): ProviderResult<Hover>;
9590
9630
  }
9591
9631
 
9632
+ /**
9633
+ * An EvaluatableExpression represents an expression in a document that can be evaluated by an active debugger or runtime.
9634
+ * The result of this evaluation is shown in a tooltip-like widget.
9635
+ * If only a range is specified, the expression will be extracted from the underlying document.
9636
+ * An optional expression can be used to override the extracted expression.
9637
+ * In this case the range is still used to highlight the range in the document.
9638
+ */
9639
+ export class EvaluatableExpression {
9640
+
9641
+ /*
9642
+ * The range is used to extract the evaluatable expression from the underlying document and to highlight it.
9643
+ */
9644
+ readonly range: Range;
9645
+
9646
+ /*
9647
+ * If specified the expression overrides the extracted expression.
9648
+ */
9649
+ readonly expression?: string | undefined;
9650
+
9651
+ /**
9652
+ * Creates a new evaluatable expression object.
9653
+ *
9654
+ * @param range The range in the underlying document from which the evaluatable expression is extracted.
9655
+ * @param expression If specified overrides the extracted expression.
9656
+ */
9657
+ constructor(range: Range, expression?: string);
9658
+ }
9659
+
9660
+ /**
9661
+ * The evaluatable expression provider interface defines the contract between extensions and
9662
+ * the debug hover. In this contract the provider returns an evaluatable expression for a given position
9663
+ * in a document and the editor evaluates this expression in the active debug session and shows the result in a debug hover.
9664
+ */
9665
+ export interface EvaluatableExpressionProvider {
9666
+ /**
9667
+ * Provide an evaluatable expression for the given document and position.
9668
+ * The editor will evaluate this expression in the active debug session and will show the result in the debug hover.
9669
+ * The expression can be implicitly specified by the range in the underlying document or by explicitly returning an expression.
9670
+ *
9671
+ * @param document The document for which the debug hover is about to appear.
9672
+ * @param position The line and character position in the document where the debug hover is about to appear.
9673
+ * @param token A cancellation token.
9674
+ * @return An EvaluatableExpression or a thenable that resolves to such. The lack of a result can be
9675
+ * signaled by returning `undefined` or `null`.
9676
+ */
9677
+ provideEvaluatableExpression(document: TextDocument, position: Position, token: CancellationToken | undefined): ProviderResult<EvaluatableExpression>;
9678
+ }
9679
+
9592
9680
  /**
9593
9681
  * A document highlight kind.
9594
9682
  */
@@ -11755,7 +11843,7 @@ export module '@theia/plugin' {
11755
11843
  * The permissions granted by the session's access token. Available scopes
11756
11844
  * are defined by the [AuthenticationProvider](#AuthenticationProvider).
11757
11845
  */
11758
- readonly scopes: ReadonlyArray<string>;
11846
+ readonly scopes: readonly string[];
11759
11847
  }
11760
11848
 
11761
11849
  /**
@@ -11990,12 +12078,6 @@ export module '@theia/plugin' {
11990
12078
  * @return A {@link Disposable} that unregisters this provider when being disposed.
11991
12079
  */
11992
12080
  export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;
11993
-
11994
- /**
11995
- * @deprecated Use {@link getSession()} {@link AuthenticationGetSessionOptions.silent} instead.
11996
- */
11997
- export function hasSession(providerId: string, scopes: readonly string[]): Thenable<boolean>;
11998
-
11999
12081
  }
12000
12082
  }
12001
12083