Merge pull request #34021 from octref/master

VS Code 1.19 Extension API
This commit is contained in:
Pine
2019-03-20 08:57:33 -07:00
committed by GitHub
+52 -15
View File
@@ -1,4 +1,4 @@
// Type definitions for Visual Studio Code 1.18
// Type definitions for Visual Studio Code 1.19
// 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,8 @@
*--------------------------------------------------------------------------------------------*/
/**
* Type Definition for Visual Studio Code 1.18 Extension API
* Type Definition for Visual Studio Code 1.19 Extension API
* See https://code.visualstudio.com/api for more information
*/
declare module 'vscode' {
@@ -1724,7 +1725,15 @@ declare module 'vscode' {
/**
* A file glob pattern to match file paths against. This can either be a glob pattern string
* (like `**∕*.{ts,js}` or `*.{ts,js}`) or a [relative pattern](#RelativePattern).
* (like `**​/*.{ts,js}` or `*.{ts,js}`) or a [relative pattern](#RelativePattern).
*
* Glob patterns can have the following syntax:
* * `*` to match one or more characters in a path segment
* * `?` to match on one character in a path segment
* * `**` to match any number of path segments, including none
* * `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
* * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
* * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
*/
export type GlobPattern = string | RelativePattern;
@@ -1734,7 +1743,7 @@ declare module 'vscode' {
* its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).
*
* @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
* @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**∕package.json' }`
* @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**​/package.json' }`
*/
export interface DocumentFilter {
@@ -1760,7 +1769,7 @@ declare module 'vscode' {
* and [language filters](#DocumentFilter).
*
* @sample `let sel:DocumentSelector = 'typescript'`;
* @sample `let sel:DocumentSelector = ['typescript', { language: 'json', pattern: '**∕tsconfig.json' }]`;
* @sample `let sel:DocumentSelector = ['typescript', { language: 'json', pattern: '**​/tsconfig.json' }]`;
*/
export type DocumentSelector = string | DocumentFilter | (string | DocumentFilter)[];
@@ -1801,7 +1810,6 @@ declare module 'vscode' {
* a [code action](#CodeActionProvider.provideCodeActions) is run.
*/
export interface CodeActionContext {
/**
* An array of diagnostics.
*/
@@ -2912,12 +2920,11 @@ declare module 'vscode' {
* The completion item provider interface defines the contract between extensions and
* [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense).
*
* When computing *complete* completion items is expensive, providers can optionally implement
* the `resolveCompletionItem`-function. In that case it is enough to return completion
* items with a [label](#CompletionItem.label) from the
* [provideCompletionItems](#CompletionItemProvider.provideCompletionItems)-function. Subsequently,
* when a completion item is shown in the UI and gains focus this provider is asked to resolve
* the item, like adding [doc-comment](#CompletionItem.documentation) or [details](#CompletionItem.detail).
* Providers can delay the computation of the [`detail`](#CompletionItem.detail)
* and [`documentation`](#CompletionItem.documentation) properties by implementing the
* [`resolveCompletionItem`](#CompletionItemProvider.resolveCompletionItem)-function. However, properties that
* are needed for the inital sorting and filtering, like `sortText`, `filterText`, `insertText`, and `range`, must
* not be changed during resolve.
*
* Providers are asked for completions either explicitly by a user gesture or -depending on the configuration-
* implicitly when typing words or trigger characters.
@@ -3456,7 +3463,7 @@ declare module 'vscode' {
uri: Uri;
/**
* The document range of this locations.
* The document range of this location.
*/
range: Range;
@@ -4500,7 +4507,7 @@ declare module 'vscode' {
* has changed. *Note* that the event also fires when the active editor changes
* to `undefined`.
*/
export const onDidChangeActiveTextEditor: Event<TextEditor>;
export const onDidChangeActiveTextEditor: Event<TextEditor | undefined>;
/**
* An [event](#Event) which fires when the array of [visible editors](#window.visibleTextEditors)
@@ -5264,7 +5271,7 @@ declare module 'vscode' {
/**
* Find files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
*
* @sample `findFiles('**∕*.js', '**∕node_modules∕**', 10)`
* @sample `findFiles('**​/*.js', '**​/node_modules/**', 10)`
* @param include A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
* will be matched against the file paths of resulting matches relative to their workspace. Use a [relative pattern](#RelativePattern)
* to restrict the search results to a [workspace folder](#WorkspaceFolder).
@@ -5781,6 +5788,11 @@ declare module 'vscode' {
* Setter and getter for the contents of the input box.
*/
value: string;
/**
* A string to show as place holder in the input box to guide the user.
*/
placeholder: string;
}
interface QuickDiffProvider {
@@ -6097,6 +6109,26 @@ declare module 'vscode' {
resolveDebugConfiguration?(folder: WorkspaceFolder | undefined, debugConfiguration: DebugConfiguration, token?: CancellationToken): ProviderResult<DebugConfiguration>;
}
/**
* Represents the debug console.
*/
export interface DebugConsole {
/**
* Append the given value to the debug console.
*
* @param value A string, falsy values will not be printed.
*/
append(value: string): void;
/**
* Append the given value and a line feed character
* to the debug console.
*
* @param value A string, falsy values will be printed.
*/
appendLine(value: string): void;
}
/**
* Namespace for dealing with debug sessions.
*/
@@ -6121,6 +6153,11 @@ declare module 'vscode' {
*/
export let activeDebugSession: DebugSession | undefined;
/**
* The currently active [debug console](#DebugConsole).
*/
export let activeDebugConsole: DebugConsole;
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes