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

Clean up

上级 f151c4ea
......@@ -363,6 +363,15 @@ declare module 'vscode' {
* 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
* compatility 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 of a normal terminal. For example when
* an [Terminal.onData](#Terminal.onData) 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.onInput](#TerminalRenderer.onInput) event.
*/
export interface TerminalRenderer {
/**
......@@ -431,6 +440,11 @@ declare module 'vscode' {
*/
export const onDidOpenTerminal: Event<Terminal>;
/**
* Create a [TerminalRenderer](#TerminalRenderer).
*
* @param name The name of the terminal renderer, this shows up in the terminal selector.
*/
export function createTerminalRenderer(name: string): TerminalRenderer;
}
......
......@@ -17,7 +17,7 @@ import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration
import { ILogService } from 'vs/platform/log/common/log';
export class BaseExtHostTerminal {
protected _id: number;
public _id: number;
private _disposed: boolean = false;
private _queuedRequests: ApiRequest[] = [];
......@@ -142,9 +142,6 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco
public get onInput(): Event<string> {
this._checkDisposed();
this._queueApiRequest(this._proxy.$terminalRendererRegisterOnInputListener, [this._id]);
// TODO: This is not firing on renderers as ExtHostTerminalService doesn't track them currently
console.log('TerminalRenderer.onInput id: ', this._id);
// TODO: This needs to fire for keystrokes and sendText only for renderers
// Tell the main side to start sending data if it's not already
// this._proxy.$terminalRendererRegisterOnDataListener(this._id);
return this._onInput && this._onInput.event;
......@@ -156,7 +153,6 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco
this._checkDisposed();
this._dimensions = dimensions;
this._queueApiRequest(this._proxy.$terminalRendererSetDimensions, [dimensions]);
// TODO: Send overridden dimensions over to the terminal instance
}
private _maximumDimensions: vscode.TerminalDimensions;
......@@ -398,8 +394,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
private _getTerminalIndexById(id: number): number {
let index: number = null;
this._terminals.some((terminal, i) => {
// TODO: This shouldn't be cas
const thisId = (<any>terminal)._id;
const thisId = terminal._id;
if (thisId === id) {
index = i;
return true;
......@@ -413,8 +408,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
private _getTerminalRendererIndexById(id: number): number {
let index: number = null;
this._terminalRenderers.some((renderer, i) => {
// TODO: This shouldn't be cas
const thisId = (<any>renderer)._id;
const thisId = renderer._id;
if (thisId === id) {
index = i;
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册