Vscode merge (#4582)

* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
This commit is contained in:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Event, Emitter } from 'vs/base/common/event';
import { ITerminalService, ITerminalProcessExtHostProxy, IShellLaunchConfig, ITerminalChildProcess } from 'vs/workbench/contrib/terminal/common/terminal';
import { IDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerminalProcessExtHostProxy {
private _disposables: IDisposable[] = [];
private readonly _onProcessData = new Emitter<string>();
public get onProcessData(): Event<string> { return this._onProcessData.event; }
private readonly _onProcessExit = new Emitter<number>();
public get onProcessExit(): Event<number> { return this._onProcessExit.event; }
private readonly _onProcessIdReady = new Emitter<number>();
public get onProcessIdReady(): Event<number> { return this._onProcessIdReady.event; }
private readonly _onProcessTitleChanged = new Emitter<string>();
public get onProcessTitleChanged(): Event<string> { return this._onProcessTitleChanged.event; }
private readonly _onInput = new Emitter<string>();
public get onInput(): Event<string> { return this._onInput.event; }
private readonly _onResize: Emitter<{ cols: number, rows: number }> = new Emitter<{ cols: number, rows: number }>();
public get onResize(): Event<{ cols: number, rows: number }> { return this._onResize.event; }
private readonly _onShutdown = new Emitter<boolean>();
public get onShutdown(): Event<boolean> { return this._onShutdown.event; }
private readonly _onRequestInitialCwd = new Emitter<void>();
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 _pendingInitialCwdRequests: ((value?: string | Thenable<string>) => void)[] = [];
private _pendingCwdRequests: ((value?: string | Thenable<string>) => void)[] = [];
constructor(
public terminalId: number,
shellLaunchConfig: IShellLaunchConfig,
activeWorkspaceRootUri: URI,
cols: number,
rows: number,
@ITerminalService private readonly _terminalService: ITerminalService,
@IExtensionService private readonly _extensionService: IExtensionService
) {
this._extensionService.whenInstalledExtensionsRegistered().then(() => {
// TODO: MainThreadTerminalService is not ready at this point, fix this
setTimeout(() => {
this._terminalService.requestExtHostProcess(this, shellLaunchConfig, activeWorkspaceRootUri, cols, rows);
}, 0);
});
}
public dispose(): void {
this._disposables.forEach(d => d.dispose());
this._disposables.length = 0;
}
public emitData(data: string): void {
this._onProcessData.fire(data);
}
public emitTitle(title: string): void {
this._onProcessTitleChanged.fire(title);
}
public emitPid(pid: number): void {
this._onProcessIdReady.fire(pid);
}
public emitExit(exitCode: number): void {
this._onProcessExit.fire(exitCode);
this.dispose();
}
public emitInitialCwd(initialCwd: string): void {
while (this._pendingInitialCwdRequests.length > 0) {
this._pendingInitialCwdRequests.pop()!(initialCwd);
}
}
public emitCwd(cwd: string): void {
while (this._pendingCwdRequests.length > 0) {
this._pendingCwdRequests.pop()!(cwd);
}
}
public shutdown(immediate: boolean): void {
this._onShutdown.fire(immediate);
}
public input(data: string): void {
this._onInput.fire(data);
}
public resize(cols: number, rows: number): void {
this._onResize.fire({ cols, rows });
}
public getInitialCwd(): Promise<string> {
return new Promise<string>(resolve => {
this._onRequestInitialCwd.fire();
this._pendingInitialCwdRequests.push(resolve);
});
}
public getCwd(): Promise<string> {
return new Promise<string>(resolve => {
this._onRequestCwd.fire();
this._pendingCwdRequests.push(resolve);
});
}
}