VS Code 1.47.0 extension API (vscode.d.ts) (#45989)

* VS Code 1.47.0 Extension API

* chore - whitespace

* chore - more whitespace
This commit is contained in:
Eric Amodio 2020-07-09 21:59:36 -04:00 committed by GitHub
parent 3955bb9ce1
commit 188ed057f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
// Type definitions for Visual Studio Code 1.46
// Type definitions for Visual Studio Code 1.47
// Project: https://github.com/microsoft/vscode
// Definitions by: Visual Studio Code Team, Microsoft <https://github.com/Microsoft>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -10,7 +10,7 @@
*--------------------------------------------------------------------------------------------*/
/**
* Type Definition for Visual Studio Code 1.46 Extension API
* Type Definition for Visual Studio Code 1.47 Extension API
* See https://code.visualstudio.com/api for more information
*/
@ -1741,6 +1741,14 @@ declare module 'vscode' {
* ```
*/
filters?: { [name: string]: string[] };
/**
* Dialog title.
*
* This parameter might be ignored, as not all operating systems display a title on open dialogs
* (for example, macOS).
*/
title?: string;
}
/**
@ -1768,6 +1776,14 @@ declare module 'vscode' {
* ```
*/
filters?: { [name: string]: string[] };
/**
* Dialog title.
*
* This parameter might be ignored, as not all operating systems display a title on save dialogs
* (for example, macOS).
*/
title?: string;
}
/**
@ -2239,6 +2255,40 @@ declare module 'vscode' {
* such as `[CodeActionKind.Refactor.Extract.append('function'), CodeActionKind.Refactor.Extract.append('constant'), ...]`.
*/
readonly providedCodeActionKinds?: ReadonlyArray<CodeActionKind>;
/**
* Static documentation for a class of code actions.
*
* Documentation from the provider 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` instead of the documentation for `Refactor`.
*
* - Any code actions of `kind` are returned by the provider.
*
* At most one documentation entry will be shown per provider.
*/
readonly documentation?: ReadonlyArray<{
/**
* The kind of the code action being documented.
*
* If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any
* refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the
* documentation will only be shown when extract refactoring code actions are returned.
*/
readonly kind: CodeActionKind;
/**
* Command that displays the documentation to the user.
*
* This can display the documentation directly in VS Code or open a website using [`env.openExternal`](#env.openExternal);
*
* The title of this documentation code action is taken from [`Command.title`](#Command.title)
*/
readonly command: Command;
}>;
}
/**
@ -2281,7 +2331,7 @@ declare module 'vscode' {
* A code lens provider adds [commands](#Command) to source text. The commands will be shown
* as dedicated horizontal lines in between the source text.
*/
export interface CodeLensProvider<T = CodeLens> {
export interface CodeLensProvider<T extends CodeLens = CodeLens> {
/**
* An optional event to signal that the code lenses from this provider have changed.
@ -2425,6 +2475,11 @@ declare module 'vscode' {
*/
isTrusted?: boolean;
/**
* Indicates that this markdown string can contain [ThemeIcons](#ThemeIcon), e.g. `$(zap)`.
*/
readonly supportThemeIcons?: boolean;
/**
* Creates a new markdown string with the given value.
*
@ -2808,7 +2863,7 @@ declare module 'vscode' {
* The workspace symbol provider interface defines the contract between extensions and
* the [symbol search](https://code.visualstudio.com/docs/editor/editingevolved#_open-symbol-by-name)-feature.
*/
export interface WorkspaceSymbolProvider<T = SymbolInformation> {
export interface WorkspaceSymbolProvider<T extends SymbolInformation = SymbolInformation> {
/**
* Project-wide search for a symbol matching the given query string.
@ -3867,7 +3922,7 @@ declare module 'vscode' {
* Represents a collection of [completion items](#CompletionItem) to be presented
* in the editor.
*/
export class CompletionList<T = CompletionItem> {
export class CompletionList<T extends CompletionItem = CompletionItem> {
/**
* This list is not complete. Further typing should result in recomputing
@ -3940,7 +3995,7 @@ declare module 'vscode' {
* Providers are asked for completions either explicitly by a user gesture or -depending on the configuration-
* implicitly when typing words or trigger characters.
*/
export interface CompletionItemProvider<T = CompletionItem> {
export interface CompletionItemProvider<T extends CompletionItem = CompletionItem> {
/**
* Provide completion items for the given position and document.
@ -4015,7 +4070,7 @@ declare module 'vscode' {
* The document link provider defines the contract between extensions and feature of showing
* links in the editor.
*/
export interface DocumentLinkProvider<T = DocumentLink> {
export interface DocumentLinkProvider<T extends DocumentLink = DocumentLink> {
/**
* Provide links for the given document. Note that the editor ships with a default provider that detects
@ -5194,6 +5249,24 @@ declare module 'vscode' {
dispose(): void;
}
/**
* Accessibility information which controls screen reader behavior.
*/
export interface AccessibilityInformation {
/**
* Label to be read out by a screen reader once the item has focus.
*/
label: string;
/**
* Role of the widget which defines how a screen reader interacts with it.
* The role should be set in special cases when for example a tree-like element behaves like a checkbox.
* If role is not specified VS Code will pick the appropriate role automatically.
* More about aria roles can be found here https://w3c.github.io/aria/#widget_roles
*/
role?: string;
}
/**
* Represents the alignment of status bar items.
*/
@ -5257,6 +5330,11 @@ declare module 'vscode' {
*/
command: string | Command | undefined;
/**
* Accessibility information used when screen reader interacts with this StatusBar item
*/
accessibilityInformation?: AccessibilityInformation;
/**
* Shows the entry in the status bar.
*/
@ -5426,6 +5504,30 @@ declare module 'vscode' {
activate(): Thenable<T>;
}
/**
* The ExtensionMode is provided on the `ExtensionContext` and indicates the
* mode the specific extension is running in.
*/
export enum ExtensionMode {
/**
* The extension is installed normally (for example, from the marketplace
* or VSIX) in VS Code.
*/
Production = 1,
/**
* The extension is running from an `--extensionDevelopmentPath` provided
* when launching VS Code.
*/
Development = 2,
/**
* The extension is running from an `--extensionTestsPath` and
* the extension host is running unit tests.
*/
Test = 3,
}
/**
* An extension context is a collection of utilities private to an
* extension.
@ -5503,6 +5605,13 @@ declare module 'vscode' {
* the parent directory is guaranteed to be existent.
*/
readonly logPath: string;
/**
* The mode the extension is running in. This is specific to the current
* extension. One extension may be in `ExtensionMode.Development` while
* other extensions in the host run in `ExtensionMode.Release`.
*/
readonly extensionMode: ExtensionMode;
}
/**
@ -6047,7 +6156,7 @@ declare module 'vscode' {
* A task provider allows to add tasks to the task service.
* A task provider is registered via #tasks.registerTaskProvider.
*/
export interface TaskProvider<T = Task> {
export interface TaskProvider<T extends Task = Task> {
/**
* Provides tasks.
* @param token A cancellation token.
@ -8317,6 +8426,13 @@ declare module 'vscode' {
*/
contextValue?: string;
/**
* 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;
/**
* @param label A human-readable string describing this item
* @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)
@ -8419,8 +8535,9 @@ declare module 'vscode' {
interface Pseudoterminal {
/**
* An event that when fired will write data to the terminal. Unlike
* [Terminal.sendText](#Terminal.sendText) which sends text to the underlying _process_
* (the pty "slave"), this will write the text to the terminal itself (the pty "master").
* [Terminal.sendText](#Terminal.sendText) which sends text to the underlying child
* pseudo-device (the child), this will write the text to parent pseudo-device (the
* _terminal_ itself).
*
* Note writing `\n` will just move the cursor down 1 row, you need to write `\r` as well
* to move the cursor to the left-most cell.
@ -9289,7 +9406,7 @@ declare module 'vscode' {
/**
* A workspace folder is one of potentially many roots opened by the editor. All workspace folders
* are equal which means there is no notion of an active or master workspace folder.
* are equal which means there is no notion of an active or primary workspace folder.
*/
export interface WorkspaceFolder {