VSCode merge (#4610)

* Merge from vscode e388c734f30757875976c7e326d6cfeee77710de

* fix yarn lcoks

* remove small issue
This commit is contained in:
Anthony Dresser
2019-03-20 10:39:09 -07:00
committed by GitHub
parent 87765e8673
commit c814b92557
310 changed files with 6606 additions and 2129 deletions

View File

@@ -31,9 +31,12 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
public get onRequestInitialCwd(): Event<void> { return this._onRequestInitialCwd.event; }
private readonly _onRequestCwd = new Emitter<void>();
public get onRequestCwd(): Event<void> { return this._onRequestCwd.event; }
private readonly _onRequestLatency = new Emitter<void>();
public get onRequestLatency(): Event<void> { return this._onRequestLatency.event; }
private _pendingInitialCwdRequests: ((value?: string | Thenable<string>) => void)[] = [];
private _pendingCwdRequests: ((value?: string | Thenable<string>) => void)[] = [];
private _pendingLatencyRequests: ((value?: number | Thenable<number>) => void)[] = [];
constructor(
public terminalId: number,
@@ -86,6 +89,12 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
}
}
public emitLatency(latency: number): void {
while (this._pendingLatencyRequests.length > 0) {
this._pendingLatencyRequests.pop()!(latency);
}
}
public shutdown(immediate: boolean): void {
this._onShutdown.fire(immediate);
}
@@ -111,4 +120,11 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
this._pendingCwdRequests.push(resolve);
});
}
public getLatency(): Promise<number> {
return new Promise<number>(resolve => {
this._onRequestLatency.fire();
this._pendingLatencyRequests.push(resolve);
});
}
}