mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 52dcb723a39ae75bee1bd56b3312d7fcdc87aeed (#6719)
This commit is contained in:
181
src/vs/vscode.proposed.d.ts
vendored
181
src/vs/vscode.proposed.d.ts
vendored
@@ -752,11 +752,29 @@ 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 {
|
||||
@@ -771,22 +789,12 @@ declare module 'vscode' {
|
||||
* 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.
|
||||
*
|
||||
* @deprecated Use [window.onDidWriteTerminalData](#onDidWriteTerminalData).
|
||||
*/
|
||||
readonly onDidWriteData: Event<string>;
|
||||
}
|
||||
|
||||
|
||||
export interface TerminalOptions {
|
||||
/**
|
||||
* When enabled the terminal will run the process as normal but not be surfaced to the user
|
||||
* until `Terminal.show` is called. The typical usage for this is when you need to run
|
||||
* something that may need interactivity but only want to tell the user about it when
|
||||
* interaction is needed. Note that the terminals will still be exposed to all extensions
|
||||
* as normal.
|
||||
*/
|
||||
runInBackground?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the dimensions of a terminal.
|
||||
*/
|
||||
@@ -802,134 +810,13 @@ declare module 'vscode' {
|
||||
readonly rows: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a terminal without a process where all interaction and output in the terminal is
|
||||
* controlled by an extension. This is similar to an output window but has the same VT sequence
|
||||
* compatibility as the regular terminal.
|
||||
*
|
||||
* Note that an instance of [Terminal](#Terminal) will be created when a TerminalRenderer is
|
||||
* created with all its APIs available for use by extensions. When using the Terminal object
|
||||
* of a TerminalRenderer it acts just like normal only the extension that created the
|
||||
* TerminalRenderer essentially acts as a process. For example when an
|
||||
* [Terminal.onDidWriteData](#Terminal.onDidWriteData) listener is registered, that will fire
|
||||
* when [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when
|
||||
* [Terminal.sendText](#Terminal.sendText) is triggered that will fire the
|
||||
* [TerminalRenderer.onDidAcceptInput](#TerminalRenderer.onDidAcceptInput) event.
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*
|
||||
* **Example:** Create a terminal renderer, show it and write hello world in red
|
||||
* ```typescript
|
||||
* const renderer = window.createTerminalRenderer('foo');
|
||||
* renderer.terminal.then(t => t.show());
|
||||
* renderer.write('\x1b[31mHello world\x1b[0m');
|
||||
* ```
|
||||
*/
|
||||
export interface TerminalRenderer {
|
||||
/**
|
||||
* The name of the terminal, this will appear in the terminal selector.
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* The dimensions of the terminal, the rows and columns of the terminal can only be set to
|
||||
* a value smaller than the maximum value, if this is undefined the terminal will auto fit
|
||||
* to the maximum value [maximumDimensions](TerminalRenderer.maximumDimensions).
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*
|
||||
* **Example:** Override the dimensions of a TerminalRenderer to 20 columns and 10 rows
|
||||
* ```typescript
|
||||
* terminalRenderer.dimensions = {
|
||||
* cols: 20,
|
||||
* rows: 10
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
dimensions: TerminalDimensions | undefined;
|
||||
|
||||
/**
|
||||
* The maximum dimensions of the terminal, this will be undefined immediately after a
|
||||
* terminal renderer is created and also until the terminal becomes visible in the UI.
|
||||
* Listen to [onDidChangeMaximumDimensions](TerminalRenderer.onDidChangeMaximumDimensions)
|
||||
* to get notified when this value changes.
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*/
|
||||
readonly maximumDimensions: TerminalDimensions | undefined;
|
||||
|
||||
/**
|
||||
* The corresponding [Terminal](#Terminal) for this TerminalRenderer.
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*/
|
||||
readonly terminal: Terminal;
|
||||
|
||||
/**
|
||||
* Write text to the terminal. Unlike [Terminal.sendText](#Terminal.sendText) which sends
|
||||
* text to the underlying _process_, this will write the text to the terminal itself.
|
||||
*
|
||||
* @param text The text to write.
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*
|
||||
* **Example:** Write red text to the terminal
|
||||
* ```typescript
|
||||
* terminalRenderer.write('\x1b[31mHello world\x1b[0m');
|
||||
* ```
|
||||
*
|
||||
* **Example:** Move the cursor to the 10th row and 20th column and write an asterisk
|
||||
* ```typescript
|
||||
* terminalRenderer.write('\x1b[10;20H*');
|
||||
* ```
|
||||
*/
|
||||
write(text: string): void;
|
||||
|
||||
/**
|
||||
* An event which fires on keystrokes in the terminal or when an extension calls
|
||||
* [Terminal.sendText](#Terminal.sendText). Keystrokes are converted into their
|
||||
* corresponding VT sequence representation.
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*
|
||||
* **Example:** Simulate interaction with the terminal from an outside extension or a
|
||||
* workbench command such as `workbench.action.terminal.runSelectedText`
|
||||
* ```typescript
|
||||
* const terminalRenderer = window.createTerminalRenderer('test');
|
||||
* terminalRenderer.onDidAcceptInput(data => {
|
||||
* console.log(data); // 'Hello world'
|
||||
* });
|
||||
* terminalRenderer.terminal.sendText('Hello world');
|
||||
* ```
|
||||
*/
|
||||
readonly onDidAcceptInput: Event<string>;
|
||||
|
||||
/**
|
||||
* An event which fires when the [maximum dimensions](#TerminalRenderer.maximumDimensions) of
|
||||
* the terminal renderer change.
|
||||
*
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*/
|
||||
readonly onDidChangeMaximumDimensions: Event<TerminalDimensions>;
|
||||
}
|
||||
|
||||
export namespace window {
|
||||
/**
|
||||
* Create a [TerminalRenderer](#TerminalRenderer).
|
||||
*
|
||||
* @param name The name of the terminal renderer, this shows up in the terminal selector.
|
||||
* @deprecated Use [ExtensionTerminalOptions](#ExtensionTerminalOptions) instead.
|
||||
*/
|
||||
export function createTerminalRenderer(name: string): TerminalRenderer;
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Extension terminals
|
||||
|
||||
export namespace window {
|
||||
/**
|
||||
* Creates a [Terminal](#Terminal) where an extension controls the teerminal.
|
||||
* Creates a [Terminal](#Terminal) where an extension controls the terminal.
|
||||
*
|
||||
* @param options An [ExtensionTerminalOptions](#ExtensionTerminalOptions) object describing
|
||||
* the characteristics of the new terminal.
|
||||
@@ -1125,7 +1012,7 @@ declare module 'vscode' {
|
||||
/**
|
||||
* An optional human-readable message that will be rendered in the view.
|
||||
*/
|
||||
message?: string | MarkdownString;
|
||||
message?: string;
|
||||
|
||||
}
|
||||
|
||||
@@ -1162,30 +1049,12 @@ declare module 'vscode' {
|
||||
//#endregion
|
||||
|
||||
//#region CustomExecution
|
||||
/**
|
||||
* Class used to execute an extension callback as a task.
|
||||
*/
|
||||
export class CustomExecution {
|
||||
/**
|
||||
* @param callback The callback that will be called when the extension callback task is executed.
|
||||
*/
|
||||
constructor(callback: (terminalRenderer: TerminalRenderer, cancellationToken: CancellationToken, thisArg?: any) => Thenable<number>);
|
||||
|
||||
/**
|
||||
* The callback used to execute the task.
|
||||
* @param terminalRenderer Used by the task to render output and receive input.
|
||||
* @param cancellationToken Cancellation used to signal a cancel request to the executing task.
|
||||
* @returns The callback should return '0' for success and a non-zero value for failure.
|
||||
*/
|
||||
callback: (terminalRenderer: TerminalRenderer, cancellationToken: CancellationToken, thisArg?: any) => Thenable<number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Class used to execute an extension callback as a task.
|
||||
*/
|
||||
export class CustomExecution2 {
|
||||
/**
|
||||
* @param process The [Pseudotrminal](#Pseudoterminal) to be used by the task to display output.
|
||||
* @param process The [Pseudoterminal](#Pseudoterminal) to be used by the task to display output.
|
||||
* @param callback The callback that will be called when the task is started by a user.
|
||||
*/
|
||||
constructor(callback: (thisArg?: any) => Thenable<Pseudoterminal>);
|
||||
@@ -1214,12 +1083,12 @@ declare module 'vscode' {
|
||||
* or '$eslint'. Problem matchers can be contributed by an extension using
|
||||
* the `problemMatchers` extension point.
|
||||
*/
|
||||
constructor(taskDefinition: TaskDefinition, scope: WorkspaceFolder | TaskScope.Global | TaskScope.Workspace, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution | CustomExecution2, problemMatchers?: string | string[]);
|
||||
constructor(taskDefinition: TaskDefinition, scope: WorkspaceFolder | TaskScope.Global | TaskScope.Workspace, name: string, source: string, execution?: ProcessExecution | ShellExecution | CustomExecution2, problemMatchers?: string | string[]);
|
||||
|
||||
/**
|
||||
* The task's execution engine
|
||||
*/
|
||||
execution2?: ProcessExecution | ShellExecution | CustomExecution | CustomExecution2;
|
||||
execution2?: ProcessExecution | ShellExecution | CustomExecution2;
|
||||
}
|
||||
//#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user