@theia/plugin 1.60.0-next.47 → 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 +42 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.60.0-next.47+9332521b9",
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": "9332521b9aa74bf534d45968905d37e30a13c3b5"
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
@@ -14793,9 +14806,9 @@ export module '@theia/plugin' {
14793
14806
  }
14794
14807
 
14795
14808
  /**
14796
- * 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`.
14797
14810
  */
14798
- export interface AuthenticationForceNewSessionOptions {
14811
+ export interface AuthenticationGetSessionPresentationOptions {
14799
14812
  /**
14800
14813
  * An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context
14801
14814
  * as to why you are asking a user to re-authenticate can help increase the odds that they will accept.
@@ -14803,6 +14816,12 @@ export module '@theia/plugin' {
14803
14816
  detail?: string;
14804
14817
  }
14805
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
+
14806
14825
  /**
14807
14826
  * Options to be used when getting an {@link AuthenticationSession AuthenticationSession} from an {@link AuthenticationProvider AuthenticationProvider}.
14808
14827
  */
@@ -14814,9 +14833,14 @@ export module '@theia/plugin' {
14814
14833
  * on the accounts activity bar icon. An entry for the extension will be added under the menu to sign in. This
14815
14834
  * allows quietly prompting the user to sign in.
14816
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
+ *
14817
14841
  * Defaults to false.
14818
14842
  */
14819
- createIfNone?: boolean;
14843
+ createIfNone?: boolean | AuthenticationGetSessionPresentationOptions;
14820
14844
 
14821
14845
  /**
14822
14846
  * Whether the existing user session preference should be cleared.
@@ -14835,9 +14859,14 @@ export module '@theia/plugin' {
14835
14859
  * If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios
14836
14860
  * where the token needs to be re minted because it has lost some authorization.
14837
14861
  *
14838
- * 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.
14839
14868
  */
14840
- forceNewSession?: boolean | AuthenticationForceNewSessionOptions;
14869
+ forceNewSession?: boolean | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions;
14841
14870
 
14842
14871
  /**
14843
14872
  * Whether we should show the indication to sign in in the Accounts menu.
@@ -14990,7 +15019,7 @@ export module '@theia/plugin' {
14990
15019
  * @param options The {@link GetSessionOptions getSessionOptions} to use
14991
15020
  * @returns A thenable that resolves to an authentication session
14992
15021
  */
14993
- 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>;
14994
15023
 
14995
15024
  /**
14996
15025
  * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -15005,7 +15034,7 @@ export module '@theia/plugin' {
15005
15034
  * @param options The {@link AuthenticationGetSessionOptions} to use
15006
15035
  * @returns A thenable that resolves to an authentication session
15007
15036
  */
15008
- 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>;
15009
15038
 
15010
15039
  /**
15011
15040
  * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -16321,6 +16350,11 @@ export module '@theia/plugin' {
16321
16350
  */
16322
16351
  snippet: SnippetString;
16323
16352
 
16353
+ /**
16354
+ * Whether the snippet edit should be applied with existing whitespace preserved.
16355
+ */
16356
+ keepWhitespace?: boolean;
16357
+
16324
16358
  /**
16325
16359
  * Create a new snippet edit.
16326
16360
  *