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

Implement dispose and hide

上级 734f91b5
......@@ -148,8 +148,10 @@ export abstract class MainThreadOutputServiceShape {
export abstract class MainThreadTerminalServiceShape {
$createTerminal(name?: string): TPromise<number> { throw ni(); }
$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
$dispose(terminalId: number): void { throw ni(); }
$hide(terminalId: number): void { throw ni(); }
$sendText(terminalId: number, text: string, addNewLine: boolean): void { throw ni(); }
$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
}
export interface MyQuickPickItems extends IPickOpenEntry {
......
......@@ -15,6 +15,7 @@ export class ExtHostTerminal implements vscode.Terminal {
private _id: number;
private _proxy: MainThreadTerminalServiceShape;
private _disposed: boolean;
constructor(proxy: MainThreadTerminalServiceShape, id: number, name?: string) {
this.name = name;
......@@ -31,11 +32,14 @@ export class ExtHostTerminal implements vscode.Terminal {
}
public hide(): void {
// TODO: Implement
this._proxy.$hide(this._id);
}
public dispose(): void {
// TODO: Implement
if (!this._disposed) {
this._disposed = true;
this._proxy.$dispose(this._id);
}
}
}
......
......@@ -29,6 +29,19 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
});
}
public $hide(terminalId: number): void {
this._terminalService.hide();
}
public $dispose(terminalId: number): void {
// TODO: This could be improved by not first showing the terminal to be disposed
var self = this;
this._terminalService.show(false).then((terminalPanel) => {
terminalPanel.setActiveTerminalById(terminalId);
self._terminalService.close();
});;
}
public $sendText(terminalId: number, text: string, addNewLine: boolean): void {
this._terminalService.show(false).then((terminalPanel) => {
terminalPanel.setActiveTerminalById(terminalId);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册