Change getDefaultShellAndArgs to use promises

Part of #75793
This commit is contained in:
Daniel Imms
2020-02-05 12:03:45 -08:00
parent 1aefcce704
commit 5fad95f544
7 changed files with 14 additions and 13 deletions

View File

@@ -309,15 +309,16 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
return true;
}
private async _onRequestAvailableShells(callback: IAvailableShellsRequest): Promise<void> {
private async _onRequestAvailableShells(req: IAvailableShellsRequest): Promise<void> {
if (this._isPrimaryExtHost()) {
callback(await this._proxy.$getAvailableShells());
req.callback(await this._proxy.$getAvailableShells());
}
}
private _onRequestDefaultShellAndArgs(request: IDefaultShellAndArgsRequest): void {
private async _onRequestDefaultShellAndArgs(req: IDefaultShellAndArgsRequest): Promise<void> {
if (this._isPrimaryExtHost()) {
this._proxy.$requestDefaultShellAndArgs(request.useAutomationShell).then(e => request.callback(e.shell, e.args));
const res = await this._proxy.$getDefaultShellAndArgs(req.useAutomationShell);
req.callback(res.shell, res.args);
}
}