mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 02:48:30 -05:00
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:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user