diff --git a/src/vs/platform/clipboard/browser/clipboardService.ts b/src/vs/workbench/services/clipboard/browser/clipboardService.ts similarity index 100% rename from src/vs/platform/clipboard/browser/clipboardService.ts rename to src/vs/workbench/services/clipboard/browser/clipboardService.ts diff --git a/src/vs/platform/clipboard/electron-browser/clipboardService.ts b/src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts similarity index 78% rename from src/vs/platform/clipboard/electron-browser/clipboardService.ts rename to src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts index 3b269b200fc..6962d84f471 100644 --- a/src/vs/platform/clipboard/electron-browser/clipboardService.ts +++ b/src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts @@ -7,8 +7,9 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService import { clipboard } from 'electron'; import { URI } from 'vs/base/common/uri'; import { isMacintosh } from 'vs/base/common/platform'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -export class ClipboardService implements IClipboardService { +export class NativeClipboardService implements IClipboardService { private static FILE_FORMAT = 'code/file-list'; // Clipboard format for files @@ -42,16 +43,16 @@ export class ClipboardService implements IClipboardService { writeResources(resources: URI[]): void { if (resources.length) { - clipboard.writeBuffer(ClipboardService.FILE_FORMAT, this.resourcesToBuffer(resources)); + clipboard.writeBuffer(NativeClipboardService.FILE_FORMAT, this.resourcesToBuffer(resources)); } } readResources(): URI[] { - return this.bufferToResources(clipboard.readBuffer(ClipboardService.FILE_FORMAT)); + return this.bufferToResources(clipboard.readBuffer(NativeClipboardService.FILE_FORMAT)); } hasResources(): boolean { - return clipboard.has(ClipboardService.FILE_FORMAT); + return clipboard.has(NativeClipboardService.FILE_FORMAT); } private resourcesToBuffer(resources: URI[]): Buffer { @@ -75,3 +76,5 @@ export class ClipboardService implements IClipboardService { } } } + +registerSingleton(IClipboardService, NativeClipboardService, true); diff --git a/src/vs/platform/issue/electron-browser/issueService.ts b/src/vs/workbench/services/issue/electron-browser/issueService.ts similarity index 85% rename from src/vs/platform/issue/electron-browser/issueService.ts rename to src/vs/workbench/services/issue/electron-browser/issueService.ts index 8a6b6beb8dd..0143cff6f3e 100644 --- a/src/vs/platform/issue/electron-browser/issueService.ts +++ b/src/vs/workbench/services/issue/electron-browser/issueService.ts @@ -6,6 +6,7 @@ import { IIssueService } from 'vs/platform/issue/node/issue'; import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService'; import { createChannelSender } from 'vs/base/parts/ipc/node/ipc'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class IssueService { @@ -15,3 +16,5 @@ export class IssueService { return createChannelSender(mainProcessService.getChannel('issue')); } } + +registerSingleton(IIssueService, IssueService, true); diff --git a/src/vs/workbench/services/localizations/electron-browser/localizationsService.ts b/src/vs/workbench/services/localizations/electron-browser/localizationsService.ts index 11bf84bbab2..99394090da8 100644 --- a/src/vs/workbench/services/localizations/electron-browser/localizationsService.ts +++ b/src/vs/workbench/services/localizations/electron-browser/localizationsService.ts @@ -19,4 +19,4 @@ export class LocalizationsService { } } -registerSingleton(ILocalizationsService, LocalizationsService); +registerSingleton(ILocalizationsService, LocalizationsService, true); diff --git a/src/vs/platform/menubar/electron-browser/menubarService.ts b/src/vs/workbench/services/menubar/electron-browser/menubarService.ts similarity index 85% rename from src/vs/platform/menubar/electron-browser/menubarService.ts rename to src/vs/workbench/services/menubar/electron-browser/menubarService.ts index 41bc077912e..9e4efbada0e 100644 --- a/src/vs/platform/menubar/electron-browser/menubarService.ts +++ b/src/vs/workbench/services/menubar/electron-browser/menubarService.ts @@ -6,6 +6,7 @@ import { IMenubarService } from 'vs/platform/menubar/node/menubar'; import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService'; import { createChannelSender } from 'vs/base/parts/ipc/node/ipc'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; export class MenubarService { @@ -15,3 +16,5 @@ export class MenubarService { return createChannelSender(mainProcessService.getChannel('menubar')); } } + +registerSingleton(IMenubarService, MenubarService, true); diff --git a/src/vs/workbench/services/update/browser/updateService.ts b/src/vs/workbench/services/update/browser/updateService.ts index afdb075fe0b..155fb7fc720 100644 --- a/src/vs/workbench/services/update/browser/updateService.ts +++ b/src/vs/workbench/services/update/browser/updateService.ts @@ -24,7 +24,7 @@ export interface IUpdateProvider { checkForUpdate(): Promise; } -export class UpdateService extends Disposable implements IUpdateService { +export class BrowserUpdateService extends Disposable implements IUpdateService { _serviceBrand: undefined; @@ -92,4 +92,4 @@ export class UpdateService extends Disposable implements IUpdateService { } } -registerSingleton(IUpdateService, UpdateService); +registerSingleton(IUpdateService, BrowserUpdateService); diff --git a/src/vs/platform/update/electron-browser/updateService.ts b/src/vs/workbench/services/update/electron-browser/updateService.ts similarity index 90% rename from src/vs/platform/update/electron-browser/updateService.ts rename to src/vs/workbench/services/update/electron-browser/updateService.ts index 95632dead57..b8f6558b2ca 100644 --- a/src/vs/platform/update/electron-browser/updateService.ts +++ b/src/vs/workbench/services/update/electron-browser/updateService.ts @@ -7,8 +7,9 @@ import { IChannel } from 'vs/base/parts/ipc/common/ipc'; import { Event, Emitter } from 'vs/base/common/event'; import { IUpdateService, State } from 'vs/platform/update/common/update'; import { IMainProcessService } from 'vs/platform/ipc/electron-browser/mainProcessService'; +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -export class UpdateService implements IUpdateService { +export class NativeUpdateService implements IUpdateService { _serviceBrand: undefined; @@ -56,3 +57,5 @@ export class UpdateService implements IUpdateService { return this.channel.call('isLatestVersion'); } } + +registerSingleton(IUpdateService, NativeUpdateService); diff --git a/src/vs/workbench/workbench.desktop.main.ts b/src/vs/workbench/workbench.desktop.main.ts index a69f8d9d3e8..440d4834ffb 100644 --- a/src/vs/workbench/workbench.desktop.main.ts +++ b/src/vs/workbench/workbench.desktop.main.ts @@ -57,21 +57,10 @@ import 'vs/workbench/services/lifecycle/electron-browser/lifecycleService'; import 'vs/workbench/services/sharedProcess/electron-browser/sharedProcessService'; import 'vs/workbench/services/electron/electron-browser/electronService'; import 'vs/workbench/services/localizations/electron-browser/localizationsService'; - -import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ClipboardService } from 'vs/platform/clipboard/electron-browser/clipboardService'; -import { IUpdateService } from 'vs/platform/update/common/update'; -import { UpdateService } from 'vs/platform/update/electron-browser/updateService'; -import { IIssueService } from 'vs/platform/issue/node/issue'; -import { IssueService } from 'vs/platform/issue/electron-browser/issueService'; -import { IMenubarService } from 'vs/platform/menubar/node/menubar'; -import { MenubarService } from 'vs/platform/menubar/electron-browser/menubarService'; - -registerSingleton(IClipboardService, ClipboardService, true); -registerSingleton(IUpdateService, UpdateService); -registerSingleton(IIssueService, IssueService); -registerSingleton(IMenubarService, MenubarService); +import 'vs/workbench/services/clipboard/electron-browser/clipboardService'; +import 'vs/workbench/services/update/electron-browser/updateService'; +import 'vs/workbench/services/issue/electron-browser/issueService'; +import 'vs/workbench/services/menubar/electron-browser/menubarService'; //#endregion diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts index 43a0de2ef1b..1a65c82b0c4 100644 --- a/src/vs/workbench/workbench.web.main.ts +++ b/src/vs/workbench/workbench.web.main.ts @@ -47,10 +47,9 @@ import 'vs/workbench/services/dialogs/browser/fileDialogService'; import 'vs/workbench/services/host/browser/browserHostService'; import 'vs/workbench/services/request/browser/requestService'; import 'vs/workbench/services/lifecycle/browser/lifecycleService'; +import 'vs/workbench/services/clipboard/browser/clipboardService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { BrowserClipboardService } from 'vs/platform/clipboard/browser/clipboardService'; import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility'; import { BrowserAccessibilityService } from 'vs/platform/accessibility/common/accessibilityService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -70,7 +69,6 @@ import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyn registerSingleton(IExtensionManagementService, ExtensionManagementService); registerSingleton(IBackupFileService, BackupFileService); -registerSingleton(IClipboardService, BrowserClipboardService, true); registerSingleton(IAccessibilityService, BrowserAccessibilityService, true); registerSingleton(IContextMenuService, ContextMenuService); registerSingleton(ITunnelService, NoOpTunnelService, true);