diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index f5f66342439..6dfa46c6a97 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -13855,6 +13855,17 @@ declare module 'vscode' { * Options to be used when getting an {@link AuthenticationSession} from an {@link AuthenticationProvider}. */ export interface AuthenticationGetSessionOptions { + /** + * Whether the existing user session preference should be cleared. + * + * For authentication providers that support being signed into multiple accounts at once, the user will be + * prompted to select an account to use when {@link authentication.getSession getSession} is called. This preference + * is remembered until {@link authentication.getSession getSession} is called with this flag. + * + * Defaults to false. + */ + clearSessionPreference?: boolean; + /** * Whether login should be performed if there is no matching session. * @@ -13866,19 +13877,23 @@ declare module 'vscode' { * will also result in an immediate modal dialog, and false will add a numbered badge to the accounts icon. * * Defaults to false. + * + * Note: you cannot use this option with {@link silent}. */ createIfNone?: boolean; + /** - * Whether the existing user session preference should be cleared. + * Whether we should show the indication to sign in in the Accounts menu. * - * For authentication providers that support being signed into multiple accounts at once, the user will be - * prompted to select an account to use when {@link authentication.getSession getSession} is called. This preference - * is remembered until {@link authentication.getSession getSession} is called with this flag. + * If false, the user will be shown a badge on the Accounts menu with an option to sign in for the extension. + * If true, no indication will be shown. * * Defaults to false. + * + * Note: you cannot use this option with any other options that prompt the user like {@link createIfNone}. */ - clearSessionPreference?: boolean; + silent?: boolean; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 259e42d1d4b..7c2f1cf9d0c 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -184,15 +184,6 @@ declare module 'vscode' { * Defaults to false. */ forceNewSession?: boolean | { detail: string }; - /** - * Whether we should show the indication to sign in in the Accounts menu. - * - * If false, the user will be shown a badge on the Accounts menu with an option to sign in for the extension. - * If true, no indication will be shown. - * - * Defaults to false. - */ - silent?: boolean; } export namespace authentication { diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 3313761cc00..84e2a4eb04a 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -226,7 +226,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I const authentication: typeof vscode.authentication = { getSession(providerId: string, scopes: readonly string[], options?: vscode.AuthenticationGetSessionOptions) { - if (options?.forceNewSession || options?.silent) { + if (options?.forceNewSession) { checkProposedApiEnabled(extension); } return extHostAuthentication.getSession(extension, providerId, scopes, options as any);