Progress on Terminal.show API

This commit is contained in:
Daniel Imms
2016-08-16 08:14:58 -07:00
parent d464fdc609
commit ab96b1918d
9 changed files with 87 additions and 17 deletions

View File

@@ -147,7 +147,8 @@ export abstract class MainThreadOutputServiceShape {
}
export abstract class MainThreadTerminalServiceShape {
$createTerminal(name?: string) { throw ni(); }
$createTerminal(name?: string): void { throw ni(); }
$show(terminalId: number, preserveFocus: boolean): void { throw ni(); }
}
export interface MyQuickPickItems extends IPickOpenEntry {

View File

@@ -18,6 +18,22 @@ export class ExtHostTerminal implements vscode.Terminal {
this.name = name;
this._proxy = proxy;
}
public sendText(text: string, addNewLine: boolean = true) {
// TODO: Implement
}
public show(preserveFocus: boolean): void {
this._proxy.$show(0, preserveFocus);
}
public hide(): void {
// TODO: Implement
}
public dispose(): void {
// TODO: Implement
}
}
export class ExtHostTerminalService {
@@ -28,7 +44,8 @@ export class ExtHostTerminalService {
this._proxy = threadService.get(MainContext.MainThreadTerminalService);
}
createTerminal(name?: string): vscode.Terminal {
public createTerminal(name?: string): vscode.Terminal {
this._proxy.$createTerminal(name);
return new ExtHostTerminal(this._proxy, name);
}
}

View File

@@ -17,4 +17,12 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
super();
this._terminalService = terminalService;
}
public $createTerminal(name?: string): void {
this._terminalService.createNew();
}
public $show(terminalId: number, preserveFocus: boolean): void {
this._terminalService.show(!preserveFocus, terminalId);
}
}