提交 f3e89cad 编写于 作者: D Daniel Imms

Rename terminal ext APIS to match convention

Fixes 52882
上级 8adcb8b4
...@@ -341,7 +341,7 @@ declare module 'vscode' { ...@@ -341,7 +341,7 @@ declare module 'vscode' {
* provides access to the raw data stream from the process running within the terminal, * provides access to the raw data stream from the process running within the terminal,
* including VT sequences. * including VT sequences.
*/ */
onData: Event<string>; onDidWriteData: Event<string>;
} }
/** /**
...@@ -368,10 +368,10 @@ declare module 'vscode' { ...@@ -368,10 +368,10 @@ declare module 'vscode' {
* created with all its APIs available for use by extensions. When using the Terminal object * 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 * of a TerminalRenderer it acts just like normal only the extension that created the
* TerminalRenderer essentially acts as a process. For example when an * TerminalRenderer essentially acts as a process. For example when an
* [Terminal.onData](#Terminal.onData) listener is registered, that will fire when * [Terminal.onDidWriteData](#Terminal.onDidWriteData) listener is registered, that will fire
* [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when * when [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when
* [Terminal.sendText](#Terminal.sendText) is triggered that will fire the * [Terminal.sendText](#Terminal.sendText) is triggered that will fire the
* [TerminalRenderer.onInput](#TerminalRenderer.onInput) event. * [TerminalRenderer.onDidAcceptInput](#TerminalRenderer.onDidAcceptInput) event.
* *
* **Example:** Create a terminal renderer, show it and write hello world in red * **Example:** Create a terminal renderer, show it and write hello world in red
* ```typescript * ```typescript
...@@ -441,13 +441,13 @@ declare module 'vscode' { ...@@ -441,13 +441,13 @@ declare module 'vscode' {
* workbench command such as `workbench.action.terminal.runSelectedText` * workbench command such as `workbench.action.terminal.runSelectedText`
* ```typescript * ```typescript
* const terminalRenderer = window.createTerminalRenderer('test'); * const terminalRenderer = window.createTerminalRenderer('test');
* terminalRenderer.onInput(data => { * terminalRenderer.onDidAcceptInput(data => {
* cosole.log(data); // 'Hello world' * cosole.log(data); // 'Hello world'
* }); * });
* terminalRenderer.terminal.then(t => t.sendText('Hello world')); * terminalRenderer.terminal.then(t => t.sendText('Hello world'));
* ``` * ```
*/ */
onInput: Event<string>; onDidAcceptInput: Event<string>;
/** /**
* An event which fires when the [maximum dimensions](#TerminalRenderer.maimumDimensions) of * An event which fires when the [maximum dimensions](#TerminalRenderer.maimumDimensions) of
......
...@@ -77,7 +77,7 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi ...@@ -77,7 +77,7 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi
private _pidPromiseComplete: (value: number) => any; private _pidPromiseComplete: (value: number) => any;
private readonly _onData: Emitter<string> = new Emitter<string>(); private readonly _onData: Emitter<string> = new Emitter<string>();
public get onData(): Event<string> { public get onDidWriteData(): Event<string> {
// Tell the main side to start sending data if it's not already // Tell the main side to start sending data if it's not already
this._proxy.$registerOnDataListener(this._id); this._proxy.$registerOnDataListener(this._id);
return this._onData && this._onData.event; return this._onData && this._onData.event;
...@@ -156,7 +156,7 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco ...@@ -156,7 +156,7 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco
} }
private readonly _onInput: Emitter<string> = new Emitter<string>(); private readonly _onInput: Emitter<string> = new Emitter<string>();
public get onInput(): Event<string> { public get onDidAcceptInput(): Event<string> {
this._checkDisposed(); this._checkDisposed();
this._queueApiRequest(this._proxy.$terminalRendererRegisterOnInputListener, [this._id]); this._queueApiRequest(this._proxy.$terminalRendererRegisterOnInputListener, [this._id]);
// Tell the main side to start sending data if it's not already // Tell the main side to start sending data if it's not already
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册