mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 15:01:57 +01:00
⚡ shell should wait for shared process to be up and running
This commit is contained in:
@@ -143,7 +143,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
|
||||
|
||||
// Spawn shared process
|
||||
const sharedProcess = new SharedProcess(environmentService, userEnv);
|
||||
const sharedProcessClient = sharedProcess.onReady
|
||||
const sharedProcessClient = sharedProcess.whenReady()
|
||||
.then(() => connect(environmentService.sharedIPCHandle, 'main'));
|
||||
|
||||
// Create a new service collection, because the telemetry service
|
||||
|
||||
@@ -17,7 +17,7 @@ export class SharedProcess {
|
||||
private disposables: IDisposable[] = [];
|
||||
|
||||
@memoize
|
||||
get onReady(): TPromise<void> {
|
||||
private get _whenReady(): TPromise<void> {
|
||||
this.window = new BrowserWindow({ show: false });
|
||||
const config = assign({
|
||||
appRoot: this.environmentService.appRoot,
|
||||
@@ -59,7 +59,7 @@ export class SharedProcess {
|
||||
args: this.environmentService.args
|
||||
});
|
||||
|
||||
sender.once('handshake:im ready', () => c(null));
|
||||
ipcMain.once('handshake:im ready', () => c(null));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -69,6 +69,10 @@ export class SharedProcess {
|
||||
private userEnv: IProcessEnvironment
|
||||
) { }
|
||||
|
||||
whenReady(): TPromise<void> {
|
||||
return this._whenReady;
|
||||
}
|
||||
|
||||
toggle(): void {
|
||||
if (this.window.isVisible()) {
|
||||
this.hide();
|
||||
|
||||
Reference in New Issue
Block a user