debt - fold electron environment and native environment into one

This commit is contained in:
Benjamin Pasero
2020-03-03 08:34:59 +01:00
parent 44c76bd3b9
commit 9ce4ebbf0f
23 changed files with 75 additions and 112 deletions

View File

@@ -11,9 +11,10 @@ import { URLService } from 'vs/platform/url/node/urlService';
import { IOpenerService, IOpener, matchesScheme } from 'vs/platform/opener/common/opener';
import product from 'vs/platform/product/common/product';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IElectronEnvironmentService } from 'vs/workbench/services/electron/electron-browser/electronEnvironmentService';
import { createChannelSender } from 'vs/base/parts/ipc/node/ipc';
import { IElectronService } from 'vs/platform/electron/node/electron';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-browser/environmentService';
export interface IRelayOpenURLOptions extends IOpenURLOptions {
openToSide?: boolean;
@@ -27,7 +28,7 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
constructor(
@IMainProcessService mainProcessService: IMainProcessService,
@IOpenerService openerService: IOpenerService,
@IElectronEnvironmentService private electronEnvironmentService: IElectronEnvironmentService,
@IWorkbenchEnvironmentService private readonly environmentService: INativeWorkbenchEnvironmentService,
@IElectronService private electronService: IElectronService
) {
super();
@@ -43,9 +44,9 @@ export class RelayURLService extends URLService implements IURLHandler, IOpener
let query = uri.query;
if (!query) {
query = `windowId=${encodeURIComponent(this.electronEnvironmentService.windowId)}`;
query = `windowId=${encodeURIComponent(this.environmentService.configuration.windowId)}`;
} else {
query += `&windowId=${encodeURIComponent(this.electronEnvironmentService.windowId)}`;
query += `&windowId=${encodeURIComponent(this.environmentService.configuration.windowId)}`;
}
return uri.with({ query });