55 *--------------------------------------------------------------------------------------------*/
66
77/**
8- * Type Definition for Visual Studio Code 1.97 Extension API
8+ * Type Definition for Visual Studio Code 1.98 Extension API
99 * See https://code.visualstudio.com/api for more information
1010 */
1111
@@ -507,13 +507,13 @@ declare module 'vscode' {
507507 * The position at which the selection starts.
508508 * This position might be before or after {@link Selection.active active}.
509509 */
510- anchor: Position;
510+ readonly anchor: Position;
511511
512512 /**
513513 * The position of the cursor.
514514 * This position might be before or after {@link Selection.anchor anchor}.
515515 */
516- active: Position;
516+ readonly active: Position;
517517
518518 /**
519519 * Create a selection from two positions.
@@ -536,7 +536,7 @@ declare module 'vscode' {
536536 /**
537537 * A selection is reversed if its {@link Selection.anchor anchor} is the {@link Selection.end end} position.
538538 */
539- isReversed: boolean;
539+ readonly isReversed: boolean;
540540 }
541541
542542 /**
@@ -1318,6 +1318,10 @@ declare module 'vscode' {
13181318 * Add undo stop after making the edits.
13191319 */
13201320 readonly undoStopAfter: boolean;
1321+ /**
1322+ * Keep whitespace of the {@link SnippetString.value} as is.
1323+ */
1324+ readonly keepWhitespace?: boolean;
13211325 }): Thenable<boolean>;
13221326
13231327 /**
@@ -3782,6 +3786,11 @@ declare module 'vscode' {
37823786 */
37833787 snippet: SnippetString;
37843788
3789+ /**
3790+ * Whether the snippet edit should be applied with existing whitespace preserved.
3791+ */
3792+ keepWhitespace?: boolean;
3793+
37853794 /**
37863795 * Create a new snippet edit.
37873796 *
@@ -6321,7 +6330,7 @@ declare module 'vscode' {
63216330 * Optional method which fills in the {@linkcode DocumentPasteEdit.additionalEdit} before the edit is applied.
63226331 *
63236332 * This is called once per edit and should be used if generating the complete edit may take a long time.
6324- * Resolve can only be used to change {@linkcode DocumentPasteEdit.additionalEdit}.
6333+ * Resolve can only be used to change {@linkcode DocumentPasteEdit.insertText} or {@linkcode DocumentPasteEdit. additionalEdit}.
63256334 *
63266335 * @param pasteEdit The {@linkcode DocumentPasteEdit} to resolve.
63276336 * @param token A cancellation token.
@@ -8404,7 +8413,7 @@ declare module 'vscode' {
84048413 * {@linkcode ExtensionContext.globalState globalState} to store key value data.
84058414 *
84068415 * @see {@linkcode FileSystem workspace.fs} for how to read and write files and folders from
8407- * an uri.
8416+ * a uri.
84088417 */
84098418 readonly storageUri: Uri | undefined;
84108419
@@ -11903,7 +11912,7 @@ declare module 'vscode' {
1190311912 * A map containing a mapping of the mime type of the corresponding transferred data.
1190411913 *
1190511914 * Drag and drop controllers that implement {@link TreeDragAndDropController.handleDrag `handleDrag`} can add additional mime types to the
11906- * data transfer. These additional mime types will only be included in the `handleDrop` when the the drag was initiated from
11915+ * data transfer. These additional mime types will only be included in the `handleDrop` when the drag was initiated from
1190711916 * an element in the same drag and drop controller.
1190811917 */
1190911918 export class DataTransfer implements Iterable<[mimeType: string, item: DataTransferItem]> {
@@ -11914,7 +11923,7 @@ declare module 'vscode' {
1191411923 * Mimes type look ups are case-insensitive.
1191511924 *
1191611925 * Special mime types:
11917- * - `text/uri-list` — A string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,
11926+ * - `text/uri-list` — A string with `toString()`ed Uris separated by `\r\n`. To specify a cursor position in the file,
1191811927 * set the Uri's fragment to `L3,5`, where 3 is the line number and 5 is the column number.
1191911928 */
1192011929 get(mimeType: string): DataTransferItem | undefined;
@@ -16167,6 +16176,26 @@ declare module 'vscode' {
1616716176 */
1616816177 hideWhenEmpty?: boolean;
1616916178
16179+ /**
16180+ * Context value of the resource group. This can be used to contribute resource group specific actions.
16181+ * For example, if a resource group is given a context value of `exportable`, when contributing actions to `scm/resourceGroup/context`
16182+ * using `menus` extension point, you can specify context value for key `scmResourceGroupState` in `when` expressions, like `scmResourceGroupState == exportable`.
16183+ * ```json
16184+ * "contributes": {
16185+ * "menus": {
16186+ * "scm/resourceGroup/context": [
16187+ * {
16188+ * "command": "extension.export",
16189+ * "when": "scmResourceGroupState == exportable"
16190+ * }
16191+ * ]
16192+ * }
16193+ * }
16194+ * ```
16195+ * This will show action `extension.export` only for resource groups with `contextValue` equal to `exportable`.
16196+ */
16197+ contextValue?: string;
16198+
1617016199 /**
1617116200 * This group's collection of
1617216201 * {@link SourceControlResourceState source control resource states}.
@@ -17456,16 +17485,22 @@ declare module 'vscode' {
1745617485 }
1745717486
1745817487 /**
17459- * Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.
17488+ * Optional options to be used when calling {@link authentication.getSession} with interactive options `forceNewSession` & `createIfNone `.
1746017489 */
17461- export interface AuthenticationForceNewSessionOptions {
17490+ export interface AuthenticationGetSessionPresentationOptions {
1746217491 /**
1746317492 * An optional message that will be displayed to the user when we ask to re-authenticate. Providing additional context
1746417493 * as to why you are asking a user to re-authenticate can help increase the odds that they will accept.
1746517494 */
1746617495 detail?: string;
1746717496 }
1746817497
17498+ /**
17499+ * Optional options to be used when calling {@link authentication.getSession} with the flag `forceNewSession`.
17500+ * @deprecated Use {@link AuthenticationGetSessionPresentationOptions} instead.
17501+ */
17502+ export type AuthenticationForceNewSessionOptions = AuthenticationGetSessionPresentationOptions;
17503+
1746917504 /**
1747017505 * Options to be used when getting an {@link AuthenticationSession} from an {@link AuthenticationProvider}.
1747117506 */
@@ -17495,27 +17530,31 @@ declare module 'vscode' {
1749517530 * on the accounts activity bar icon. An entry for the extension will be added under the menu to sign in. This
1749617531 * allows quietly prompting the user to sign in.
1749717532 *
17533+ * If you provide options, you will also see the dialog but with the additional context provided.
17534+ *
1749817535 * If there is a matching session but the extension has not been granted access to it, setting this to true
1749917536 * will also result in an immediate modal dialog, and false will add a numbered badge to the accounts icon.
1750017537 *
1750117538 * Defaults to false.
1750217539 *
1750317540 * Note: you cannot use this option with {@link AuthenticationGetSessionOptions.silent silent}.
1750417541 */
17505- createIfNone?: boolean;
17542+ createIfNone?: boolean | AuthenticationGetSessionPresentationOptions ;
1750617543
1750717544 /**
1750817545 * Whether we should attempt to reauthenticate even if there is already a session available.
1750917546 *
1751017547 * If true, a modal dialog will be shown asking the user to sign in again. This is mostly used for scenarios
1751117548 * where the token needs to be re minted because it has lost some authorization.
1751217549 *
17550+ * If you provide options, you will also see the dialog but with the additional context provided.
17551+ *
1751317552 * If there are no existing sessions and forceNewSession is true, it will behave identically to
1751417553 * {@link AuthenticationGetSessionOptions.createIfNone createIfNone}.
1751517554 *
1751617555 * This defaults to false.
1751717556 */
17518- forceNewSession?: boolean | AuthenticationForceNewSessionOptions;
17557+ forceNewSession?: boolean | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions;
1751917558
1752017559 /**
1752117560 * Whether we should show the indication to sign in in the Accounts menu.
@@ -17669,7 +17708,7 @@ declare module 'vscode' {
1766917708 * @param options The {@link AuthenticationGetSessionOptions} to use
1767017709 * @returns A thenable that resolves to an authentication session
1767117710 */
17672- export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { /** */createIfNone: true }): Thenable<AuthenticationSession>;
17711+ export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { /** */createIfNone: true | AuthenticationGetSessionPresentationOptions }): Thenable<AuthenticationSession>;
1767317712
1767417713 /**
1767517714 * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -17684,7 +17723,7 @@ declare module 'vscode' {
1768417723 * @param options The {@link AuthenticationGetSessionOptions} to use
1768517724 * @returns A thenable that resolves to an authentication session
1768617725 */
17687- export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { /** literal-type defines return type */forceNewSession: true | AuthenticationForceNewSessionOptions }): Thenable<AuthenticationSession>;
17726+ export function getSession(providerId: string, scopes: readonly string[], options: AuthenticationGetSessionOptions & { /** literal-type defines return type */forceNewSession: true | AuthenticationGetSessionPresentationOptions | AuthenticationForceNewSessionOptions }): Thenable<AuthenticationSession>;
1768817727
1768917728 /**
1769017729 * Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -20088,7 +20127,7 @@ declare module 'vscode' {
2008820127 /**
2008920128 * A JSON schema for the input this tool accepts.
2009020129 */
20091- inputSchema?: object;
20130+ inputSchema?: object | undefined ;
2009220131 }
2009320132
2009420133 /**
0 commit comments