Skip to content

Commit

Permalink
chore: update to latest api
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Jul 6, 2020
1 parent 05e344e commit e65bbbf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 191 deletions.
202 changes: 20 additions & 182 deletions src/typings/vscode.proposed.d.ts
Expand Up @@ -34,60 +34,30 @@ declare module 'vscode' {
/**
* The account associated with the session.
*/
readonly account: {
/**
* The human-readable name of the account.
*/
readonly displayName: string;

/**
* The unique identifier of the account.
*/
readonly id: string;
};
readonly account: AuthenticationSessionAccountInformation;

/**
* The permissions granted by the session's access token. Available scopes
* are defined by the authentication provider.
*/
readonly scopes: string[];
readonly scopes: ReadonlyArray<string>;

constructor(id: string, accessToken: string, account: { displayName: string, id: string }, scopes: string[]);
constructor(id: string, accessToken: string, account: AuthenticationSessionAccountInformation, scopes: string[]);
}

export class AuthenticationSession2 {
/**
* The identifier of the authentication session.
*/
readonly id: string;

/**
* The access token.
*/
readonly accessToken: string;

/**
* The information of an account associated with an authentication session.
*/
export interface AuthenticationSessionAccountInformation {
/**
* The account associated with the session.
* The human-readable name of the account.
*/
readonly account: {
/**
* The human-readable name of the account.
*/
readonly displayName: string;

/**
* The unique identifier of the account.
*/
readonly id: string;
};
readonly displayName: string;

/**
* The permissions granted by the session's access token. Available scopes
* are defined by the authentication provider.
* The unique identifier of the account.
*/
readonly scopes: string[];

constructor(id: string, accessToken: string, account: { displayName: string, id: string }, scopes: string[]);
readonly id: string;
}

/**
Expand All @@ -97,12 +67,12 @@ declare module 'vscode' {
/**
* The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added.
*/
readonly added: string[];
readonly added: ReadonlyArray<string>;

/**
* The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
*/
readonly removed: string[];
readonly removed: ReadonlyArray<string>;
}

/**
Expand All @@ -128,17 +98,17 @@ declare module 'vscode' {
/**
* The ids of the [AuthenticationSession](#AuthenticationSession)s that have been added.
*/
readonly added: string[];
readonly added: ReadonlyArray<string>;

/**
* The ids of the [AuthenticationSession](#AuthenticationSession)s that have been removed.
*/
readonly removed: string[];
readonly removed: ReadonlyArray<string>;

/**
* The ids of the [AuthenticationSession](#AuthenticationSession)s that have been changed.
*/
readonly changed: string[];
readonly changed: ReadonlyArray<string>;
}

/**
Expand All @@ -157,7 +127,7 @@ declare module 'vscode' {
/**
* The human-readable name of the provider.
*/
readonly displayName: string;
readonly label: string;

/**
* Whether it is possible to be signed into multiple accounts at once with this provider
Expand All @@ -173,16 +143,12 @@ declare module 'vscode' {
/**
* Returns an array of current sessions.
*/
getSessions(): Thenable<ReadonlyArray<AuthenticationSession2>>;
getSessions(): Thenable<ReadonlyArray<AuthenticationSession>>;

/**
* Prompts a user to login.
*/
<<<<<<< HEAD
login(scopes: string[]): Thenable<AuthenticationSession2>;
=======
login(scopes: string[]): Thenable<AuthenticationSession>;
>>>>>>> master

/**
* Removes the session corresponding to session id.
Expand Down Expand Up @@ -215,13 +181,10 @@ declare module 'vscode' {
export function getProviderIds(): Thenable<ReadonlyArray<string>>;

/**
<<<<<<< HEAD
=======
* @deprecated
>>>>>>> master
* An array of the ids of authentication providers that are currently registered.
*/
export const providerIds: string[];
export const providerIds: ReadonlyArray<string>;

/**
* Returns whether a provider has any sessions matching the requested scopes. This request
Expand All @@ -234,21 +197,6 @@ declare module 'vscode' {
*/
export function hasSessions(providerId: string, scopes: string[]): Thenable<boolean>;

<<<<<<< HEAD
/**
* Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
* registered, or if the user does not consent to sharing authentication information with
* the extension. If there are multiple sessions with the same scopes, the user will be shown a
* quickpick to select which account they would like to use.
* @param providerId The id of the provider to use
* @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication provider
* @param options The [getSessionOptions](#GetSessionOptions) to use
* @returns A thenable that resolves to an authentication session
*/
export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions & { createIfNone: true }): Thenable<AuthenticationSession2>;

=======
>>>>>>> master
/**
* Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
* registered, or if the user does not consent to sharing authentication information with
Expand All @@ -257,15 +205,9 @@ declare module 'vscode' {
* @param providerId The id of the provider to use
* @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication provider
* @param options The [getSessionOptions](#GetSessionOptions) to use
<<<<<<< HEAD
* @returns A thenable that resolves to an authentication session if available, or undefined if there are no sessions
*/
export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions): Thenable<AuthenticationSession2 | undefined>;
=======
* @returns A thenable that resolves to an authentication session
*/
export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions & { createIfNone: true }): Thenable<AuthenticationSession>;
>>>>>>> master

/**
* Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
Expand Down Expand Up @@ -891,16 +833,13 @@ declare module 'vscode' {
* When this property is not specified, the value from the parent session (if there is one) is used.
*/
noDebug?: boolean;
<<<<<<< HEAD
=======

