Change:
There a few usages of in which is against our layering rules. I'd suggest to move the whole file into an folder
Unfortunately this might not be so simple given 62 references of which some would also need to be lifted up... An alternative would be to define similar interfaces that contain the properties we actually need instead of depending on Electron.
Also: and
I'd favour to lift them all instead blowing up our code size
with our current code organisation I cannot express the proper way for these references. Here are the issues: Moving this service into src/workbench This was my first idea, but it doesn't work. There are references from (our main side of things) into the windows service because the main side basically implements that service. We should not depend from to other than the file that we load into a window. The only way out I see here is to have something like for services that are shared between and . Moving the service from common into electron-browser This will not help because we have depending on the windows service and thus we would reach from into . The only option would be to introduce a new layer that contains the service and that can be accessed by and . To unblock your 2-CU scenario and to use ES6 features in workbench I suggest to that will inline the Electron references. However if we ever want to tackle this properly it needs some serious new code-structure layout on disk. Thoughts?
Yeah, makes sense... It's unfortunate but reality...

Discussion:
windowId?: number; forceNewWindow?: boolean; <del> dialogOptions?: Electron.OpenDialogOptions; </del> <ins> dialogOptions?: OpenDialogOptions; </ins> telemetryEventName?: string; telemetryExtraData?: ITelemetryData;

backupPath: string; } <ins> export interface CrashReporterStartOptions { companyName?: string; submitURL: string; productName?: string; uploadToServer?: boolean; ignoreSystemCrashHandler?: boolean; extra?: any; crashesDirectory?: string; } export interface OpenDialogOptions { title?: string; defaultPath?: string; buttonLabel?: string; filters?: FileFilter[]; properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>; message?: string; } export interface FileFilter { extensions: string[]; name: string; } export interface MessageBoxOptions { type?: string; buttons?: string[]; defaultId?: number; title?: string; message: string; detail?: string; checkboxLabel?: string; checkboxChecked?: boolean; cancelId?: number; noLink?: boolean; normalizeAccessKeys?: boolean; } export interface SaveDialogOptions { title?: string; defaultPath?: string; buttonLabel?: string; filters?: FileFilter[]; message?: string; nameFieldLabel?: string; showsTagField?: boolean; } export interface OpenDialogOptions { title?: string; defaultPath?: string; buttonLabel?: string; filters?: FileFilter[]; properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles' | 'createDirectory' | 'promptToCreate' | 'noResolveAliases' | 'treatPackageAsDirectory'>; message?: string; } </ins> export interface IWindowsService { _serviceBrand: any;

openExternal(url: string): TPromise<boolean>; // TODO: this is a bit backwards <del> startCrashReporter(config: Electron.CrashReporterStartOptions): TPromise<void>; </del> <ins> startCrashReporter(config: CrashReporterStartOptions): TPromise<void>; </ins> } export const IWindowService = createDecorator<IWindowService>('windowService');

unmaximizeWindow(): TPromise<void>; onWindowTitleDoubleClick(): TPromise<void>; show(): TPromise<void>; <del> showMessageBoxSync(options: Electron.MessageBoxOptions): number; showMessageBox(options: Electron.MessageBoxOptions): TPromise<IMessageBoxResult>; showSaveDialog(options: Electron.SaveDialogOptions, callback?: (fileName: string) => void): string; showOpenDialog(options: Electron.OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; </del> <ins> showMessageBoxSync(options: MessageBoxOptions): number; showMessageBox(options: MessageBoxOptions): TPromise<IMessageBoxResult>; showSaveDialog(options: SaveDialogOptions, callback?: (fileName: string) => void): string; showOpenDialog(options: OpenDialogOptions, callback?: (fileNames: string[]) => void): string[]; </ins> } export type MenuBarVisibility = 'default' | 'visible' | 'toggle' | 'hidden';

import { TPromise } from 'vs/base/common/winjs.base'; import Event, { buffer } from 'vs/base/common/event'; import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; <del> import { IWindowsService, INativeOpenDialogOptions, IEnterWorkspaceResult } from './windows'; </del> <ins> import { IWindowsService, INativeOpenDialogOptions, IEnterWorkspaceResult, CrashReporterStartOptions } from 'vs/platform/windows/common/windows'; </ins> import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { IRecentlyOpened } from 'vs/platform/history/common/history'; import { ICommandAction } from 'vs/platform/actions/common/actions';

call(command: 'log', arg: [string, string[]]): TPromise<void>; call(command: 'showItemInFolder', arg: string): TPromise<void>; call(command: 'openExternal', arg: string): TPromise<boolean>; <del> call(command: 'startCrashReporter', arg: Electron.CrashReporterStartOptions): TPromise<void>; </del> <ins> call(command: 'startCrashReporter', arg: CrashReporterStartOptions): TPromise<void>; </ins> call(command: string, arg?: any): TPromise<any>; }

return this.channel.call('openExternal', url); } <del> startCrashReporter(config: Electron.CrashReporterStartOptions): TPromise<void> { </del> <ins> startCrashReporter(config: CrashReporterStartOptions): TPromise<void> { </ins> return this.channel.call('startCrashReporter', config); }