Merge from vscode 2cd495805cf99b31b6926f08ff4348124b2cf73d

This commit is contained in:
ADS Merger
2020-06-30 04:40:21 +00:00
committed by AzureDataStudio
parent a8a7559229
commit 1388493cc1
602 changed files with 16375 additions and 12940 deletions

View File

@@ -3,6 +3,8 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { MarkdownString } from 'vscode';
/**
* This is the place for API experiments and proposals.
* These API are NOT stable and subject to change. They are only available in the Insiders
@@ -18,17 +20,7 @@ declare module 'vscode' {
// #region auth provider: https://github.com/microsoft/vscode/issues/88309
export interface AuthenticationSession {
id: string;
getAccessToken(): Thenable<string>;
account: {
displayName: string;
id: string;
};
scopes: string[];
}
export class AuthenticationSession2 {
export class AuthenticationSession {
/**
* The identifier of the authentication session.
*/
@@ -146,12 +138,12 @@ declare module 'vscode' {
/**
* Returns an array of current sessions.
*/
getSessions(): Thenable<ReadonlyArray<AuthenticationSession2>>;
getSessions(): Thenable<ReadonlyArray<AuthenticationSession>>;
/**
* Prompts a user to login.
*/
login(scopes: string[]): Thenable<AuthenticationSession2>;
login(scopes: string[]): Thenable<AuthenticationSession>;
/**
* Removes the session corresponding to session id.
@@ -184,13 +176,14 @@ declare module 'vscode' {
export function getProviderIds(): Thenable<ReadonlyArray<string>>;
/**
* @deprecated
* An array of the ids of authentication providers that are currently registered.
*/
export const providerIds: string[];
/**
* Returns whether a provider has any sessions matching the requested scopes. This request
* is transparent to the user, not UI is shown. Rejects if a provider with providerId is not
* is transparent to the user, no UI is shown. Rejects if a provider with providerId is not
* registered.
* @param providerId The id of the provider
* @param scopes A list of scopes representing the permissions requested. These are dependent on the authentication
@@ -209,7 +202,7 @@ declare module 'vscode' {
* @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>;
export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions & { createIfNone: true }): Thenable<AuthenticationSession>;
/**
* Get an authentication session matching the desired scopes. Rejects if a provider with providerId is not
@@ -221,29 +214,7 @@ declare module 'vscode' {
* @param options The [getSessionOptions](#GetSessionOptions) to use
* @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>;
/**
* @deprecated
* Get existing authentication sessions. Rejects if a provider with providerId is not
* registered, or if the user does not consent to sharing authentication information with
* the extension.
* @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
*/
export function getSessions(providerId: string, scopes: string[]): Thenable<ReadonlyArray<AuthenticationSession>>;
/**
* @deprecated
* Prompt a user to login to create a new authenticaiton session. Rejects if a provider with
* providerId is not registered, or if the user does not consent to sharing authentication
* information with the extension.
* @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
*/
export function login(providerId: string, scopes: string[]): Thenable<AuthenticationSession>;
export function getSession(providerId: string, scopes: string[], options: AuthenticationGetSessionOptions): Thenable<AuthenticationSession | undefined>;
/**
* @deprecated
@@ -857,6 +828,14 @@ declare module 'vscode' {
* When this property is not specified, the value from the parent session (if there is one) is used.
*/
noDebug?: boolean;
/**
* Controls if the debug session created will be compacted with the parent in the CALL STACK view.
* Compact with the parent is only done if the session is the only child of it's parent session.
* Default is to compact.
*
*/
noCompact?: boolean;
}
// deprecated debug API
@@ -1054,6 +1033,60 @@ declare module 'vscode' {
//#endregion
//#region Terminal link provider https://github.com/microsoft/vscode/issues/91606
export namespace window {
export function registerTerminalLinkProvider(provider: TerminalLinkProvider): Disposable;
}
export interface TerminalLinkContext {
/**
* This is the text from the unwrapped line in the terminal.
*/
line: string;
/**
* The terminal the link belongs to.
*/
terminal: Terminal;
}
export interface TerminalLinkProvider<T extends TerminalLink = TerminalLink> {
/**
* Provide terminal links for the given context.
* @param context Information about what links are being provided for.
*/
provideTerminalLinks(context: TerminalLinkContext): ProviderResult<T[]>
/**
* Handle an activated terminal link.
*/
handleTerminalLink(link: T): void;
}
export interface TerminalLink {
/**
* The 0-based start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
startIndex: number;
/**
* The 0-based end index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
endIndex: number;
/**
* The tooltip text when you hover over this link.
*
* If a tooltip is provided, is will be displayed in a string that includes instructions on
* how to trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary
* depending on OS, user settings, and localization.
*/
tooltip?: string;
}
//#endregion
//#region @jrieken -> exclusive document filters
export interface DocumentFilter {
@@ -1090,6 +1123,11 @@ declare module 'vscode' {
}
// https://github.com/microsoft/vscode/issues/100741
export interface TreeDataProvider<T> {
resolveTreeItem?(element: T, item: TreeItem2): TreeItem2 | Thenable<TreeItem2>;
}
export class TreeItem2 extends TreeItem {
/**
* Label describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri).
@@ -1097,11 +1135,9 @@ declare module 'vscode' {
label?: string | TreeItemLabel | /* for compilation */ any;
/**
* 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.
* Content to be shown when you hover over the tree item.
*/
accessibilityInformation?: AccessibilityInformation;
tooltip?: string | MarkdownString | /* for compilation */ any;
/**
* @param label Label describing this item
@@ -1461,10 +1497,15 @@ declare module 'vscode' {
version: number;
getText(): string;
getText(range: Range): string;
offsetAt(position: Position): number;
positionAt(offset: number): Position;
validateRange(range: Range): Range;
validatePosition(position: Position): Position;
locationAt(positionOrRange: Position | Range): Location;
positionAt(location: Location): Position;
contains(uri: Uri): boolean
}
export interface NotebookEditorCellEdit {
@@ -1542,6 +1583,20 @@ declare module 'vscode' {
*/
render(document: NotebookDocument, request: NotebookRenderRequest): string;
/**
* Call before HTML from the renderer is executed, and will be called for
* every editor associated with notebook documents where the renderer
* is or was used.
*
* The communication object will only send and receive messages to the
* render API, retrieved via `acquireNotebookRendererApi`, acquired with
* this specific renderer's ID.
*
* If you need to keep an association between the communication object
* and the document for use in the `render()` method, you can use a WeakMap.
*/
resolveNotebook?(document: NotebookDocument, communication: NotebookCommunication): void;
readonly preloads?: Uri[];
}
@@ -1670,30 +1725,44 @@ declare module 'vscode' {
readonly backupId?: string;
}
/**
* Communication object passed to the {@link NotebookContentProvider} and
* {@link NotebookOutputRenderer} to communicate with the webview.
*/
export interface NotebookCommunication {
/**
* ID of the editor this object communicates with. A single notebook
* document can have multiple attached webviews and editors, when the
* notebook is split for instance. The editor ID lets you differentiate
* between them.
*/
readonly editorId: string;
/**
* Fired when the output hosting webview posts a message.
*/
readonly onDidReceiveMessage: Event<any>;
/**
* Post a message to the output hosting webview.
*
* Messages are only delivered if the editor is live.
*
* @param message Body of the message. This must be a string or other json serilizable object.
*/
postMessage(message: any): Thenable<boolean>;
/**
* Convert a uri for the local file system to one that can be used inside outputs webview.
*/
asWebviewUri(localResource: Uri): Uri;
}
export interface NotebookContentProvider {
openNotebook(uri: Uri, openContext: NotebookDocumentOpenContext): NotebookData | Promise<NotebookData>;
resolveNotebook(document: NotebookDocument, webview: {
/**
* Fired when the output hosting webview posts a message.
*/
readonly onDidReceiveMessage: Event<any>;
/**
* Post a message to the output hosting webview.
*
* Messages are only delivered if the editor is live.
*
* @param message Body of the message. This must be a string or other json serilizable object.
*/
postMessage(message: any): Thenable<boolean>;
/**
* Convert a uri for the local file system to one that can be used inside outputs webview.
*/
asWebviewUri(localResource: Uri): Uri;
}): Promise<void>;
resolveNotebook(document: NotebookDocument, webview: NotebookCommunication): Promise<void>;
saveNotebook(document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
saveNotebookAs(targetResource: Uri, document: NotebookDocument, cancellation: CancellationToken): Promise<void>;
readonly onDidChangeNotebook: Event<NotebookDocumentContentChangeEvent>;
readonly onDidChangeNotebook: Event<NotebookDocumentContentChangeEvent | NotebookDocumentEditEvent>;
backupNotebook(document: NotebookDocument, context: NotebookDocumentBackupContext, cancellation: CancellationToken): Promise<NotebookDocumentBackup>;
kernel?: NotebookKernel;
@@ -1943,80 +2012,6 @@ declare module 'vscode' {
//#endregion
//#region https://github.com/microsoft/vscode/issues/86788
export interface CodeActionProviderMetadata {
/**
* Static documentation for a class of code actions.
*
* The documentation is shown in the code actions menu if either:
*
* - Code actions of `kind` are requested by VS Code. In this case, VS Code will show the documentation that
* most closely matches the requested code action kind. For example, if a provider has documentation for
* both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
* VS Code will use the documentation for `RefactorExtract` intead of the documentation for `Refactor`.
*
* - Any code actions of `kind` are returned by the provider.
*/
readonly documentation?: ReadonlyArray<{ readonly kind: CodeActionKind, readonly command: Command; }>;
}
//#endregion
//#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;
}
/**
* Options to configure the behaviour of a file save dialog.
*/
export interface SaveDialogOptions {
/**
* Dialog title.
*
* Depending on the underlying operating system this parameter might be ignored, since some
* systems do not present title on save dialogs.
*/
title?: string;
}
//#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 {