/**
* Controls if the debug session's parent session is shown in the CALL STACK view even if it has only a single child.
* By default, the debug session will never hide its parent.
* If compact is true, debug sessions with a single child are hidden in the CALL STACK view to make the tree more compact.
*/
compact?: boolean;
>>>>>>> master
}

// deprecated debug API
Expand Down Expand Up @@ -1116,58 +1055,31 @@ declare module 'vscode' {
terminal: Terminal;
}

<<<<<<< HEAD
export interface TerminalLinkProvider<T = TerminalLink> {
=======
export interface TerminalLinkProvider<T extends TerminalLink = TerminalLink> {
/**
* Provide terminal links for the given context. Note that this can be called multiple times
* even before previous calls resolve, make sure to not share global objects (eg. `RegExp`)
* that could have problems when asynchronous usage may overlap.
* @param context Information about what links are being provided for.
*/
>>>>>>> master
provideTerminalLinks(context: TerminalLinkContext): ProviderResult<T[]>

/**
* Handle an activated terminal link.
<<<<<<< HEAD
*
* @returns Whether the link was handled, if not VS Code will attempt to open it.
*/
handleTerminalLink(link: T): ProviderResult<boolean>;
=======
*/
handleTerminalLink(link: T): void;
>>>>>>> master
}

export interface TerminalLink {
/**
<<<<<<< HEAD
* The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
=======
* The 0-based start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
>>>>>>> master
*/
startIndex: number;

/**
<<<<<<< HEAD
* The length of the link on [TerminalLinkContext.line](#TerminalLinkContext.line]
*/
length: number;

/**
* The uri this link points to. If set, and {@link TerminalLinkProvider.handlerTerminalLink}
* is not implemented or returns false, then VS Code will try to open the Uri.
*/
target?: Uri;
=======
* The 0-based end index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
endIndex: number;
>>>>>>> master

/**
* The tooltip text when you hover over this link.
Expand Down Expand Up @@ -1234,16 +1146,6 @@ declare module 'vscode' {
tooltip?: string | MarkdownString | /* for compilation */ any;

/**
<<<<<<< HEAD
* Accessibility information used when screen reader interacts with this tree item.
* Generally, a TreeItem has no need to set the `role` of the accessibilityInformation;
* however, there are cases where a TreeItem is not displayed in a tree-like way where setting the `role` may make sense.
*/
accessibilityInformation?: AccessibilityInformation;

/**
=======
>>>>>>> master
* @param label Label describing this item
* @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
*/
Expand Down Expand Up @@ -1594,7 +1496,7 @@ declare module 'vscode' {
metadata: NotebookDocumentMetadata;
}

export interface NotebookConcatTextDocument extends TextDocument {
export interface NotebookConcatTextDocument {
isClosed: boolean;
dispose(): void;
onDidChange: Event<void>;
Expand Down Expand Up @@ -1866,11 +1768,7 @@ declare module 'vscode' {
resolveNotebook(document: NotebookDocument, webview: NotebookCommunication): Promise<void>;
saveNotebook(document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
saveNotebookAs(targetResource: Uri, document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
<<<<<<< HEAD
readonly onDidChangeNotebook: Event<NotebookDocumentContentChangeEvent>;
=======
readonly onDidChangeNotebook: Event<NotebookDocumentContentChangeEvent | NotebookDocumentEditEvent>;
>>>>>>> master
backupNotebook(document: NotebookDocument, context: NotebookDocumentBackupContext, cancellation: CancellationToken): Promise<NotebookDocumentBackup>;

kernel?: NotebookKernel;
Expand Down Expand Up @@ -2120,66 +2018,6 @@ declare module 'vscode' {

//#endregion

<<<<<<< HEAD
//#region Dialog title: https://github.com/microsoft/vscode/issues/82871

/**
* Options to configure the behaviour of a file open dialog.
*
* * Note 1: A dialog can select files, folders, or both. This is not true for Windows
* which enforces to open either files or folder, but *not both*.
* * Note 2: Explicitly setting `canSelectFiles` and `canSelectFolders` to `false` is futile
* and the editor then silently adjusts the options to select files.
*/
export interface OpenDialogOptions {
/**
* Dialog title.
*
* Depending on the underlying operating system this parameter might be ignored, since some
* systems do not present title on open dialogs.
*/
title?: string;
=======
//#region https://github.com/microsoft/vscode/issues/91555

export enum StandardTokenType {
Other = 0,
Comment = 1,
String = 2,
RegEx = 4
}

export interface TokenInformation {
type: StandardTokenType;
range: Range;
>>>>>>> master
}

export namespace languages {
export function getTokenInformationAtPosition(document: TextDocument, position: Position): Promise<TokenInformation>;
}

//#endregion

//#region Accessibility information: https://github.com/microsoft/vscode/issues/95360

/**
* Accessibility information which controls screen reader behavior.
*/
export interface AccessibilityInformation {
label: string;
role?: string;
}

export interface StatusBarItem {
/**
* Accessibility information used when screen reader interacts with this StatusBar item
*/
accessibilityInformation?: AccessibilityInformation;
}

//#endregion

//#region https://github.com/microsoft/vscode/issues/91555

export enum StandardTokenType {
Expand Down

0 comments on commit e65bbbf

Please sign in to comment.