@theia/plugin 1.60.0-next.43 → 1.60.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 +62 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.60.0-next.43+2a13720d2",
3
+ "version": "1.60.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.59.0"
30
+ "@theia/ext-scripts": "1.60.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "2a13720d2d41d8ae6ee4e34cd2dee1c656a18018"
35
+ "gitHead": "193fa55d7e26aa9dc8acba3ae3b99b0182f3603f"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -1148,7 +1148,20 @@ export module '@theia/plugin' {
1148
1148
  * @return A promise that resolves with a value indicating if the snippet could be inserted. Note that the promise does not signal
1149
1149
  * that the snippet is completely filled-in or accepted.
1150
1150
  */
1151
- insertSnippet(snippet: SnippetString, location?: Position | Range | Position[] | Range[], options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable<boolean>;
1151
+ insertSnippet(snippet: SnippetString, location?: Position | Range | Position[] | Range[], options?: {
1152
+ /**
1153
+ * Add undo stop before making the edits.
1154
+ */
1155
+ readonly undoStopBefore: boolean;
1156
+ /**
1157
+ * Add undo stop after making the edits.
1158
+ */
1159
+ readonly undoStopAfter: boolean;
1160
+ /**
1161
+ * Keep whitespace of the {@link SnippetString.value} as is.
1162
+ */
1163
+ readonly keepWhitespace?: boolean;
1164
+ }): Thenable<boolean>;
1152
1165
 
1153
1166
  /**
1154
1167
  * Adds a set of decorations to the text editor. If a set of decorations already exists with
@@ -12245,6 +12258,26 @@ export module '@theia/plugin' {
12245
12258
  */
12246
12259
  hideWhenEmpty?: boolean;
12247
12260
 
12261
+ /**
12262
+ * Context value of the resource group. This can be used to contribute resource group specific actions.
12263
+ * For example, if a resource group is given a context value of `exportable`, when contributing actions to `scm/resourceGroup/context`
12264
+ * using `menus` extension point, you can specify context value for key `scmResourceGroupState` in `when` expressions, like `scmResourceGroupState == exportable`.
12265
+ * ```json
12266
+ * "contributes": {
12267
+ * "menus": {
12268
+ * "scm/resourceGroup/context": [
12269
+ * {
12270
+ * "command": "extension.export",
12271
+ * "when": "scmResourceGroupState == exportable"
12272
+ * }
12273
+ * ]
12274
+ * }
12275
+ * }
12276
+ * ```
12277
+ * This will show action `extension.export` only for resource groups with `contextValue` equal to `exportable`.
12278
+ */
12279
+ contextValue?: string;
12280
+
12248
12281
  /**
12249
12282
  * This group's collection of
12250
12283
  * {@link SourceControlResourceState source control resource states}.
@@ -14773,9 +14806,9 @@ export module '@theia/plugin' {
14773
14806
  }
14774
14807
 
14775
14808
  /**
14776
- * Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.
14809
+ * Optional options to be used when calling {@link authentication.getSession} with interactive options `forceNewSession` & `createIfNone`.
14777
14810
  */
14778
- export interface AuthenticationForceNewSessionOptions {
14811
+ export interface AuthenticationGetSessionPresentationOptions {
14779
14812
  /**
14780
14813
  * An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context
14781
14814
  * as to why you are asking a user to re-authenticate can help increase the odds that they will accept.
@@ -14783,6 +14816,12 @@ export module '@theia/plugin' {
14783
14816
  detail?: string;
14784
14817
  }
14785
14818
 
14819
+ /**
14820
+ * Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.
14821
+ * @deprecated Use {@link AuthenticationGetSessionPresentationOptions} instead.
14822
+ */
14823
+ export type AuthenticationForceNewSessionOptions = AuthenticationGetSessionPresentationOptions;
14824
+
14786
14825
  /**
14787
14826
  * Options to be used when getting an {@link AuthenticationSession AuthenticationSession} from an {@link AuthenticationProvider AuthenticationProvider}.
14788
14827
  */
@@ -14794,9 +14833,14 @@ export module '@theia/plugin' {
14794
14833
  * on the accounts activity bar icon. An entry for the extension will be added under the menu to sign in. This
14795
14834
  * allows quietly prompting the user to sign in.
14796
14835
  *
14836
+ * If you provide options, you will also see the dialog but with the additional context provided.
14837
+ *
14838
+ * If there is a matching session but the extension has not been granted access to it, setting this to true
14839
+ * will also result in an immediate modal dialog, and false will add a numbered badge to the accounts icon.
14840
+ *
14797
14841
  * Defaults to false.
14798
14842
  */
14799
- createIfNone?: boolean;
14843
+ createIfNone?: boolean | AuthenticationGetSessionPresentationOptions;
14800
14844
 
14801
14845
  /**
14802
14846
  * Whether the existing user session preference should be cleared.
@@ -14815,9 +14859,14 @@ export module '@theia/plugin' {
14815
14859
  * If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios
14816
14860
  * where the token needs to be re minted because it has lost some authorization.
14817
14861
  *
14818
- * Defaults to false.
14862
+ * If you provide options, you will also see the dialog but with the additional context provided.
14863
+ *
14864
+ * If there are no existing sessions and forceNewSession is true, it will behave identically to
14865
+ * {@link AuthenticationGetSessionOptions.createIfNone createIfNone}.
14866
+ *
14867
+ * Defaults to false.
14819
14868
  */
14820
- forceNewSession?: boolean | AuthenticationForceNewSessionOptions;
14869
+ forceNewSession?: boolean | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions;
14821
14870
 
14822
14871
  /**
14823
14872
  * Whether we should show the indication to sign in in the Accounts menu.
@@ -14970,7 +15019,7 @@ export module '@theia/plugin' {
14970
15019
  * @param options The {@link GetSessionOptions getSessionOptions} to use
14971
15020
  * @returns A thenable that resolves to an authentication session
14972
15021
  */
14973
- export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { createIfNone: true }): Thenable<AuthenticationSession>;
15022
+ export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { createIfNone: true | AuthenticationGetSessionPresentationOptions }): Thenable<AuthenticationSession>;
14974
15023
 
14975
15024
  /**
14976
15025
  * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -14985,7 +15034,7 @@ export module '@theia/plugin' {
14985
15034
  * @param options The {@link AuthenticationGetSessionOptions} to use
14986
15035
  * @returns A thenable that resolves to an authentication session
14987
15036
  */
14988
- export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { forceNewSession: true | { detail: string } }): Thenable<AuthenticationSession>;
15037
+ export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { forceNewSession: true | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions }): Thenable<AuthenticationSession>;
14989
15038
 
14990
15039
  /**
14991
15040
  * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -16301,6 +16350,11 @@ export module '@theia/plugin' {
16301
16350
  */
16302
16351
  snippet: SnippetString;
16303
16352
 
16353
+ /**
16354
+ * Whether the snippet edit should be applied with existing whitespace preserved.
16355
+ */
16356
+ keepWhitespace?: boolean;
16357
+
16304
16358
  /**
16305
16359
  * Create a new snippet edit.
16306
16360
  *