Initial VS Code 1.19 source merge (#571)

* Initial 1.19 xcopy

* Fix yarn build

* Fix numerous build breaks

* Next batch of build break fixes

* More build break fixes

* Runtime breaks

* Additional post merge fixes

* Fix windows setup file

* Fix test failures.

* Update license header blocks to refer to source eula
This commit is contained in:
Karl Burtram
2018-01-28 23:37:17 -08:00
committed by GitHub
parent 9a1ac20710
commit 251ae01c3e
8009 changed files with 93378 additions and 35634 deletions

View File

@@ -10,16 +10,22 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import { TPromise } from 'vs/base/common/winjs.base';
import { IProcessEnvironment } from 'vs/base/common/platform';
import { BrowserWindow, ipcMain } from 'electron';
import { PromiseSource } from 'vs/base/common/async';
import { ISharedProcess } from 'vs/platform/windows/electron-main/windows';
import { Barrier } from 'vs/base/common/async';
export class SharedProcess implements ISharedProcess {
private spawnPromiseSource: PromiseSource<void>;
private barrier = new Barrier();
private window: Electron.BrowserWindow;
private disposables: IDisposable[] = [];
constructor(
private environmentService: IEnvironmentService,
private readonly machineId: string,
private readonly userEnv: IProcessEnvironment
) { }
@memoize
private get _whenReady(): TPromise<void> {
this.window = new BrowserWindow({
@@ -32,6 +38,7 @@ export class SharedProcess implements ISharedProcess {
});
const config = assign({
appRoot: this.environmentService.appRoot,
machineId: this.machineId,
nodeCachedDataDir: this.environmentService.nodeCachedDataDir,
userEnv: this.userEnv
});
@@ -65,7 +72,7 @@ export class SharedProcess implements ISharedProcess {
}));
return new TPromise<void>((c, e) => {
ipcMain.once('handshake:hello', ({ sender }) => {
ipcMain.once('handshake:hello', ({ sender }: { sender: any }) => {
sender.send('handshake:hey there', {
sharedIPCHandle: this.environmentService.sharedIPCHandle,
args: this.environmentService.args
@@ -76,22 +83,15 @@ export class SharedProcess implements ISharedProcess {
});
}
constructor(
private environmentService: IEnvironmentService,
private userEnv: IProcessEnvironment
) {
this.spawnPromiseSource = new PromiseSource<void>();
spawn(): void {
this.barrier.open();
}
public spawn(): void {
this.spawnPromiseSource.complete();
whenReady(): TPromise<void> {
return this.barrier.wait().then(() => this._whenReady);
}
public whenReady(): TPromise<void> {
return this.spawnPromiseSource.value.then(() => this._whenReady);
}
public toggle(): void {
toggle(): void {
if (this.window.isVisible()) {
this.hide();
} else {
@@ -99,17 +99,17 @@ export class SharedProcess implements ISharedProcess {
}
}
public show(): void {
show(): void {
this.window.show();
this.window.webContents.openDevTools();
}
public hide(): void {
hide(): void {
this.window.webContents.closeDevTools();
this.window.hide();
}
public dispose(): void {
dispose(): void {
this.disposables = dispose(this.disposables);
}
}