Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)

* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c

* remove files we don't want

* fix hygiene

* update distro

* update distro

* fix hygiene

* fix strict nulls

* distro

* distro

* fix tests

* fix tests

* add another edit

* fix viewlet icon

* fix azure dialog

* fix some padding

* fix more padding issues
This commit is contained in:
Anthony Dresser
2019-12-04 19:28:22 -08:00
committed by GitHub
parent a8818ab0df
commit f5ce7fb2a5
1507 changed files with 42813 additions and 27370 deletions

View File

@@ -16,89 +16,6 @@
declare module 'vscode' {
//#region Joh - call hierarchy
export class CallHierarchyItem {
/**
* The name of this item.
*/
name: string;
/**
* The kind of this item.
*/
kind: SymbolKind;
/**
* Tags for this item.
*/
tags?: ReadonlyArray<SymbolTag>;
/**
* More detail for this item, e.g. the signature of a function.
*/
detail?: string;
/**
* The resource identifier of this item.
*/
uri: Uri;
/**
* The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
*/
range: Range;
/**
* The range that should be selected and reveal when this symbol is being picked, e.g. the name of a function.
* Must be contained by the [`range`](#CallHierarchyItem.range).
*/
selectionRange: Range;
constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range);
}
export class CallHierarchyIncomingCall {
from: CallHierarchyItem;
fromRanges: Range[];
constructor(item: CallHierarchyItem, fromRanges: Range[]);
}
export class CallHierarchyOutgoingCall {
fromRanges: Range[];
to: CallHierarchyItem;
constructor(item: CallHierarchyItem, fromRanges: Range[]);
}
export interface CallHierarchyItemProvider {
/**
* Provide a list of callers for the provided item, e.g. all function calling a function.
*/
provideCallHierarchyIncomingCalls(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyIncomingCall[]>;
/**
* Provide a list of calls for the provided item, e.g. all functions call from a function.
*/
provideCallHierarchyOutgoingCalls(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyOutgoingCall[]>;
// todo@joh this could return as 'prepareCallHierarchy' (similar to the RenameProvider#prepareRename)
//
// /**
// *
// * Given a document and position compute a call hierarchy item. This is justed as
// * anchor for call hierarchy and then `resolveCallHierarchyItem` is being called.
// */
// resolveCallHierarchyItem(document: TextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyItem>;
}
export namespace languages {
export function registerCallHierarchyProvider(selector: DocumentSelector, provider: CallHierarchyItemProvider): Disposable;
}
//#endregion
//#region Alex - resolvers
export interface RemoteAuthorityResolverContext {
@@ -151,8 +68,82 @@ declare module 'vscode' {
//#endregion
//#region Alex - semantic tokens
// #region Joh - code insets
export class SemanticTokensLegend {
public readonly tokenTypes: string[];
public readonly tokenModifiers: string[];
constructor(tokenTypes: string[], tokenModifiers: string[]);
}
export class SemanticTokensBuilder {
constructor();
push(line: number, char: number, length: number, tokenType: number, tokenModifiers: number): void;
build(): Uint32Array;
}
/**
* A certain token (at index `i` is encoded using 5 uint32 integers):
* - at index `5*i` - `deltaLine`: token line number, relative to `SemanticColoringArea.line`
* - at index `5*i+1` - `deltaStart`: token start character offset inside the line (relative to 0 or the previous token if they are on the same line)
* - at index `5*i+2` - `length`: the length of the token
* - at index `5*i+3` - `tokenType`: will be looked up in `SemanticColoringLegend.tokenTypes`
* - at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticColoringLegend.tokenModifiers`
*/
export class SemanticTokens {
readonly resultId?: string;
readonly data: Uint32Array;
constructor(data: Uint32Array, resultId?: string);
}
export class SemanticTokensEdits {
readonly resultId?: string;
readonly edits: SemanticTokensEdit[];
constructor(edits: SemanticTokensEdit[], resultId?: string);
}
export class SemanticTokensEdit {
readonly start: number;
readonly deleteCount: number;
readonly data?: Uint32Array;
constructor(start: number, deleteCount: number, data?: Uint32Array);
}
export interface SemanticTokensRequestOptions {
readonly ranges?: readonly Range[];
readonly previousResultId?: string;
}
/**
* The semantic tokens provider interface defines the contract between extensions and
* semantic tokens.
*/
export interface SemanticTokensProvider {
provideSemanticTokens(document: TextDocument, options: SemanticTokensRequestOptions, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdits>;
}
export namespace languages {
/**
* Register a semantic tokens provider.
*
* Multiple providers can be registered for a language. In that case providers are sorted
* by their [score](#languages.match) and the best-matching provider is used. Failure
* of the selected provider will cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A semantic tokens provider.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export function registerSemanticTokensProvider(selector: DocumentSelector, provider: SemanticTokensProvider, legend: SemanticTokensLegend): Disposable;
}
//#endregion
//#region editor insets: https://github.com/microsoft/vscode/issues/85682
export interface WebviewEditorInset {
readonly editor: TextEditor;
@@ -169,7 +160,7 @@ declare module 'vscode' {
//#endregion
//#region Joh - read/write in chunks
//#region read/write in chunks: https://github.com/microsoft/vscode/issues/84515
export interface FileSystemProvider {
open?(resource: Uri, options: { create: boolean }): number | Thenable<number>;
@@ -550,7 +541,7 @@ declare module 'vscode' {
//#endregion
//#region Joao: diff command
//#region diff command: https://github.com/microsoft/vscode/issues/84899
/**
* The contiguous set of modified lines in a diff.
@@ -583,7 +574,7 @@ declare module 'vscode' {
//#endregion
//#region Joh: decorations
//#region file-decorations: https://github.com/microsoft/vscode/issues/54938
export class Decoration {
letter?: string;
@@ -604,7 +595,45 @@ declare module 'vscode' {
//#endregion
//#region André: debug
//#region André: debug API for inline debug adapters https://github.com/microsoft/vscode/issues/85544
/**
* A DebugProtocolMessage is an opaque stand-in type for the [ProtocolMessage](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage) type defined in the Debug Adapter Protocol.
*/
export interface DebugProtocolMessage {
// Properties: see details [here](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage).
}
/**
* A debug adapter that implements the Debug Adapter Protocol can be registered with VS Code if it implements the DebugAdapter interface.
*/
export interface DebugAdapter extends Disposable {
/**
* An event which fires when the debug adapter sends a Debug Adapter Protocol message to VS Code.
* Messages can be requests, responses, or events.
*/
readonly onSendMessage: Event<DebugProtocolMessage>;
/**
* Handle a Debug Adapter Protocol message.
* Messages can be requests, responses, or events.
* Results or errors are returned via onSendMessage events.
* @param message A Debug Adapter Protocol message
*/
handleMessage(message: DebugProtocolMessage): void;
}
/**
* A debug adapter descriptor for an inline implementation.
*/
export class DebugAdapterInlineImplementation {
/**
* Create a descriptor for an inline implementation of a debug adapter.
*/
constructor(implementation: DebugAdapter);
}
// deprecated
@@ -616,41 +645,6 @@ declare module 'vscode' {
debugAdapterExecutable?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugAdapterExecutable>;
}
/**
* Debug console mode used by debug session, see [options](#DebugSessionOptions).
*/
export enum DebugConsoleMode {
/**
* Debug session should have a separate debug console.
*/
Separate = 0,
/**
* Debug session should share debug console with its parent session.
* This value has no effect for sessions which do not have a parent session.
*/
MergeWithParent = 1
}
/**
* Options for [starting a debug session](#debug.startDebugging).
*/
export interface DebugSessionOptions {
/**
* When specified the newly created debug session is registered as a "child" session of this
* "parent" debug session.
*/
parentSession?: DebugSession;
/**
* Controls whether this session should have a separate debug console or share it
* with the parent session. Has no effect for sessions which do not have a parent session.
* Defaults to Separate.
*/
consoleMode?: DebugConsoleMode;
}
//#endregion
//#region Rob, Matt: logging
@@ -764,8 +758,76 @@ declare module 'vscode' {
//#endregion
//#region Terminal data write event https://github.com/microsoft/vscode/issues/78502
//#region Terminal
export interface TerminalDataWriteEvent {
/**
* The [terminal](#Terminal) for which the data was written.
*/
readonly terminal: Terminal;
/**
* The data being written.
*/
readonly data: string;
}
namespace window {
/**
* An event which fires when the terminal's pty slave pseudo-device is written to. In other
* words, this provides access to the raw data stream from the process running within the
* terminal, including VT sequences.
*/
export const onDidWriteTerminalData: Event<TerminalDataWriteEvent>;
}
//#endregion
//#region Terminal exit status https://github.com/microsoft/vscode/issues/62103
export interface TerminalExitStatus {
/**
* The exit code that a terminal exited with, it can have the following values:
* - Zero: the terminal process or custom execution succeeded.
* - Non-zero: the terminal process or custom execution failed.
* - `undefined`: the user forcefully closed the terminal or a custom execution exited
* without providing an exit code.
*/
readonly code: number | undefined;
}
export interface Terminal {
/**
* The exit status of the terminal, this will be undefined while the terminal is active.
*
* **Example:** Show a notification with the exit code when the terminal exits with a
* non-zero exit code.
* ```typescript
* window.onDidCloseTerminal(t => {
* if (t.exitStatus && t.exitStatus.code) {
* vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`);
* }
* });
* ```
*/
readonly exitStatus: TerminalExitStatus | undefined;
}
//#endregion
//#region Terminal creation options https://github.com/microsoft/vscode/issues/63052
export interface Terminal {
/**
* The object used to initialize the terminal, this is useful for things like detecting the
* shell type of shells not launched by the extension or detecting what folder the shell was
* launched in.
*/
readonly creationOptions: Readonly<TerminalOptions | ExtensionTerminalOptions>;
}
//#endregion
//#region Terminal dimensions property and change event https://github.com/microsoft/vscode/issues/55718
/**
* An [event](#Event) which fires when a [Terminal](#Terminal)'s dimensions change.
@@ -781,29 +843,11 @@ declare module 'vscode' {
readonly dimensions: TerminalDimensions;
}
export interface TerminalDataWriteEvent {
/**
* The [terminal](#Terminal) for which the data was written.
*/
readonly terminal: Terminal;
/**
* The data being written.
*/
readonly data: string;
}
namespace window {
/**
* An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change.
*/
export const onDidChangeTerminalDimensions: Event<TerminalDimensionsChangeEvent>;
/**
* An event which fires when the terminal's pty slave pseudo-device is written to. In other
* words, this provides access to the raw data stream from the process running within the
* terminal, including VT sequences.
*/
export const onDidWriteTerminalData: Event<TerminalDataWriteEvent>;
}
export interface Terminal {
@@ -826,20 +870,243 @@ declare module 'vscode' {
//#endregion
//#region mjbvz,joh: https://github.com/Microsoft/vscode/issues/43768
export interface FileRenameEvent {
readonly oldUri: Uri;
readonly newUri: Uri;
/**
* An event that is fired when files are going to be created.
*
* To make modifications to the workspace before the files are created,
* call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
* thenable that resolves to a [workspace edit](#WorkspaceEdit).
*/
export interface FileWillCreateEvent {
/**
* The files that are going to be created.
*/
readonly files: ReadonlyArray<Uri>;
/**
* Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
*
* *Note:* This function can only be called during event dispatch and not
* in an asynchronous manner:
*
* ```ts
* workspace.onWillCreateFiles(event => {
* // async, will *throw* an error
* setTimeout(() => event.waitUntil(promise));
*
* // sync, OK
* event.waitUntil(promise);
* })
* ```
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<WorkspaceEdit>): void;
/**
* Allows to pause the event until the provided thenable resolves.
*
* *Note:* This function can only be called during event dispatch.
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<any>): void;
}
export interface FileWillRenameEvent {
readonly oldUri: Uri;
readonly newUri: Uri;
/**
* An event that is fired after files are created.
*/
export interface FileCreateEvent {
/**
* The files that got created.
*/
readonly files: ReadonlyArray<Uri>;
}
/**
* An event that is fired when files are going to be deleted.
*
* To make modifications to the workspace before the files are deleted,
* call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
* thenable that resolves to a [workspace edit](#WorkspaceEdit).
*/
export interface FileWillDeleteEvent {
/**
* The files that are going to be deleted.
*/
readonly files: ReadonlyArray<Uri>;
/**
* Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
*
* *Note:* This function can only be called during event dispatch and not
* in an asynchronous manner:
*
* ```ts
* workspace.onWillCreateFiles(event => {
* // async, will *throw* an error
* setTimeout(() => event.waitUntil(promise));
*
* // sync, OK
* event.waitUntil(promise);
* })
* ```
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<WorkspaceEdit>): void;
/**
* Allows to pause the event until the provided thenable resolves.
*
* *Note:* This function can only be called during event dispatch.
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<any>): void;
}
/**
* An event that is fired after files are deleted.
*/
export interface FileDeleteEvent {
/**
* The files that got deleted.
*/
readonly files: ReadonlyArray<Uri>;
}
/**
* An event that is fired when files are going to be renamed.
*
* To make modifications to the workspace before the files are renamed,
* call the [`waitUntil](#FileWillCreateEvent.waitUntil)-function with a
* thenable that resolves to a [workspace edit](#WorkspaceEdit).
*/
export interface FileWillRenameEvent {
/**
* The files that are going to be renamed.
*/
readonly files: ReadonlyArray<{ oldUri: Uri, newUri: Uri }>;
/**
* Allows to pause the event and to apply a [workspace edit](#WorkspaceEdit).
*
* *Note:* This function can only be called during event dispatch and not
* in an asynchronous manner:
*
* ```ts
* workspace.onWillCreateFiles(event => {
* // async, will *throw* an error
* setTimeout(() => event.waitUntil(promise));
*
* // sync, OK
* event.waitUntil(promise);
* })
* ```
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<WorkspaceEdit>): void;
/**
* Allows to pause the event until the provided thenable resolves.
*
* *Note:* This function can only be called during event dispatch.
*
* @param thenable A thenable that delays saving.
*/
waitUntil(thenable: Thenable<any>): void;
}
/**
* An event that is fired after files are renamed.
*/
export interface FileRenameEvent {
/**
* The files that got renamed.
*/
readonly files: ReadonlyArray<{ oldUri: Uri, newUri: Uri }>;
}
export namespace workspace {
export const onWillRenameFile: Event<FileWillRenameEvent>;
export const onDidRenameFile: Event<FileRenameEvent>;
/**
* An event that is emitted when files are being created.
*
* *Note 1:* This event is triggered by user gestures, like creating a file from the
* explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api. This event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*
* *Note 2:* When this event is fired, edits to files thare are being created cannot be applied.
*/
export const onWillCreateFiles: Event<FileWillCreateEvent>;
/**
* An event that is emitted when files have been created.
*
* *Note:* This event is triggered by user gestures, like creating a file from the
* explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*/
export const onDidCreateFiles: Event<FileCreateEvent>;
/**
* An event that is emitted when files are being deleted.
*
* *Note 1:* This event is triggered by user gestures, like deleting a file from the
* explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*
* *Note 2:* When deleting a folder with children only one event is fired.
*/
export const onWillDeleteFiles: Event<FileWillDeleteEvent>;
/**
* An event that is emitted when files have been deleted.
*
* *Note 1:* This event is triggered by user gestures, like deleting a file from the
* explorer, or from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*
* *Note 2:* When deleting a folder with children only one event is fired.
*/
export const onDidDeleteFiles: Event<FileDeleteEvent>;
/**
* An event that is emitted when files are being renamed.
*
* *Note 1:* This event is triggered by user gestures, like renaming a file from the
* explorer, and from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*
* *Note 2:* When renaming a folder with children only one event is fired.
*/
export const onWillRenameFiles: Event<FileWillRenameEvent>;
/**
* An event that is emitted when files have been renamed.
*
* *Note 1:* This event is triggered by user gestures, like renaming a file from the
* explorer, and from the [`workspace.applyEdit`](#workspace.applyEdit)-api, but this event is *not* fired when
* files change on disk, e.g triggered by another application, or when using the
* [`workspace.fs`](#FileSystem)-api.
*
* *Note 2:* When renaming a folder with children only one event is fired.
*/
export const onDidRenameFiles: Event<FileRenameEvent>;
}
//#endregion
@@ -852,16 +1119,7 @@ declare module 'vscode' {
}
//#endregion
//#region Tree View
export interface TreeView<T> {
/**
* The tree view title is initially taken from the extension package.json
* Changes to the title property will be properly reflected in the UI in the title of the view.
*/
title?: string;
}
//#region Tree View: https://github.com/microsoft/vscode/issues/61313
/**
* Label describing the [Tree item](#TreeItem)
*/
@@ -894,9 +1152,7 @@ declare module 'vscode' {
}
//#endregion
//#region CustomExecution
//#region CustomExecution: https://github.com/microsoft/vscode/issues/81007
/**
* A task to execute
*/
@@ -904,6 +1160,20 @@ declare module 'vscode' {
detail?: string;
}
export class CustomExecution2 extends CustomExecution {
/**
* Constructs a CustomExecution task object. The callback will be executed the task is run, at which point the
* extension should return the Pseudoterminal it will "run in". The task should wait to do further execution until
* [Pseudoterminal.open](#Pseudoterminal.open) is called. Task cancellation should be handled using
* [Pseudoterminal.close](#Pseudoterminal.close). When the task is complete fire
* [Pseudoterminal.onDidClose](#Pseudoterminal.onDidClose).
* @param callback The callback that will be called when the task is started by a user.
*/
constructor(callback: (resolvedDefinition?: TaskDefinition) => Thenable<Pseudoterminal>);
}
//#endregion
//#region Task presentation group: https://github.com/microsoft/vscode/issues/47265
export interface TaskPresentationOptions {
/**
* Controls whether the task is executed in a specific terminal group using split panes.
@@ -912,7 +1182,7 @@ declare module 'vscode' {
}
//#endregion
// #region Ben - status bar item with ID and Name
//#region Ben - status bar item with ID and Name
export namespace window {
@@ -960,7 +1230,7 @@ declare module 'vscode' {
//#endregion
// #region Ben - extension auth flow (desktop+web)
//#region Ben - extension auth flow (desktop+web)
export interface AppUriOptions {
payload?: {
@@ -973,63 +1243,173 @@ declare module 'vscode' {
export namespace env {
/**
* Creates a Uri that - if opened in a browser - will result in a
* registered [UriHandler](#UriHandler) to fire. The handler's
* Uri will be configured with the path, query and fragment of
* [AppUriOptions](#AppUriOptions) if provided, otherwise it will be empty.
*
* Extensions should not make any assumptions about the resulting
* Uri and should not alter it in anyway. Rather, extensions can e.g.
* use this Uri in an authentication flow, by adding the Uri as
* callback query argument to the server to authenticate to.
*
* Note: If the server decides to add additional query parameters to the Uri
* (e.g. a token or secret), it will appear in the Uri that is passed
* to the [UriHandler](#UriHandler).
*
* **Example** of an authentication flow:
* ```typescript
* vscode.window.registerUriHandler({
* handleUri(uri: vscode.Uri): vscode.ProviderResult<void> {
* if (uri.path === '/did-authenticate') {
* console.log(uri.toString());
* }
* }
* });
*
* const callableUri = await vscode.env.createAppUri({ payload: { path: '/did-authenticate' } });
* await vscode.env.openExternal(callableUri);
* ```
* @deprecated use `vscode.env.asExternalUri` instead.
*/
export function createAppUri(options?: AppUriOptions): Thenable<Uri>;
}
//#endregion
//#region Custom editors, mjbvz
//#region Custom editors: https://github.com/microsoft/vscode/issues/77131
export interface WebviewEditor extends WebviewPanel {
/**
* Defines how a webview editor interacts with VS Code.
*/
interface WebviewEditorCapabilities {
/**
* Invoked when the resource has been renamed in VS Code.
*
* This is called when the resource's new name also matches the custom editor selector.
*
* If this is not implemented—or if the new resource name does not match the existing selector—then VS Code
* will close and reopen the editor on rename.
*
* @param newResource Full path to the resource.
*
* @return Thenable that signals the save is complete.
*/
// rename?(newResource: Uri): Thenable<void>;
/**
* Controls the editing functionality of a webview editor. This allows the webview editor to hook into standard
* editor events such as `undo` or `save`.
*
* WebviewEditors that do not have `editingCapability` are considered to be readonly. Users can still interact
* with readonly editors, but these editors will not integrate with VS Code's standard editor functionality.
*/
readonly editingCapability?: WebviewEditorEditingCapability;
}
/**
* Defines the editing functionality of a webview editor. This allows the webview editor to hook into standard
* editor events such as `undo` or `save`.
*/
interface WebviewEditorEditingCapability {
/**
* Persist the resource.
*
* Extensions should persist the resource
*
* @return Thenable signaling that the save has completed.
*/
save(): Thenable<void>;
/**
*
* @param resource Resource being saved.
* @param targetResource Location to save to.
*/
saveAs(resource: Uri, targetResource: Uri): Thenable<void>;
/**
* Event triggered by extensions to signal to VS Code that an edit has occurred.
*
* The edit must be a json serializable object.
*/
readonly onEdit: Event<any>;
/**
* Apply a set of edits.
*
* This is triggered on redo and when restoring a custom editor after restart. Note that is not invoked
* when `onEdit` is called as `onEdit` implies also updating the view to reflect the edit.
*
* @param edit Array of edits. Sorted from oldest to most recent.
*/
applyEdits(edits: readonly any[]): Thenable<void>;
/**
* Undo a set of edits.
*
* This is triggered when a user undoes an edit or when revert is called on a file.
*
* @param edit Array of edits. Sorted from most recent to oldest.
*/
undoEdits(edits: readonly any[]): Thenable<void>;
}
export interface WebviewEditorProvider {
/**
* Fills out a `WebviewEditor` for a given resource.
*
* The provider should take ownership of passed in `editor`.
*/
* Resolve a webview editor for a given resource.
*
* To resolve a webview editor, a 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`.
*
* @param input Information about the resource being resolved.
* @param webview Webview being resolved. The provider should take ownership of this webview.
*
* @return Thenable to a `WebviewEditorCapabilities` indicating that the webview editor has been resolved.
* The `WebviewEditorCapabilities` defines how the custom editor interacts with VS Code.
*/
resolveWebviewEditor(
resource: Uri,
editor: WebviewEditor
): Thenable<void>;
input: {
readonly resource: Uri
},
webview: WebviewPanel,
): Thenable<WebviewEditorCapabilities>;
}
namespace window {
/**
* Register a new provider for webview editors of a given type.
*
* @param viewType Type of the webview editor provider.
* @param provider Resolves webview editors.
* @param options Content settings for a webview panels the provider is given.
*
* @return Disposable that unregisters the `WebviewEditorProvider`.
*/
export function registerWebviewEditorProvider(
viewType: string,
provider: WebviewEditorProvider,
options?: WebviewPanelOptions
options?: WebviewPanelOptions,
): Disposable;
}
//#endregion
//#region insert/replace completions: https://github.com/microsoft/vscode/issues/10266
export interface CompletionItem {
/**
* A range or a insert and replace range selecting the text that should be replaced by this completion item.
*
* When omitted, the range of the [current word](#TextDocument.getWordRangeAtPosition) is used as replace-range
* and as insert-range the start of the [current word](#TextDocument.getWordRangeAtPosition) to the
* current position is used.
*
* *Note 1:* A range must be a [single line](#Range.isSingleLine) and it must
* [contain](#Range.contains) the position at which completion has been [requested](#CompletionItemProvider.provideCompletionItems).
* *Note 2:* A insert range must be a prefix of a replace range, that means it must be contained and starting at the same position.
*/
range2?: Range | { inserting: Range; replacing: Range; };
}
//#endregion
//#region allow QuickPicks to skip sorting: https://github.com/microsoft/vscode/issues/73904
export interface QuickPick<T extends QuickPickItem> extends QuickInput {
/**
* An optional flag to sort the final results by index of first query match in label. Defaults to true.
*/
sortByLabel: boolean;
}
//#endregion
//#region Surfacing reasons why a code action cannot be applied to users: https://github.com/microsoft/vscode/issues/85160
export interface CodeAction {
/**
* Marks that the code action cannot currently be applied.
*
* This should be a human readable description of why the code action is currently disabled. Disabled code actions
* will be surfaced in the refactor UI but cannot be applied.
*/
disabled?: string;
}
//#endregion
}