Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3

This commit is contained in:
ADS Merger
2020-03-11 04:19:23 +00:00
parent 16fab722d5
commit 4c3e48773d
880 changed files with 20441 additions and 11232 deletions

View File

@@ -35,7 +35,7 @@ declare module 'vscode' {
readonly added: string[];
/**
* The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed..
* The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
*/
readonly removed: string[];
}
@@ -43,14 +43,14 @@ declare module 'vscode' {
export interface AuthenticationProvider {
/**
* Used as an identifier for extensions trying to work with a particular
* provider: 'Microsoft', 'GitHub', etc. id must be unique, registering
* provider: 'microsoft', 'github', etc. id must be unique, registering
* another provider with the same id will fail.
*/
readonly id: string;
readonly displayName: string;
/**
* A [enent](#Event) which fires when the array of sessions has changed, or data
* An [event](#Event) which fires when the array of sessions has changed, or data
* within a session has changed.
*/
readonly onDidChangeSessions: Event<void>;
@@ -75,7 +75,31 @@ declare module 'vscode' {
*/
export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
export const providers: ReadonlyArray<AuthenticationProvider>;
/**
* An array of the ids of authentication providers that are currently registered.
*/
export const providerIds: string[];
/**
* 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.
*/
export function getSessions(providerId: string, scopes: string[]): Thenable<readonly AuthenticationSession[]>;
/**
* 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.
*/
export function login(providerId: string, scopes: string[]): Thenable<AuthenticationSession>;
/**
* An [event](#Event) which fires when the array of sessions has changed, or data
* within a session has changed for a provider. Fires with the ids of the providers
* that have had session data change.
*/
export const onDidChangeSessions: Event<string[]>;
}
//#endregion
@@ -107,7 +131,7 @@ declare module 'vscode' {
export interface TunnelDescription {
remoteAddress: { port: number, host: string };
//The complete local address(ex. localhost:1234)
localAddress: string;
localAddress: { port: number, host: string } | string;
}
export interface Tunnel extends TunnelDescription {
@@ -168,13 +192,6 @@ declare module 'vscode' {
*/
export let tunnels: Thenable<TunnelDescription[]>;
/**
* Fired when the list of tunnels has changed.
* @deprecated use onDidChangeTunnels instead
*/
// TODO@alexr
// eslint-disable-next-line vscode-dts-event-naming
export const onDidTunnelsChange: Event<void>;
/**
* Fired when the list of tunnels has changed.
*/
@@ -257,6 +274,11 @@ declare module 'vscode' {
* semantic tokens.
*/
export interface DocumentSemanticTokensProvider {
/**
* An optional event to signal that the semantic tokens from this provider have changed.
*/
onDidChangeSemanticTokens?: Event<void>;
/**
* A file can contain many tokens, perhaps even hundreds of thousands of tokens. Therefore, to improve
* the memory consumption around describing semantic tokens, we have decided to avoid allocating an object
@@ -314,6 +336,9 @@ declare module 'vscode' {
* // 1st token, 2nd token, 3rd token
* [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]
* ```
*
* *NOTE*: When doing edits, it is possible that multiple edits occur until VS Code decides to invoke the semantic tokens provider.
* *NOTE*: If the provider cannot temporarily compute semantic tokens, it can indicate this by throwing an error with the message 'Busy'.
*/
provideDocumentSemanticTokens(document: TextDocument, token: CancellationToken): ProviderResult<SemanticTokens>;
@@ -366,7 +391,6 @@ declare module 'vscode' {
* edit: { start: 10, deleteCount: 1, data: [1,3,5,0,2,2] } // replace integer at offset 10 with [1,3,5,0,2,2]
* ```
*
* *NOTE*: When doing edits, it is possible that multiple edits occur until VS Code decides to invoke the semantic tokens provider.
* *NOTE*: If the provider cannot compute `SemanticTokensEdits`, it can "give up" and return all the tokens in the document again.
* *NOTE*: All edits in `SemanticTokensEdits` contain indices in the old integers array, so they all refer to the previous result state.
*/
@@ -749,10 +773,15 @@ declare module 'vscode' {
/**
* A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined` only default excludes will
* apply, when `null` no excludes will apply.
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined`, default excludes will
* apply.
*/
exclude?: GlobPattern | null;
exclude?: GlobPattern;
/**
* Whether to use the default and user-configured excludes. Defaults to true.
*/
useDefaultExcludes?: boolean;
/**
* The maximum number of results to search for
@@ -1215,9 +1244,11 @@ declare module 'vscode' {
/**
* Save the resource.
*
* @param cancellation Token that signals the save is no longer required (for example, if another save was triggered).
*
* @return Thenable signaling that the save has completed.
*/
save(): Thenable<void>;
save(cancellation: CancellationToken): Thenable<void>;
/**
* Save the existing resource at a new path.
@@ -1247,7 +1278,7 @@ declare module 'vscode' {
/**
* Undo a set of edits.
*
* This is triggered when a user undoes an edit or when revert is called on a file.
* This is triggered when a user undoes an edit.
*
* @param edit Array of edits. Sorted from most recent to oldest.
*
@@ -1255,6 +1286,18 @@ declare module 'vscode' {
*/
undoEdits(edits: readonly EditType[]): Thenable<void>;
/**
* Revert the file to its last saved state.
*
* @param change Added or applied edits.
*
* @return Thenable signaling that the change has completed.
*/
revert(change: {
readonly undoneEdits: readonly EditType[];
readonly appliedEdits: readonly EditType[];
}): Thenable<void>;
/**
* Back up the resource in its current state.
*
@@ -1277,10 +1320,10 @@ declare module 'vscode' {
}
/**
* Represents a custom document for a custom webview editor.
* Represents a custom document used by a `CustomEditorProvider`.
*
* Custom documents are only used within a given `CustomEditorProvider`. The lifecycle of a
* `CustomDocument` is managed by VS Code. When more more references remain to a given `CustomDocument`
* `CustomDocument` is managed by VS Code. When no more references remain to a given `CustomDocument`,
* then it is disposed of.
*
* @param UserDataType Type of custom object that extensions can store on the document.
@@ -1323,6 +1366,11 @@ declare module 'vscode' {
/**
* Resolve the model for a given resource.
*
* `resolveCustomDocument` is called when the first editor for a given resource is opened, and the resolve document
* is passed to `resolveCustomEditor`. The resolved `CustomDocument` is re-used for subsequent editor opens.
* If all editors for a given resource are closed, the `CustomDocument` is disposed of. Opening an editor at
* this point will trigger another call to `resolveCustomDocument`.
*
* @param document Document to resolve.
*
* @return The capabilities of the resolved document.
@@ -1332,11 +1380,15 @@ declare module 'vscode' {
/**
* Resolve a webview editor for a given resource.
*
* This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
* existing editor using this `CustomTextEditorProvider`.
*
* To resolve a webview editor, the provider must fill in its initial html content and hook up all
* the event listeners it is interested it. The provider should also take ownership of the passed in `WebviewPanel`.
* the event listeners it is interested it. The provider can also hold onto the `WebviewPanel` to use later,
* for example in a command. See [`WebviewPanel`](#WebviewPanel) for additional details
*
* @param document Document for the resource being resolved.
* @param webviewPanel Webview to resolve. The provider should take ownership of this webview.
* @param webviewPanel Webview to resolve.
*
* @return Thenable indicating that the webview editor has been resolved.
*/
@@ -1355,13 +1407,17 @@ declare module 'vscode' {
*/
export interface CustomTextEditorProvider {
/**
* Resolve a webview editor for a given resource.
* Resolve a webview editor for a given text resource.
*
* This is called when a user first opens a resource for a `CustomTextEditorProvider`, or if they reopen an
* existing editor using this `CustomTextEditorProvider`.
*
* To resolve a webview editor, the provider must fill in its initial html content and hook up all
* the event listeners it is interested it. The provider should also take ownership of the passed in `WebviewPanel`.
* the event listeners it is interested it. The provider can also hold onto the `WebviewPanel` to use later,
* for example in a command. See [`WebviewPanel`](#WebviewPanel) for additional details.
*
* @param document Resource being resolved.
* @param webviewPanel Webview to resolve. The provider should take ownership of this webview.
* @param document Document for the resource to resolve.
* @param webviewPanel Webview to resolve.
*
* @return Thenable indicating that the webview editor has been resolved.
*/
@@ -1600,7 +1656,7 @@ declare module 'vscode' {
/**
* The maximum number or the ending cursor of timeline items that should be returned.
*/
limit?: number | string;
limit?: number | { cursor: string };
}
export interface TimelineProvider {
@@ -1660,6 +1716,11 @@ declare module 'vscode' {
* @return The uri of the resource.
*/
asExtensionUri(relativePath: string): Uri;
/**
*
*/
readonly extensionUri: Uri;
}
export interface Extension<T> {
@@ -1670,6 +1731,11 @@ declare module 'vscode' {
* @return The uri of the resource.
*/
asExtensionUri(relativePath: string): Uri;
/**
*
*/
readonly extensionUri: Uri;
}
//#endregion
@@ -1728,4 +1794,34 @@ declare module 'vscode' {
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/90517
export interface FileSystemError {
/**
* A code that identifies this error.
*
* Possible values are names of errors, like [`FileNotFound`](#FileSystemError.FileNotFound),
* or `undefined` for an unspecified error.
*/
readonly code?: string;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/90208
export namespace Uri {
/**
*
* @param base
* @param pathFragments
* @returns A new uri
*/
export function joinPaths(base: Uri, ...pathFragments: string[]): Uri;
}
//#endregion
}