diff --git a/src/vs/code/electron-main/env.ts b/src/vs/code/electron-main/env.ts index e8a40ec8c22..1c91df70de9 100644 --- a/src/vs/code/electron-main/env.ts +++ b/src/vs/code/electron-main/env.ts @@ -16,7 +16,7 @@ import * as paths from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; import URI from 'vs/base/common/uri'; import * as types from 'vs/base/common/types'; -import { ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import product, { IProductConfiguration } from 'vs/platform/product'; import { parseArgs } from 'vs/code/node/argv'; import pkg from 'vs/platform/package'; @@ -49,7 +49,7 @@ export interface ICommandLineArguments { export const IEnvironmentService = createDecorator('mainEnvironmentService'); export interface IEnvironmentService { - serviceId: ServiceIdentifier; + _serviceBrand: any; cliArgs: ICommandLineArguments; userExtensionsHome: string; isTestingFromCli: boolean; @@ -84,7 +84,7 @@ function getNumericValue(value: string, defaultValue: number, fallback: number = export class EnvService implements IEnvironmentService { - serviceId = IEnvironmentService; + _serviceBrand: any; private _cliArgs: ICommandLineArguments; get cliArgs(): ICommandLineArguments { return this._cliArgs; } diff --git a/src/vs/code/electron-main/lifecycle.ts b/src/vs/code/electron-main/lifecycle.ts index 0706b6322f4..7e5cecf9b65 100644 --- a/src/vs/code/electron-main/lifecycle.ts +++ b/src/vs/code/electron-main/lifecycle.ts @@ -10,7 +10,7 @@ import { ipcMain as ipc, app } from 'electron'; import { TPromise, TValueCallback } from 'vs/base/common/winjs.base'; import { ReadyState, VSCodeWindow } from 'vs/code/electron-main/window'; import { IEnvironmentService } from 'vs/code/electron-main/env'; -import { ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/code/electron-main/log'; import { IStorageService } from 'vs/code/electron-main/storage'; @@ -21,7 +21,7 @@ const EventTypes = { export const ILifecycleService = createDecorator('lifecycleService'); export interface ILifecycleService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Will be true if an update was applied. Will only be true for each update once. @@ -37,7 +37,7 @@ export interface ILifecycleService { export class LifecycleService implements ILifecycleService { - serviceId = ILifecycleService; + _serviceBrand: any; private static QUIT_FROM_UPDATE_MARKER = 'quit.from.update'; // use a marker to find out if an update was applied in the previous session diff --git a/src/vs/code/electron-main/log.ts b/src/vs/code/electron-main/log.ts index 4422181e104..486b7e0f89b 100644 --- a/src/vs/code/electron-main/log.ts +++ b/src/vs/code/electron-main/log.ts @@ -5,19 +5,19 @@ 'use strict'; -import { ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IEnvironmentService } from 'vs/code/electron-main/env'; export const ILogService = createDecorator('logService'); export interface ILogService { - serviceId: ServiceIdentifier; + _serviceBrand: any; log(...args: any[]): void; } export class MainLogService implements ILogService { - serviceId = ILogService; + _serviceBrand: any; constructor( @IEnvironmentService private envService: IEnvironmentService) { } diff --git a/src/vs/code/electron-main/settings.ts b/src/vs/code/electron-main/settings.ts index ff16a75f3af..fbd4a7cb258 100644 --- a/src/vs/code/electron-main/settings.ts +++ b/src/vs/code/electron-main/settings.ts @@ -6,7 +6,7 @@ 'use strict'; import { app } from 'electron'; -import { ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { UserSettings, ISettings } from 'vs/workbench/node/userSettings'; import { IEnvironmentService } from 'vs/code/electron-main/env'; import Event from 'vs/base/common/event'; @@ -14,7 +14,7 @@ import Event from 'vs/base/common/event'; export const ISettingsService = createDecorator('settingsService'); export interface ISettingsService { - serviceId: ServiceIdentifier; + _serviceBrand: any; globalSettings: ISettings; loadSync(): boolean; getValue(key: string, fallback?: T): T; @@ -23,7 +23,7 @@ export interface ISettingsService { export class SettingsManager extends UserSettings implements ISettingsService { - serviceId = ISettingsService; + _serviceBrand: any; constructor(@IEnvironmentService envService: IEnvironmentService) { super(envService.appSettingsPath, envService.appKeybindingsPath); diff --git a/src/vs/code/electron-main/storage.ts b/src/vs/code/electron-main/storage.ts index 8868f63d326..3bebf56b370 100644 --- a/src/vs/code/electron-main/storage.ts +++ b/src/vs/code/electron-main/storage.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import * as fs from 'original-fs'; import { EventEmitter } from 'events'; import { IEnvironmentService } from 'vs/code/electron-main/env'; -import { ServiceIdentifier, createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; const EventTypes = { STORE: 'store' @@ -18,7 +18,7 @@ const EventTypes = { export const IStorageService = createDecorator('storageService'); export interface IStorageService { - serviceId: ServiceIdentifier; + _serviceBrand: any; onStore(clb: (key: string, oldValue: T, newValue: T) => void): () => void; getItem(key: string, defaultValue?: T): T; setItem(key: string, data: any): void; @@ -27,7 +27,7 @@ export interface IStorageService { export class StorageService implements IStorageService { - serviceId = IStorageService; + _serviceBrand: any; private dbPath: string; private database: any = null; diff --git a/src/vs/code/electron-main/update-manager.ts b/src/vs/code/electron-main/update-manager.ts index e0b416b1214..d83fd0828c4 100644 --- a/src/vs/code/electron-main/update-manager.ts +++ b/src/vs/code/electron-main/update-manager.ts @@ -15,7 +15,7 @@ import { ISettingsService } from 'vs/code/electron-main/settings'; import { Win32AutoUpdaterImpl } from 'vs/code/electron-main/auto-updater.win32'; import { LinuxAutoUpdaterImpl } from 'vs/code/electron-main/auto-updater.linux'; import { ILifecycleService } from 'vs/code/electron-main/lifecycle'; -import { ServiceIdentifier, createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; export enum State { Uninitialized, @@ -45,7 +45,7 @@ interface IAutoUpdater extends NodeJS.EventEmitter { export const IUpdateService = createDecorator('updateService'); export interface IUpdateService { - serviceId: ServiceIdentifier; + _serviceBrand: any; feedUrl: string; channel: string; initialize(): void; @@ -58,7 +58,7 @@ export interface IUpdateService { export class UpdateManager extends EventEmitter implements IUpdateService { - serviceId = IUpdateService; + _serviceBrand: any; private _state: State; private explicitState: ExplicitState; diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 98e8c379e6c..0c7e1e876dd 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -22,7 +22,7 @@ import { ILifecycleService } from 'vs/code/electron-main/lifecycle'; import { ISettingsService } from 'vs/code/electron-main/settings'; import { IUpdateService, IUpdate } from 'vs/code/electron-main/update-manager'; import { ILogService } from 'vs/code/electron-main/log'; -import { ServiceIdentifier, createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; const EventTypes = { OPEN: 'open', @@ -83,7 +83,7 @@ const ReopenFoldersSetting = { export const IWindowsService = createDecorator('windowsService'); export interface IWindowsService { - serviceId: ServiceIdentifier; + _serviceBrand: any; // TODO make proper events // events @@ -113,7 +113,7 @@ export interface IWindowsService { export class WindowsManager implements IWindowsService { - serviceId = IWindowsService; + _serviceBrand: any; public static openedPathsListStorageKey = 'openedPathsList'; diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/browser/standalone/simpleServices.ts index b61a1f3a74d..9229bb61bed 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/browser/standalone/simpleServices.ts @@ -73,7 +73,7 @@ export interface IOpenEditorDelegate { } export class SimpleEditorService implements IEditorService { - public serviceId = IEditorService; + public _serviceBrand: any; private editor:SimpleEditor; private openEditorDelegate:IOpenEditorDelegate; @@ -164,7 +164,7 @@ export class SimpleEditorService implements IEditorService { } export class SimpleMessageService implements IMessageService { - public serviceId = IMessageService; + public _serviceBrand: any; private static Empty = function() { /* nothing */}; diff --git a/src/vs/editor/common/services/abstractCodeEditorService.ts b/src/vs/editor/common/services/abstractCodeEditorService.ts index fe3c86fece7..ab2ea9a4690 100644 --- a/src/vs/editor/common/services/abstractCodeEditorService.ts +++ b/src/vs/editor/common/services/abstractCodeEditorService.ts @@ -9,7 +9,7 @@ import {ICommonCodeEditor, IDecorationRenderOptions, IModelDecorationOptions} fr import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; export abstract class AbstractCodeEditorService implements ICodeEditorService { - public serviceId = ICodeEditorService; + public _serviceBrand: any; private _onCodeEditorAdd: Emitter; private _onCodeEditorRemove: Emitter; private _codeEditors: { diff --git a/src/vs/editor/common/services/codeEditorService.ts b/src/vs/editor/common/services/codeEditorService.ts index a471839c81e..43f8b235c8c 100644 --- a/src/vs/editor/common/services/codeEditorService.ts +++ b/src/vs/editor/common/services/codeEditorService.ts @@ -5,14 +5,14 @@ 'use strict'; import Event from 'vs/base/common/event'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {ICommonCodeEditor, IDecorationRenderOptions, IModelDecorationOptions} from 'vs/editor/common/editorCommon'; export var ID_CODE_EDITOR_SERVICE = 'codeEditorService'; export var ICodeEditorService = createDecorator(ID_CODE_EDITOR_SERVICE); export interface ICodeEditorService { - serviceId: ServiceIdentifier; + _serviceBrand: any; addCodeEditor(editor: ICommonCodeEditor): void; onCodeEditorAdd: Event; diff --git a/src/vs/editor/common/services/compatWorkerService.ts b/src/vs/editor/common/services/compatWorkerService.ts index 4edb621d8a8..3daf2531866 100644 --- a/src/vs/editor/common/services/compatWorkerService.ts +++ b/src/vs/editor/common/services/compatWorkerService.ts @@ -6,7 +6,7 @@ import URI from 'vs/base/common/uri'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IRawText} from 'vs/editor/common/editorCommon'; export var ICompatWorkerService = createDecorator('compatWorkerService'); @@ -24,7 +24,7 @@ export interface ICompatMode { } export interface ICompatWorkerService { - serviceId: ServiceIdentifier; + _serviceBrand: any; isInMainThread: boolean; registerCompatMode(compatMode:ICompatMode): void; CompatWorker(obj: ICompatMode, methodName: string, target: Function, param: any[]): TPromise; diff --git a/src/vs/editor/common/services/compatWorkerServiceMain.ts b/src/vs/editor/common/services/compatWorkerServiceMain.ts index 77bf8c60c06..cd27ec84904 100644 --- a/src/vs/editor/common/services/compatWorkerServiceMain.ts +++ b/src/vs/editor/common/services/compatWorkerServiceMain.ts @@ -14,7 +14,7 @@ import {IModelService} from 'vs/editor/common/services/modelService'; import {ModesRegistry} from 'vs/editor/common/modes/modesRegistry'; export class MainThreadCompatWorkerService implements ICompatWorkerService { - public serviceId = ICompatWorkerService; + public _serviceBrand: any; public isInMainThread = true; private _workerFactory: DefaultWorkerFactory; diff --git a/src/vs/editor/common/services/compatWorkerServiceWorker.ts b/src/vs/editor/common/services/compatWorkerServiceWorker.ts index 7ec2f164868..4a6b65b6b82 100644 --- a/src/vs/editor/common/services/compatWorkerServiceWorker.ts +++ b/src/vs/editor/common/services/compatWorkerServiceWorker.ts @@ -14,7 +14,7 @@ import URI from 'vs/base/common/uri'; import {ILegacyLanguageDefinition, ModesRegistry} from 'vs/editor/common/modes/modesRegistry'; export class CompatWorkerServiceWorker implements ICompatWorkerService { - public serviceId = ICompatWorkerService; + public _serviceBrand: any; public isInMainThread = false; private _compatModes: {[modeId:string]:ICompatMode;}; diff --git a/src/vs/editor/common/services/editorWorkerService.ts b/src/vs/editor/common/services/editorWorkerService.ts index 6cbfa91500e..7f4594e6129 100644 --- a/src/vs/editor/common/services/editorWorkerService.ts +++ b/src/vs/editor/common/services/editorWorkerService.ts @@ -6,7 +6,7 @@ import URI from 'vs/base/common/uri'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IChange, ILineChange, IPosition, IRange} from 'vs/editor/common/editorCommon'; import {IInplaceReplaceSupportResult, ILink, ISuggestResult} from 'vs/editor/common/modes'; @@ -14,7 +14,7 @@ export var ID_EDITOR_WORKER_SERVICE = 'editorWorkerService'; export var IEditorWorkerService = createDecorator(ID_EDITOR_WORKER_SERVICE); export interface IEditorWorkerService { - serviceId: ServiceIdentifier; + _serviceBrand: any; computeDiff(original:URI, modified:URI, ignoreTrimWhitespace:boolean):TPromise; computeDirtyDiff(original:URI, modified:URI, ignoreTrimWhitespace:boolean):TPromise; diff --git a/src/vs/editor/common/services/editorWorkerServiceImpl.ts b/src/vs/editor/common/services/editorWorkerServiceImpl.ts index cf42492d14b..3616b833aec 100644 --- a/src/vs/editor/common/services/editorWorkerServiceImpl.ts +++ b/src/vs/editor/common/services/editorWorkerServiceImpl.ts @@ -29,7 +29,7 @@ const STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1000; const STOP_WORKER_DELTA_TIME_MS = 5 * 60 * 1000; export class EditorWorkerServiceImpl implements IEditorWorkerService { - public serviceId = IEditorWorkerService; + public _serviceBrand: any; private _workerManager:WorkerManager; diff --git a/src/vs/editor/common/services/modeService.ts b/src/vs/editor/common/services/modeService.ts index a87cd68400b..61fdb6ec1e6 100644 --- a/src/vs/editor/common/services/modeService.ts +++ b/src/vs/editor/common/services/modeService.ts @@ -7,7 +7,7 @@ import Event from 'vs/base/common/event'; import {IDisposable} from 'vs/base/common/lifecycle'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import * as modes from 'vs/editor/common/modes'; export var IModeService = createDecorator('modeService'); @@ -40,7 +40,7 @@ export interface IValidLanguageExtensionPoint { } export interface IModeService { - serviceId: ServiceIdentifier; + _serviceBrand: any; onDidAddModes: Event; onDidCreateMode: Event; diff --git a/src/vs/editor/common/services/modeServiceImpl.ts b/src/vs/editor/common/services/modeServiceImpl.ts index dba750ad079..8ed2e15bce8 100644 --- a/src/vs/editor/common/services/modeServiceImpl.ts +++ b/src/vs/editor/common/services/modeServiceImpl.ts @@ -135,7 +135,7 @@ function isValidLanguageExtensionPoint(value:ILanguageExtensionPoint, collector: } export class ModeServiceImpl implements IModeService { - public serviceId = IModeService; + public _serviceBrand: any; private _instantiationService: IInstantiationService; protected _extensionService: IExtensionService; diff --git a/src/vs/editor/common/services/modelService.ts b/src/vs/editor/common/services/modelService.ts index d1942ea7886..fb9fe23b25a 100644 --- a/src/vs/editor/common/services/modelService.ts +++ b/src/vs/editor/common/services/modelService.ts @@ -7,14 +7,14 @@ import Event from 'vs/base/common/event'; import URI from 'vs/base/common/uri'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IModel, IRawText, ITextModelCreationOptions} from 'vs/editor/common/editorCommon'; import {IMode} from 'vs/editor/common/modes'; export var IModelService = createDecorator('modelService'); export interface IModelService { - serviceId: ServiceIdentifier; + _serviceBrand: any; createModel(value:string | IRawText, modeOrPromise:TPromise|IMode, resource: URI): IModel; diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 25c169eb5bb..0afa95dc30e 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -179,7 +179,7 @@ interface IRawConfig { } export class ModelServiceImpl implements IModelService { - public serviceId = IModelService; + public _serviceBrand: any; private _markerService: IMarkerService; private _markerServiceSubscription: IDisposable; diff --git a/src/vs/editor/common/services/resourceService.ts b/src/vs/editor/common/services/resourceService.ts index 9511dd6b1ec..6df8422b685 100644 --- a/src/vs/editor/common/services/resourceService.ts +++ b/src/vs/editor/common/services/resourceService.ts @@ -7,7 +7,7 @@ import {EmitterEvent, ListenerCallback} from 'vs/base/common/eventEmitter'; import {IDisposable} from 'vs/base/common/lifecycle'; import URI from 'vs/base/common/uri'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IMirrorModel} from 'vs/editor/common/editorCommon'; // Resource Service @@ -36,7 +36,7 @@ export interface IResourceChangedEvent { export var IResourceService = createDecorator('resourceService'); export interface IResourceService { - serviceId: ServiceIdentifier; + _serviceBrand: any; insert(url: URI, element: IMirrorModel): void; get(url: URI): IMirrorModel; all(): IMirrorModel[]; diff --git a/src/vs/editor/common/services/resourceServiceImpl.ts b/src/vs/editor/common/services/resourceServiceImpl.ts index 8cc3a8856bd..7270ffe5c49 100644 --- a/src/vs/editor/common/services/resourceServiceImpl.ts +++ b/src/vs/editor/common/services/resourceServiceImpl.ts @@ -11,7 +11,7 @@ import {IMirrorModel} from 'vs/editor/common/editorCommon'; import {IResourceAddedEvent, IResourceChangedEvent, IResourceRemovedEvent, IResourceService, ResourceEvents} from 'vs/editor/common/services/resourceService'; export class ResourceService extends EventEmitter implements IResourceService { - public serviceId = IResourceService; + public _serviceBrand: any; private data:{[url:string]:IMirrorModel;}; private unbinds:{[url:string]:IDisposable[];}; diff --git a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts index 560c61e51d5..94f509366cb 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts @@ -13,7 +13,7 @@ import {$} from 'vs/base/browser/builder'; import Event, {Emitter} from 'vs/base/common/event'; import * as dom from 'vs/base/browser/dom'; import {ActionBar} from 'vs/base/browser/ui/actionbar/actionbar'; -import {ServiceIdentifier, ServicesAccessor, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {ServicesAccessor, createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {ICommonCodeEditor} from 'vs/editor/common/editorCommon'; import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService'; import {ICodeEditor} from 'vs/editor/browser/editorBrowser'; @@ -23,7 +23,7 @@ import {EmbeddedCodeEditorWidget} from 'vs/editor/browser/widget/embeddedCodeEdi export var IPeekViewService = createDecorator('peekViewService'); export interface IPeekViewService { - serviceId: ServiceIdentifier; + _serviceBrand: any; isActive: boolean; contextKey: string; } @@ -38,7 +38,7 @@ export function getOuterEditor(accessor: ServicesAccessor, args: any): ICommonCo export class PeekViewWidget extends ZoneWidget implements IPeekViewService { - public serviceId = IPeekViewService; + public _serviceBrand: any; public contextKey: string; private _onDidClose = new Emitter(); diff --git a/src/vs/editor/test/common/mocks/mockModeService.ts b/src/vs/editor/test/common/mocks/mockModeService.ts index 0d30bed0e18..d6caead6051 100644 --- a/src/vs/editor/test/common/mocks/mockModeService.ts +++ b/src/vs/editor/test/common/mocks/mockModeService.ts @@ -7,12 +7,11 @@ import Event from 'vs/base/common/event'; import {IDisposable} from 'vs/base/common/lifecycle'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; import * as modes from 'vs/editor/common/modes'; import {IModeService, IModeLookupResult} from 'vs/editor/common/services/modeService'; export class MockModeService implements IModeService { - serviceId: ServiceIdentifier = IModeService; + _serviceBrand: any; onDidAddModes: Event = undefined; onDidCreateMode: Event = undefined; diff --git a/src/vs/platform/actions/browser/menuService.ts b/src/vs/platform/actions/browser/menuService.ts index 2d91036540c..d473249eb8e 100644 --- a/src/vs/platform/actions/browser/menuService.ts +++ b/src/vs/platform/actions/browser/menuService.ts @@ -56,7 +56,7 @@ export const MenuRegistry: IMenuRegistry = _registry; export class MenuService implements IMenuService { - serviceId = IMenuService; + _serviceBrand: any; constructor( @IExtensionService private _extensionService: IExtensionService, diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 0308c7c8e05..c56e7bdfe06 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -44,7 +44,7 @@ export const IMenuService = createDecorator('menuService'); export interface IMenuService { - serviceId: any; + _serviceBrand: any; createMenu(id: MenuId, scopedKeybindingService: IKeybindingService): IMenu; diff --git a/src/vs/platform/commands/common/commandService.ts b/src/vs/platform/commands/common/commandService.ts index 2821e462d41..d8cf7ea4df7 100644 --- a/src/vs/platform/commands/common/commandService.ts +++ b/src/vs/platform/commands/common/commandService.ts @@ -11,7 +11,7 @@ import {IExtensionService} from 'vs/platform/extensions/common/extensions'; export class CommandService implements ICommandService { - serviceId = ICommandService; + _serviceBrand: any; constructor( @IInstantiationService private _instantiationService: IInstantiationService, diff --git a/src/vs/platform/commands/common/commands.ts b/src/vs/platform/commands/common/commands.ts index 1c4542c9595..4e91a8a59a7 100644 --- a/src/vs/platform/commands/common/commands.ts +++ b/src/vs/platform/commands/common/commands.ts @@ -6,12 +6,12 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {TypeConstraint, validateConstraints} from 'vs/base/common/types'; -import {ServicesAccessor, createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {ServicesAccessor, createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const ICommandService = createDecorator('commandService'); export interface ICommandService { - serviceId: ServiceIdentifier; + _serviceBrand: any; executeCommand(commandId: string, ...args: any[]): TPromise; executeCommand(commandId: string, ...args: any[]): TPromise; isKnownCommand(commandId: string): boolean; @@ -97,7 +97,7 @@ export const CommandsRegistry: ICommandRegistry = new class implements ICommandR }; export const NullCommandService: ICommandService = { - serviceId: undefined, + _serviceBrand: undefined, executeCommand() { return TPromise.as(undefined); }, diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 44e9311448a..c6d97c0bd04 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; import {TPromise} from 'vs/base/common/winjs.base'; import {JSONPath} from 'vs/base/common/json'; @@ -11,7 +11,7 @@ import {JSONPath} from 'vs/base/common/json'; export const IConfigurationService = createDecorator('configurationService'); export interface IConfigurationService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Fetches the appropriate section of the configuration JSON file. diff --git a/src/vs/platform/configuration/common/configurationService.ts b/src/vs/platform/configuration/common/configurationService.ts index 68b557b8f2b..2f6b61ee570 100644 --- a/src/vs/platform/configuration/common/configurationService.ts +++ b/src/vs/platform/configuration/common/configurationService.ts @@ -43,7 +43,7 @@ interface ILoadConfigResult { export abstract class ConfigurationService implements IConfigurationService, IDisposable { - public serviceId = IConfigurationService; + public _serviceBrand: any; private static RELOAD_CONFIGURATION_DELAY = 50; diff --git a/src/vs/platform/configuration/node/nodeConfigurationService.ts b/src/vs/platform/configuration/node/nodeConfigurationService.ts index f99da02cb0d..e007ada83cf 100644 --- a/src/vs/platform/configuration/node/nodeConfigurationService.ts +++ b/src/vs/platform/configuration/node/nodeConfigurationService.ts @@ -28,7 +28,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' */ export class NodeConfigurationService implements IConfigurationService, IDisposable { - serviceId = IConfigurationService; + _serviceBrand: any; private configurationPath: string; private watcher: FSWatcher; diff --git a/src/vs/platform/contextview/browser/contextMenuService.ts b/src/vs/platform/contextview/browser/contextMenuService.ts index a9a277a26d8..4b5d397afba 100644 --- a/src/vs/platform/contextview/browser/contextMenuService.ts +++ b/src/vs/platform/contextview/browser/contextMenuService.ts @@ -10,7 +10,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IMessageService} from 'vs/platform/message/common/message'; export class ContextMenuService implements IContextMenuService { - public serviceId = IContextMenuService; + public _serviceBrand: any; private contextMenuHandler: ContextMenuHandler; diff --git a/src/vs/platform/contextview/browser/contextView.ts b/src/vs/platform/contextview/browser/contextView.ts index 4e2a195f877..5e4b770abd9 100644 --- a/src/vs/platform/contextview/browser/contextView.ts +++ b/src/vs/platform/contextview/browser/contextView.ts @@ -9,12 +9,12 @@ import { IAction } from 'vs/base/common/actions'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { TPromise } from 'vs/base/common/winjs.base'; import { Keybinding } from 'vs/base/common/keyCodes'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const IContextViewService = createDecorator('contextViewService'); export interface IContextViewService { - serviceId: ServiceIdentifier; + _serviceBrand: any; showContextView(delegate: IContextViewDelegate): void; hideContextView(data?: any): void; layout(): void; @@ -31,7 +31,7 @@ export interface IContextViewDelegate { export const IContextMenuService = createDecorator('contextMenuService'); export interface IContextMenuService { - serviceId: ServiceIdentifier; + _serviceBrand: any; showContextMenu(delegate: IContextMenuDelegate): void; } diff --git a/src/vs/platform/contextview/browser/contextViewService.ts b/src/vs/platform/contextview/browser/contextViewService.ts index 533652568ce..ef50a494742 100644 --- a/src/vs/platform/contextview/browser/contextViewService.ts +++ b/src/vs/platform/contextview/browser/contextViewService.ts @@ -10,7 +10,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IMessageService} from 'vs/platform/message/common/message'; export class ContextViewService implements IContextViewService { - public serviceId = IContextViewService; + public _serviceBrand: any; private contextView: ContextView; diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index c482f5eefa2..6f37147f6a8 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -7,13 +7,12 @@ import URI from 'vs/base/common/uri'; import {TPromise} from 'vs/base/common/winjs.base'; import {IEventEmitter} from 'vs/base/common/eventEmitter'; - -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IEditorService = createDecorator('editorService'); export interface IEditorService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Specific overload to open an instance of IResourceInput. */ diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index 9a264c4fcf3..8855776d914 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -3,12 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const IEnvironmentService = createDecorator('environmentService'); export interface IEnvironmentService { - serviceId: ServiceIdentifier; + _serviceBrand: any; appRoot: string; userDataPath: string; diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 38fb024150f..f0c7100c607 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -14,7 +14,7 @@ import URI from 'vs/base/common/uri'; export class EnvironmentService implements IEnvironmentService { - serviceId = IEnvironmentService; + _serviceBrand: any; private _appRoot: string; get appRoot(): string { return this._appRoot; } diff --git a/src/vs/platform/event/common/event.ts b/src/vs/platform/event/common/event.ts index 75a865648d2..7414a671133 100644 --- a/src/vs/platform/event/common/event.ts +++ b/src/vs/platform/event/common/event.ts @@ -6,12 +6,12 @@ import {IEventEmitter} from 'vs/base/common/eventEmitter'; import {IDisposable} from 'vs/base/common/lifecycle'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IEventService = createDecorator('eventService'); export interface IEventService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Allows to add a listener to the platform event bus for all emitters that are known to the platform. diff --git a/src/vs/platform/event/common/eventService.ts b/src/vs/platform/event/common/eventService.ts index db8892c80c7..b0e23e28cd7 100644 --- a/src/vs/platform/event/common/eventService.ts +++ b/src/vs/platform/event/common/eventService.ts @@ -10,7 +10,7 @@ import {IEventService} from './event'; // --- implementation ------------------------------------------ export class EventService extends EventEmitter implements IEventService { - public serviceId = IEventService; + public _serviceBrand: any; constructor() { super(); } diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 3b6999979c4..7af6e0625a2 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -9,7 +9,7 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export interface IExtensionManifest { name: string; @@ -94,7 +94,7 @@ export interface IQueryOptions { } export interface IExtensionGalleryService { - serviceId: ServiceIdentifier; + _serviceBrand: any; isEnabled(): boolean; query(options?: IQueryOptions): TPromise>; } @@ -103,7 +103,7 @@ export type InstallExtensionEvent = { id: string; gallery?: IGalleryExtension; } export type DidInstallExtensionEvent = { id: string; local?: ILocalExtension; error?: Error; }; export interface IExtensionManagementService { - serviceId: ServiceIdentifier; + _serviceBrand: any; onInstallExtension: Event; onDidInstallExtension: Event; @@ -119,7 +119,7 @@ export interface IExtensionManagementService { export const IExtensionTipsService = createDecorator('extensionTipsService'); export interface IExtensionTipsService { - serviceId: ServiceIdentifier; + _serviceBrand: any; getRecommendations(): TPromise; } diff --git a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts index c4f4c7bcca8..62f63ecbfc6 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts @@ -40,7 +40,7 @@ export class ExtensionManagementChannel implements IExtensionManagementChannel { export class ExtensionManagementChannelClient implements IExtensionManagementService { - serviceId = IExtensionManagementService; + _serviceBrand: any; constructor(private channel: IExtensionManagementChannel) { } diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 054ad3ecf23..57cd1542e15 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -173,7 +173,7 @@ function toExtension(galleryExtension: IRawGalleryExtension, extensionsGalleryUr export class ExtensionGalleryService implements IExtensionGalleryService { - serviceId = IExtensionGalleryService; + _serviceBrand: any; private extensionsGalleryUrl: string; private machineId: TPromise; diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index 018654e943a..62bf1e0dad7 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -68,7 +68,7 @@ function getExtensionId(extension: IExtensionIdentity, version: string): string export class ExtensionManagementService implements IExtensionManagementService { - serviceId = IExtensionManagementService; + _serviceBrand: any; private extensionsPath: string; private obsoletePath: string; diff --git a/src/vs/platform/extensions/common/abstractExtensionService.ts b/src/vs/platform/extensions/common/abstractExtensionService.ts index 962966bc918..512472df7f7 100644 --- a/src/vs/platform/extensions/common/abstractExtensionService.ts +++ b/src/vs/platform/extensions/common/abstractExtensionService.ts @@ -29,7 +29,7 @@ interface IActivatingExtensionMap { } export abstract class AbstractExtensionService implements IExtensionService { - public serviceId = IExtensionService; + public _serviceBrand: any; private _activatingExtensions: IActivatingExtensionMap; protected _activatedExtensions: IActivatedExtensionMap; diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts index 0741c970f3b..b7b987d7b66 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts @@ -6,7 +6,7 @@ import Severity from 'vs/base/common/severity'; import {TPromise} from 'vs/base/common/winjs.base'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export interface IExtensionDescription { id: string; @@ -45,7 +45,7 @@ export interface IExtensionsStatus { } export interface IExtensionService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Send an activation event and activate interested extensions. diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 29968a4d62b..20c76107215 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -9,12 +9,12 @@ import paths = require('vs/base/common/paths'); import URI from 'vs/base/common/uri'; import glob = require('vs/base/common/glob'); import events = require('vs/base/common/events'); -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IFileService = createDecorator('fileService'); export interface IFileService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Resolve the properties of a file identified by the resource. diff --git a/src/vs/platform/instantiation/common/instantiation.ts b/src/vs/platform/instantiation/common/instantiation.ts index 5b5be379e3b..929ffd2527e 100644 --- a/src/vs/platform/instantiation/common/instantiation.ts +++ b/src/vs/platform/instantiation/common/instantiation.ts @@ -23,39 +23,39 @@ export namespace _util { // --- interfaces ------ export interface IConstructorSignature0 { - new (...services: { serviceId: ServiceIdentifier; }[]): T; + new (...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature1 { - new (first: A1, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature2 { - new (first: A1, second: A2, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature3 { - new (first: A1, second: A2, third: A3, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature4 { - new (first: A1, second: A2, third: A3, forth: A4, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, forth: A4, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature5 { - new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature6 { - new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature7 { - new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, seventh: A7, ...services: { _serviceBrand: any; }[]): T; } export interface IConstructorSignature8 { - new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { serviceId: ServiceIdentifier; }[]): T; + new (first: A1, second: A2, third: A3, forth: A4, fifth: A5, sixth: A6, seventh: A7, eigth: A8, ...services: { _serviceBrand: any; }[]): T; } export interface ServicesAccessor { @@ -102,7 +102,7 @@ export var IInstantiationService = createDecorator('insta export interface IInstantiationService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Synchronously creates an instance that is denoted by diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index 37ede2ed3f6..2f23db41278 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -16,7 +16,7 @@ import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollect export class InstantiationService implements IInstantiationService { - serviceId: any; + _serviceBrand: any; private _services: ServiceCollection; private _strict: boolean; diff --git a/src/vs/platform/instantiation/test/common/instantiationService.test.ts b/src/vs/platform/instantiation/test/common/instantiationService.test.ts index 1214a2c5e2b..e5afd0f39eb 100644 --- a/src/vs/platform/instantiation/test/common/instantiationService.test.ts +++ b/src/vs/platform/instantiation/test/common/instantiationService.test.ts @@ -6,7 +6,7 @@ import assert = require('assert'); -import {createDecorator, optional, ServiceIdentifier, ServicesAccessor} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator, optional, ServicesAccessor} from 'vs/platform/instantiation/common/instantiation'; import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService'; import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection'; import {SyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; @@ -14,48 +14,48 @@ import {SyncDescriptor} from 'vs/platform/instantiation/common/descriptors'; let IService1 = createDecorator('service1'); interface IService1 { - serviceId: ServiceIdentifier; + _serviceBrand: any; c: number; } class Service1 implements IService1 { - serviceId = IService1; + _serviceBrand: any; c = 1; } let IService2 = createDecorator('service2'); interface IService2 { - serviceId: ServiceIdentifier; + _serviceBrand: any; d: boolean; } class Service2 implements IService2 { - serviceId = IService2; + _serviceBrand: any; d = true; } let IService3 = createDecorator('service3'); interface IService3 { - serviceId: ServiceIdentifier; + _serviceBrand: any; s: string; } class Service3 implements IService3 { - serviceId = IService3; + _serviceBrand: any; s = 'farboo'; } let IDependentService = createDecorator('dependentService'); interface IDependentService { - serviceId: ServiceIdentifier; + _serviceBrand: any; name: string; } class DependentService implements IDependentService { - serviceId = IDependentService; + _serviceBrand: any; constructor( @IService1 service: IService1) { assert.equal(service.c, 1); } @@ -118,7 +118,7 @@ class DependentServiceTarget2 { class ServiceLoop1 implements IService1 { - serviceId = IService1; + _serviceBrand: any; c = 1; constructor( @IService2 s: IService2) { @@ -127,7 +127,7 @@ class ServiceLoop1 implements IService1 { } class ServiceLoop2 implements IService2 { - serviceId = IService2; + _serviceBrand: any; d = true; constructor( @IService1 s: IService1) { @@ -366,7 +366,7 @@ suite('Instantiation Service', () => { let serviceInstanceCount = 0; const CtorCounter = class implements Service1 { - serviceId: any; + _serviceBrand: any; c = 1; constructor() { serviceInstanceCount += 1; diff --git a/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts b/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts index 65a56475886..b0470f3ed74 100644 --- a/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts +++ b/src/vs/platform/keybinding/browser/keybindingServiceImpl.ts @@ -144,7 +144,7 @@ class KeybindingContextKey implements IKeybindingContextKey { } export abstract class AbstractKeybindingService { - public serviceId = IKeybindingService; + public _serviceBrand: any; protected _onDidChangeContext: Event; protected _onDidChangeContextKey: Emitter; diff --git a/src/vs/platform/keybinding/common/keybinding.ts b/src/vs/platform/keybinding/common/keybinding.ts index 2437b1e04b2..1e562eb1daa 100644 --- a/src/vs/platform/keybinding/common/keybinding.ts +++ b/src/vs/platform/keybinding/common/keybinding.ts @@ -6,7 +6,7 @@ import {IHTMLContentElement} from 'vs/base/common/htmlContent'; import {Keybinding} from 'vs/base/common/keyCodes'; -import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; export interface IUserFriendlyKeybinding { @@ -447,7 +447,7 @@ export interface IKeybindingScopeLocation { } export interface IKeybindingService { - serviceId: ServiceIdentifier; + _serviceBrand: any; dispose(): void; onDidChangeContext: Event; diff --git a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts index 2610f846bc2..9f5ca42975b 100644 --- a/src/vs/platform/keybinding/test/common/mockKeybindingService.ts +++ b/src/vs/platform/keybinding/test/common/mockKeybindingService.ts @@ -30,7 +30,7 @@ class MockKeybindingContextKey implements IKeybindingContextKey { } export class MockKeybindingService implements IKeybindingService { - public serviceId = IKeybindingService; + public _serviceBrand: any; public dispose(): void { } diff --git a/src/vs/platform/lifecycle/common/lifecycle.ts b/src/vs/platform/lifecycle/common/lifecycle.ts index 5c6b4a06b5e..881196ef1fe 100644 --- a/src/vs/platform/lifecycle/common/lifecycle.ts +++ b/src/vs/platform/lifecycle/common/lifecycle.ts @@ -6,7 +6,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const ILifecycleService = createDecorator('lifecycleService'); @@ -30,7 +30,7 @@ export interface ShutdownEvent { */ export interface ILifecycleService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Fired before shutdown happens. Allows listeners to veto against the @@ -46,7 +46,7 @@ export interface ILifecycleService { } export const NullLifecycleService: ILifecycleService = { - serviceId: null, + _serviceBrand: null, onWillShutdown: () => ({ dispose() { } }), onShutdown: () => ({ dispose() { } }) }; diff --git a/src/vs/platform/markers/common/markerService.ts b/src/vs/platform/markers/common/markerService.ts index 676a9b4aada..901d85a0abd 100644 --- a/src/vs/platform/markers/common/markerService.ts +++ b/src/vs/platform/markers/common/markerService.ts @@ -49,7 +49,7 @@ export interface MarkerData { export class MarkerService implements IMarkerService { - public serviceId = IMarkerService; + public _serviceBrand: any; private _data: { [k: string]: IMarkerData[] }; private _stats: MarkerStatistics; private _onMarkerChanged: Emitter; diff --git a/src/vs/platform/markers/common/markers.ts b/src/vs/platform/markers/common/markers.ts index 37d55dcd0b4..0ef242407a7 100644 --- a/src/vs/platform/markers/common/markers.ts +++ b/src/vs/platform/markers/common/markers.ts @@ -7,12 +7,12 @@ import URI from 'vs/base/common/uri'; import Severity from 'vs/base/common/severity'; import Event from 'vs/base/common/event'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IMarkerService = createDecorator('markerService'); export interface IMarkerService { - serviceId: ServiceIdentifier; + _serviceBrand: any; getStatistics(): MarkerStatistics; diff --git a/src/vs/platform/message/common/message.ts b/src/vs/platform/message/common/message.ts index 1fdb81b59d3..ae1f2356407 100644 --- a/src/vs/platform/message/common/message.ts +++ b/src/vs/platform/message/common/message.ts @@ -7,7 +7,7 @@ import nls = require('vs/nls'); import {TPromise} from 'vs/base/common/winjs.base'; import Severity from 'vs/base/common/severity'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {Action} from 'vs/base/common/actions'; export interface IMessageWithAction { @@ -29,7 +29,7 @@ export const CancelAction = new Action('close.message', nls.localize('cancel', " export const IMessageService = createDecorator('messageService'); export interface IMessageService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Tells the service to show a message with a given severity diff --git a/src/vs/platform/opener/common/opener.ts b/src/vs/platform/opener/common/opener.ts index ad6fcf4862d..046b4f53a63 100644 --- a/src/vs/platform/opener/common/opener.ts +++ b/src/vs/platform/opener/common/opener.ts @@ -13,7 +13,7 @@ export const IOpenerService = createDecorator('openerService'); export interface IOpenerService { - serviceId: any; + _serviceBrand: any; /** * Opens a resource, like a webadress, a document uri, or executes command. @@ -25,6 +25,6 @@ export interface IOpenerService { } export const NullOpenerService: IOpenerService = Object.freeze({ - serviceId: undefined, + _serviceBrand: undefined, open() { return TPromise.as(undefined);} }); diff --git a/src/vs/platform/opener/electron-browser/openerService.ts b/src/vs/platform/opener/electron-browser/openerService.ts index e55b42daddb..ddcd9eca50b 100644 --- a/src/vs/platform/opener/electron-browser/openerService.ts +++ b/src/vs/platform/opener/electron-browser/openerService.ts @@ -14,7 +14,7 @@ import {IOpenerService} from '../common/opener'; export class OpenerService implements IOpenerService { - serviceId: any; + _serviceBrand: any; constructor( @IEditorService private _editorService: IEditorService, diff --git a/src/vs/platform/progress/common/progress.ts b/src/vs/platform/progress/common/progress.ts index 3ec8dc199ca..97d556cc152 100644 --- a/src/vs/platform/progress/common/progress.ts +++ b/src/vs/platform/progress/common/progress.ts @@ -5,12 +5,12 @@ 'use strict'; import {TPromise} from 'vs/base/common/winjs.base'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IProgressService = createDecorator('progressService'); export interface IProgressService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Show progress customized with the provided flags. diff --git a/src/vs/platform/request/common/baseRequestService.ts b/src/vs/platform/request/common/baseRequestService.ts index 13843808f9d..98f34a91509 100644 --- a/src/vs/platform/request/common/baseRequestService.ts +++ b/src/vs/platform/request/common/baseRequestService.ts @@ -21,7 +21,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; * between different layers of the platform. */ export class BaseRequestService implements IRequestService { - public serviceId = IRequestService; + public _serviceBrand: any; private _serviceMap: { [service: string]: string; }; private _origin: string; diff --git a/src/vs/platform/request/common/request.ts b/src/vs/platform/request/common/request.ts index b2f091b5360..5fa79164ab1 100644 --- a/src/vs/platform/request/common/request.ts +++ b/src/vs/platform/request/common/request.ts @@ -6,12 +6,12 @@ import http = require('vs/base/common/http'); import { TPromise } from 'vs/base/common/winjs.base'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const IRequestService = createDecorator('requestService'); export interface IRequestService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Wraps the call into WinJS.XHR to allow for mocking and telemetry. Use this instead diff --git a/src/vs/platform/request/node/nodeRequestService.ts b/src/vs/platform/request/node/nodeRequestService.ts index d39226205b3..b3098740f96 100644 --- a/src/vs/platform/request/node/nodeRequestService.ts +++ b/src/vs/platform/request/node/nodeRequestService.ts @@ -30,7 +30,7 @@ interface IHTTPConfiguration { */ export class NodeRequestService implements IRequestService { - serviceId = IRequestService; + _serviceBrand: any; private disposables: IDisposable[]; private proxyUrl: string = null; diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index ba806e832aa..5a5462cf980 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -8,7 +8,7 @@ import {PPromise} from 'vs/base/common/winjs.base'; import uri from 'vs/base/common/uri'; import glob = require('vs/base/common/glob'); import {IFilesConfiguration} from 'vs/platform/files/common/files'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const ID = 'searchService'; @@ -17,7 +17,7 @@ export const ISearchService = createDecorator(ID); * A service that enables to search for files or with in files. */ export interface ISearchService { - serviceId: ServiceIdentifier; + _serviceBrand: any; search(query: ISearchQuery): PPromise; } diff --git a/src/vs/platform/statusbar/common/statusbar.ts b/src/vs/platform/statusbar/common/statusbar.ts index b5a5ca51ac9..f26c7e9bd01 100644 --- a/src/vs/platform/statusbar/common/statusbar.ts +++ b/src/vs/platform/statusbar/common/statusbar.ts @@ -5,7 +5,7 @@ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IDisposable} from 'vs/base/common/lifecycle'; export var IStatusbarService = createDecorator('statusbarService'); @@ -44,7 +44,7 @@ export interface IStatusbarEntry { export interface IStatusbarService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Adds an entry to the statusbar with the given alignment and priority. Use the returned IDisposable diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index b4fa85d8610..71781b0eb32 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const ID = 'storageService'; export const IStorageService = createDecorator(ID); export interface IStorageService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Store a string value under the given key to local storage. @@ -78,7 +78,7 @@ export enum StorageScope { export const NullStorageService: IStorageService = { - serviceId: undefined, + _serviceBrand: undefined, store() { return undefined; }, swap() { return undefined; }, remove() { return undefined; }, diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index 67db50e2266..d39a79d9191 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -6,7 +6,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import {ITimerEvent, nullEvent} from 'vs/base/common/timer'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const ITelemetryService = createDecorator('telemetryService'); @@ -18,7 +18,7 @@ export interface ITelemetryInfo { export interface ITelemetryService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Sends a telemetry event that has been privacy approved. @@ -37,7 +37,7 @@ export interface ITelemetryService { } export const NullTelemetryService: ITelemetryService = { - serviceId: undefined, + _serviceBrand: undefined, timedPublicLog(name: string, data?: any) { return nullEvent; }, publicLog(eventName: string, data?: any) { return TPromise.as(null); }, isOptedIn: true, diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 3f6594e1a3c..6cb7e1ff921 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -29,7 +29,7 @@ export class TelemetryService implements ITelemetryService { static IDLE_START_EVENT_NAME = 'UserIdleStart'; static IDLE_STOP_EVENT_NAME = 'UserIdleStop'; - serviceId = ITelemetryService; + _serviceBrand: any; private _appender: ITelemetryAppender; private _commonProperties: TPromise<{ [name: string]: any; }>; diff --git a/src/vs/platform/telemetry/test/node/telemetryService.test.ts b/src/vs/platform/telemetry/test/node/telemetryService.test.ts index 120c1e36cb1..6d8463cd43e 100644 --- a/src/vs/platform/telemetry/test/node/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/node/telemetryService.test.ts @@ -645,7 +645,7 @@ suite('TelemetryService', () => { let service = new TelemetryService({ appender: testAppender }, { - serviceId: undefined, + _serviceBrand: undefined, hasWorkspaceConfiguration() { return false; }, diff --git a/src/vs/platform/workspace/common/baseWorkspaceContextService.ts b/src/vs/platform/workspace/common/baseWorkspaceContextService.ts index c08c804120e..7ce11e7346d 100644 --- a/src/vs/platform/workspace/common/baseWorkspaceContextService.ts +++ b/src/vs/platform/workspace/common/baseWorkspaceContextService.ts @@ -13,7 +13,7 @@ import {IWorkspaceContextService, IWorkspace, IConfiguration} from './workspace' * between different layers of the platform. */ export class BaseWorkspaceContextService implements IWorkspaceContextService { - public serviceId = IWorkspaceContextService; + public _serviceBrand: any; protected options: any; private workspace: IWorkspace; diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 281f5ca4cd5..0506f910289 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -5,12 +5,12 @@ 'use strict'; import URI from 'vs/base/common/uri'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IWorkspaceContextService = createDecorator('contextService'); export interface IWorkspaceContextService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Provides access to the workspace object the platform is running with. This may be null if the workbench was opened diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 399ddeb5a35..d6572b128dd 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -119,7 +119,7 @@ export class ExtHostExtensionService extends AbstractExtensionService implements IPanelService { public static activePanelSettingsKey = 'workbench.panelpart.activepanelid'; - public serviceId = IPanelService; + public _serviceBrand: any; private blockOpeningPanel: boolean; constructor( diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index d4104965ab3..87643820c2b 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -64,7 +64,7 @@ interface IInternalPickOptions { export class QuickOpenController extends WorkbenchComponent implements IQuickOpenService { - public serviceId = IQuickOpenService; + public _serviceBrand: any; private static ID = 'workbench.component.quickopen'; diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index 35b77638310..401507bd298 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -29,7 +29,7 @@ export class SidebarPart extends CompositePart implements IViewletServi public static activeViewletSettingsKey = 'workbench.sidebar.activeviewletid'; - public serviceId = IViewletService; + public _serviceBrand: any; private blockOpeningViewlet: boolean; diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 638d559b900..c3b94ea4b93 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -28,7 +28,7 @@ import {IStatusbarService, IStatusbarEntry} from 'vs/platform/statusbar/common/s export class StatusbarPart extends Part implements IStatusbarService { - public serviceId = IStatusbarService; + public _serviceBrand: any; private static PRIORITY_PROP = 'priority'; private static ALIGNMENT_PROP = 'alignment'; diff --git a/src/vs/workbench/common/storage.ts b/src/vs/workbench/common/storage.ts index c24634608b8..3d8de50960b 100644 --- a/src/vs/workbench/common/storage.ts +++ b/src/vs/workbench/common/storage.ts @@ -22,7 +22,7 @@ export interface IStorage { export class Storage implements IStorageService { - public serviceId = IStorageService; + public _serviceBrand: any; private static COMMON_PREFIX = 'storage://'; private static GLOBAL_PREFIX = Storage.COMMON_PREFIX + 'global/'; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 6fed52c6b24..0fc535047d9 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -90,7 +90,7 @@ export class Workbench implements IPartService { private static sidebarHiddenSettingKey = 'workbench.sidebar.hidden'; private static panelHiddenSettingKey = 'workbench.panel.hidden'; - public serviceId = IPartService; + public _serviceBrand: any; private container: HTMLElement; private workbenchParams: WorkbenchParams; diff --git a/src/vs/workbench/node/extensionHostMain.ts b/src/vs/workbench/node/extensionHostMain.ts index b07ce51f5f4..d7ff2b383ec 100644 --- a/src/vs/workbench/node/extensionHostMain.ts +++ b/src/vs/workbench/node/extensionHostMain.ts @@ -68,7 +68,7 @@ export class ExtensionHostMain { const telemetryService = new RemoteTelemetryService('pluginHostTelemetry', threadService); - this._extensionService = new ExtHostExtensionService(threadService, telemetryService, {serviceId: 'optionalArgs', workspaceStoragePath }); + this._extensionService = new ExtHostExtensionService(threadService, telemetryService, {_serviceBrand: 'optionalArgs', workspaceStoragePath }); // Connect to shared process services const channel = sharedProcessClient.getChannel('extensions'); diff --git a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts b/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts index 3f890141abc..7887ee5a6ec 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts @@ -5,12 +5,11 @@ import { IActionRunner } from 'vs/base/common/actions'; import { IViewletView } from 'vs/workbench/browser/viewlet'; -import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; // Debug view registration export interface IDebugViewConstructorSignature { - new (actionRunner: IActionRunner, viewletSetings: any, ...services: { serviceId: ServiceIdentifier; }[]): IViewletView; + new (actionRunner: IActionRunner, viewletSetings: any, ...services: { _serviceBrand: any; }[]): IViewletView; } export interface IDebugViewRegistry { diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 546478f66ab..65868bbba0a 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -7,7 +7,7 @@ import uri from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import severity from 'vs/base/common/severity'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import editor = require('vs/editor/common/editorCommon'); import { Source } from 'vs/workbench/parts/debug/common/debugSource'; import { Range } from 'vs/editor/common/core/range'; @@ -268,7 +268,7 @@ export interface IConfigurationManager { export var IDebugService = createDecorator(DEBUG_SERVICE_ID); export interface IDebugService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Gets the current debug state. diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 8cc3440cb5f..92ea430f713 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -61,7 +61,7 @@ const DEBUG_WATCH_EXPRESSIONS_KEY = 'debug.watchexpressions'; const DEBUG_SELECTED_CONFIG_NAME_KEY = 'debug.selectedconfigname'; export class DebugService implements debug.IDebugService { - public serviceId = debug.IDebugService; + public _serviceBrand: any; private _state: debug.State; private _onDidChangeState: Emitter; diff --git a/src/vs/workbench/parts/debug/test/common/mockDebugService.ts b/src/vs/workbench/parts/debug/test/common/mockDebugService.ts index bd5d6ce8d54..6d5533e6a09 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebugService.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebugService.ts @@ -11,7 +11,7 @@ import { Source } from 'vs/workbench/parts/debug/common/debugSource'; export class MockDebugService implements debug.IDebugService { private session: MockRawSession; - public serviceId = debug.IDebugService; + public _serviceBrand: any; constructor() { this.session = new MockRawSession(); diff --git a/src/vs/workbench/parts/execution/common/execution.ts b/src/vs/workbench/parts/execution/common/execution.ts index 752c2ad41de..cae42267023 100644 --- a/src/vs/workbench/parts/execution/common/execution.ts +++ b/src/vs/workbench/parts/execution/common/execution.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export var ITerminalService = createDecorator('nativeTerminalService'); export interface ITerminalService { - serviceId: ServiceIdentifier; + _serviceBrand: any; openTerminal(path: string): void; } \ No newline at end of file diff --git a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts index f433130c056..9781b7d3fa9 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts @@ -14,7 +14,7 @@ import cp = require('child_process'); import processes = require('vs/base/node/processes'); export class WinTerminalService implements ITerminalService { - public serviceId = ITerminalService; + public _serviceBrand: any; constructor( @IConfigurationService private _configurationService: IConfigurationService @@ -45,7 +45,7 @@ export class WinTerminalService implements ITerminalService { } export class MacTerminalService implements ITerminalService { - public serviceId = ITerminalService; + public _serviceBrand: any; constructor( @IConfigurationService private _configurationService: IConfigurationService @@ -70,7 +70,7 @@ export class MacTerminalService implements ITerminalService { } export class LinuxTerminalService implements ITerminalService { - public serviceId = ITerminalService; + public _serviceBrand: any; constructor( @IConfigurationService private _configurationService: IConfigurationService diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index 7cb1f697214..a1569107b8e 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -21,7 +21,7 @@ import Severity from 'vs/base/common/severity'; export class ExtensionTipsService implements IExtensionTipsService { - serviceId = IExtensionTipsService; + _serviceBrand: any; private _recommendations: { [id: string]: boolean; } = Object.create(null); private _availableRecommendations: { [pattern: string]: string[] } = Object.create(null); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensions.ts index e90f6828a31..f166eba21d8 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import {IViewlet} from 'vs/workbench/common/viewlet'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; import { TPromise } from 'vs/base/common/winjs.base'; import { IPager } from 'vs/base/common/paging'; @@ -45,7 +45,7 @@ export var SERVICE_ID = 'extensionsWorkbenchService'; export var IExtensionsWorkbenchService = createDecorator(SERVICE_ID); export interface IExtensionsWorkbenchService { - serviceId: ServiceIdentifier; + _serviceBrand: any; onChange: Event; local: IExtension[]; queryLocal(): TPromise; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts index 91fa641d5a6..d2ae8746c2f 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchService.ts @@ -123,7 +123,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { private static SyncPeriod = 1000 * 60 * 60 * 12; // 12 hours - serviceId = IExtensionsWorkbenchService; + _serviceBrand: any; private stateProvider: IExtensionStateProvider; private installing: { id: string; extension: Extension; }[] = []; private installed: Extension[] = []; diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index 5add19ca0e0..dc51a73c9ef 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -12,7 +12,7 @@ import {IModel, IEditorOptions, IRawText} from 'vs/editor/common/editorCommon'; import {IDisposable} from 'vs/base/common/lifecycle'; import {EncodingMode, EditorInput, IFileEditorInput, ConfirmResult, IWorkbenchEditorConfiguration, IEditorDescriptor} from 'vs/workbench/common/editor'; import {IFileStat, IFilesConfiguration, IBaseStat, IResolveContentOptions} from 'vs/platform/files/common/files'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {FileStat} from 'vs/workbench/parts/files/common/explorerViewModel'; /** @@ -270,7 +270,7 @@ export interface IRawTextContent extends IBaseStat { } export interface ITextFileService extends IDisposable { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Resolve the contents of a file identified by the resource. diff --git a/src/vs/workbench/parts/files/common/textFileServices.ts b/src/vs/workbench/parts/files/common/textFileServices.ts index fb3f1e66a87..f89ac960ff7 100644 --- a/src/vs/workbench/parts/files/common/textFileServices.ts +++ b/src/vs/workbench/parts/files/common/textFileServices.ts @@ -30,7 +30,7 @@ import {IModelService} from 'vs/editor/common/services/modelService'; */ export abstract class TextFileService implements ITextFileService { - public serviceId = ITextFileService; + public _serviceBrand: any; private listenerToUnbind: IDisposable[]; diff --git a/src/vs/workbench/parts/git/browser/gitServices.ts b/src/vs/workbench/parts/git/browser/gitServices.ts index 66287061eb3..665a06f8613 100644 --- a/src/vs/workbench/parts/git/browser/gitServices.ts +++ b/src/vs/workbench/parts/git/browser/gitServices.ts @@ -382,7 +382,7 @@ export class GitService extends ee.EventEmitter implements git.IGitService { - public serviceId = git.IGitService; + public _serviceBrand: any; private eventService: IEventService; private contextService: IWorkspaceContextService; diff --git a/src/vs/workbench/parts/git/common/git.ts b/src/vs/workbench/parts/git/common/git.ts index a8f1b233a19..8e50183d165 100644 --- a/src/vs/workbench/parts/git/common/git.ts +++ b/src/vs/workbench/parts/git/common/git.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { EditorInput } from 'vs/workbench/common/editor'; import { IEventEmitter } from 'vs/base/common/eventEmitter'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; // Model raw interfaces @@ -291,7 +291,7 @@ export var GIT_SERVICE_ID = 'gitService'; export var IGitService = createDecorator(GIT_SERVICE_ID); export interface IGitService extends IEventEmitter { - serviceId: ServiceIdentifier; + _serviceBrand: any; allowHugeRepositories: boolean; onOutput: Event; status(): TPromise; diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index ff12d82b575..2bc297f9335 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -21,7 +21,7 @@ import {IPanelService} from 'vs/workbench/services/panel/common/panelService'; const OUTPUT_ACTIVE_CHANNEL_KEY = 'output.activechannel'; export class OutputService implements IOutputService { - public serviceId = IOutputService; + public _serviceBrand: any; private receivedOutput: { [channel: string]: string; }; diff --git a/src/vs/workbench/parts/output/common/output.ts b/src/vs/workbench/parts/output/common/output.ts index 917bd668fd9..ce62c62d6aa 100644 --- a/src/vs/workbench/parts/output/common/output.ts +++ b/src/vs/workbench/parts/output/common/output.ts @@ -7,7 +7,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import {Registry} from 'vs/platform/platform'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IEditor} from 'vs/platform/editor/common/editor'; /** @@ -52,7 +52,7 @@ export var IOutputService = createDecorator(OUTPUT_SERVICE_ID); * The output service to manage output from the various processes running. */ export interface IOutputService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Given the channel id returns the output channel instance. diff --git a/src/vs/workbench/parts/search/browser/replaceService.ts b/src/vs/workbench/parts/search/browser/replaceService.ts index b802b5789b9..bc4d5de445b 100644 --- a/src/vs/workbench/parts/search/browser/replaceService.ts +++ b/src/vs/workbench/parts/search/browser/replaceService.ts @@ -119,7 +119,7 @@ class EditorInputCache { export class ReplaceService implements IReplaceService { - public serviceId= IReplaceService; + public _serviceBrand: any; private cache: EditorInputCache; diff --git a/src/vs/workbench/parts/search/common/replace.ts b/src/vs/workbench/parts/search/common/replace.ts index 7cc4b43392a..678e186bf7e 100644 --- a/src/vs/workbench/parts/search/common/replace.ts +++ b/src/vs/workbench/parts/search/common/replace.ts @@ -5,7 +5,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Match, FileMatch } from 'vs/workbench/parts/search/common/searchModel'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IProgressRunner } from 'vs/platform/progress/common/progress'; import { EditorInput } from 'vs/workbench/common/editor'; @@ -13,7 +13,7 @@ export var IReplaceService = createDecorator('replaceService'); export interface IReplaceService { - serviceId : ServiceIdentifier; + _serviceBrand: any; /** * Replace the match with the given text. diff --git a/src/vs/workbench/parts/tasks/common/taskService.ts b/src/vs/workbench/parts/tasks/common/taskService.ts index eb77a0482cd..3c4061e1107 100644 --- a/src/vs/workbench/parts/tasks/common/taskService.ts +++ b/src/vs/workbench/parts/tasks/common/taskService.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; import { IEventEmitter } from 'vs/base/common/eventEmitter'; import { TerminateResponse } from 'vs/base/common/processes'; -import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { ITaskSummary, TaskDescription, TaskEvent, TaskType } from 'vs/workbench/parts/tasks/common/taskSystem'; export { ITaskSummary, TaskDescription, TaskEvent, TaskType }; @@ -23,7 +23,7 @@ export namespace TaskServiceEvents { } export interface ITaskService extends IEventEmitter { - serviceId: ServiceIdentifier; + _serviceBrand: any; configureAction(): Action; build(): TPromise; rebuild(): TPromise; diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index dc1b640994f..613e3e9f8e2 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -550,7 +550,7 @@ class NullTaskSystem extends EventEmitter implements ITaskSystem { } class TaskService extends EventEmitter implements ITaskService { - public serviceId = ITaskService; + public _serviceBrand: any; public static SERVICE_ID: string = 'taskService'; public static OutputChannelId:string = 'tasks'; public static OutputChannelLabel:string = nls.localize('tasks', "Tasks"); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.ts index a7e1654220c..92f4198fc1e 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.ts @@ -10,7 +10,7 @@ import platform = require('vs/base/common/platform'); import processes = require('vs/base/node/processes'); import {Builder} from 'vs/base/browser/builder'; import {TPromise} from 'vs/base/common/winjs.base'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const TERMINAL_PANEL_ID = 'workbench.panel.terminal'; @@ -48,10 +48,10 @@ export interface ITerminalProcess { } export interface ITerminalService { + _serviceBrand: any; onActiveInstanceChanged: Event; onInstancesChanged: Event; onInstanceTitleChanged: Event; - serviceId: ServiceIdentifier; close(): TPromise; createNew(): TPromise; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index aee40aaacf7..3c1b144fc8c 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -22,7 +22,7 @@ import {TerminalConfigHelper} from 'vs/workbench/parts/terminal/electron-browser import {TerminalPanel} from 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; export class TerminalService implements ITerminalService { - public serviceId = ITerminalService; + public _serviceBrand: any; private activeTerminalIndex: number = 0; private terminalProcesses: ITerminalProcess[] = []; diff --git a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts index acae53b0acf..c8860f4da05 100644 --- a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts @@ -6,19 +6,15 @@ 'use strict'; import * as assert from 'assert'; -import Event from 'vs/base/common/event'; import {Builder} from 'vs/base/browser/builder'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; -import {IThemeData} from 'vs/workbench/services/themes/common/themeService'; -import {IThemeService} from 'vs/workbench/services/themes/common/themeService'; import {Platform} from 'vs/base/common/platform'; -import {ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; import {TPromise} from 'vs/base/common/winjs.base'; import {TerminalConfigHelper} from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; class MockConfigurationService implements IConfigurationService { - public serviceId = IConfigurationService; + public _serviceBrand: any; public constructor(private configuration: any = {}) {} public loadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } public getConfiguration(): any { return this.configuration; } diff --git a/src/vs/workbench/services/activity/common/activityService.ts b/src/vs/workbench/services/activity/common/activityService.ts index 9376e201dca..f7d7eb57a3f 100644 --- a/src/vs/workbench/services/activity/common/activityService.ts +++ b/src/vs/workbench/services/activity/common/activityService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export interface IBadge { getDescription(): string; @@ -59,7 +59,7 @@ export class ProgressBadge extends BaseBadge { export var IActivityService = createDecorator('activityService'); export interface IActivityService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Show activity in the activitybar for the given viewlet. diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index 024d9feb4a5..d657781960c 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -17,7 +17,6 @@ import {IStat, IContent, ConfigurationService as CommonConfigurationService} fro import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService'; import {OptionsChangeEvent, EventType} from 'vs/workbench/common/events'; import {IEventService} from 'vs/platform/event/common/event'; -import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {IDisposable} from 'vs/base/common/lifecycle'; import {readFile, writeFile} from 'vs/base/node/pfs'; import {JSONPath} from 'vs/base/common/json'; @@ -26,7 +25,7 @@ import {setProperty} from 'vs/base/common/jsonEdit'; export class ConfigurationService extends CommonConfigurationService { - public serviceId = IConfigurationService; + public _serviceBrand: any; protected contextService: IWorkspaceContextService; private toDispose: IDisposable; diff --git a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts index 6f3fcbb5794..d6a9ab0da6c 100644 --- a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts +++ b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts @@ -19,7 +19,7 @@ import {remote, webFrame} from 'electron'; export class ContextMenuService implements IContextMenuService { - public serviceId = IContextMenuService; + public _serviceBrand: any; constructor( @IMessageService private messageService: IMessageService, diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index c12e22efb72..07f5de40a53 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -39,7 +39,7 @@ export interface IEditorPart { export class WorkbenchEditorService implements IWorkbenchEditorService { - public serviceId = IWorkbenchEditorService; + public _serviceBrand: any; private editorPart: IEditorPart | IWorkbenchEditorService; private fileInputDescriptor: AsyncDescriptor0; diff --git a/src/vs/workbench/services/editor/common/editorService.ts b/src/vs/workbench/services/editor/common/editorService.ts index 5194af0cf22..fbe9f272606 100644 --- a/src/vs/workbench/services/editor/common/editorService.ts +++ b/src/vs/workbench/services/editor/common/editorService.ts @@ -21,7 +21,7 @@ export var IWorkbenchEditorService = createDecorator('e * editor input and models. */ export interface IWorkbenchEditorService extends IEditorService { - serviceId : ServiceIdentifier; + _serviceBrand: ServiceIdentifier; /** * Returns the currently active editor or null if none. diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index 3724552f34a..c51b47d7798 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -28,7 +28,7 @@ const NET_VERSION_ERROR = 'System.MissingMethodException'; export class FileService implements IFileService { - public serviceId = IFileService; + public _serviceBrand: any; private raw: IFileService; diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index 27b713b9a7a..581f57fae81 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -68,7 +68,7 @@ function etag(arg1: any, arg2?: any): string { export class FileService implements IFileService { - public serviceId = IFileService; + public _serviceBrand: any; private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) private static MAX_DEGREE_OF_PARALLEL_FS_OPS = 10; // degree of parallel fs calls that we accept at the same time diff --git a/src/vs/workbench/services/files/test/node/utils.ts b/src/vs/workbench/services/files/test/node/utils.ts index b18d56519b2..a1b65cbccd7 100644 --- a/src/vs/workbench/services/files/test/node/utils.ts +++ b/src/vs/workbench/services/files/test/node/utils.ts @@ -7,10 +7,9 @@ import {IFileStat} from 'vs/platform/files/common/files'; import {EventEmitter} from 'vs/base/common/eventEmitter'; -import {IEventService} from 'vs/platform/event/common/event'; export class TestEventService extends EventEmitter { - serviceId = IEventService; + _serviceBrand: any; } export function getByName(root: IFileStat, name: string): IFileStat { diff --git a/src/vs/workbench/services/group/common/groupService.ts b/src/vs/workbench/services/group/common/groupService.ts index e44099e61ea..79cb621add5 100644 --- a/src/vs/workbench/services/group/common/groupService.ts +++ b/src/vs/workbench/services/group/common/groupService.ts @@ -23,7 +23,7 @@ export var IEditorGroupService = createDecorator('editorGro * editor input and models. */ export interface IEditorGroupService { - serviceId: ServiceIdentifier; + _serviceBrand: ServiceIdentifier; /** * Emitted when editors or inputs change. Examples: opening, closing of editors. Active editor change. diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index d89e53165ff..8d8017680a0 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -212,7 +212,7 @@ interface IStackEntry { export class HistoryService extends BaseHistoryService implements IHistoryService { - public serviceId = IHistoryService; + public _serviceBrand: any; private static STORAGE_KEY = 'history.entries'; private static MAX_HISTORY_ITEMS = 200; diff --git a/src/vs/workbench/services/history/common/history.ts b/src/vs/workbench/services/history/common/history.ts index 8a133e29120..07fced15498 100644 --- a/src/vs/workbench/services/history/common/history.ts +++ b/src/vs/workbench/services/history/common/history.ts @@ -11,7 +11,7 @@ export var IHistoryService = createDecorator('historyService'); export interface IHistoryService { - serviceId: ServiceIdentifier; + _serviceBrand: ServiceIdentifier; /** * Removes and returns the last closed editor if any. diff --git a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts index 86ce857a492..4fc5808c708 100644 --- a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts +++ b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts @@ -15,7 +15,7 @@ import Event, {Emitter} from 'vs/base/common/event'; export class LifecycleService implements ILifecycleService { - public serviceId = ILifecycleService; + public _serviceBrand: any; private _onWillShutdown = new Emitter(); private _onShutdown = new Emitter(); diff --git a/src/vs/workbench/services/message/browser/messageService.ts b/src/vs/workbench/services/message/browser/messageService.ts index cd46aff83a4..43954eb7c51 100644 --- a/src/vs/workbench/services/message/browser/messageService.ts +++ b/src/vs/workbench/services/message/browser/messageService.ts @@ -21,7 +21,7 @@ interface IBufferedMessage { export class WorkbenchMessageService implements IMessageService { - public serviceId = IMessageService; + public _serviceBrand: any; private handler: MessageList; private disposeables: IDisposable[]; diff --git a/src/vs/workbench/services/panel/common/panelService.ts b/src/vs/workbench/services/panel/common/panelService.ts index 37a1fb89cbf..2adb874b2f0 100644 --- a/src/vs/workbench/services/panel/common/panelService.ts +++ b/src/vs/workbench/services/panel/common/panelService.ts @@ -10,7 +10,7 @@ import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/comm export var IPanelService = createDecorator('panelService'); export interface IPanelService { - serviceId : ServiceIdentifier; + _serviceBrand : ServiceIdentifier; /** * Opens a panel with the given identifier and pass keyboard focus to it if specified. diff --git a/src/vs/workbench/services/part/common/partService.ts b/src/vs/workbench/services/part/common/partService.ts index a16cb256b3a..69a29205cb1 100644 --- a/src/vs/workbench/services/part/common/partService.ts +++ b/src/vs/workbench/services/part/common/partService.ts @@ -23,7 +23,7 @@ export enum Position { export var IPartService = createDecorator('partService'); export interface IPartService { - serviceId : ServiceIdentifier; + _serviceBrand : ServiceIdentifier; /** * Asks the part service to layout all parts. diff --git a/src/vs/workbench/services/progress/browser/progressService.ts b/src/vs/workbench/services/progress/browser/progressService.ts index 08290591884..a758cd2c775 100644 --- a/src/vs/workbench/services/progress/browser/progressService.ts +++ b/src/vs/workbench/services/progress/browser/progressService.ts @@ -54,7 +54,7 @@ export abstract class ScopedService { } export class WorkbenchProgressService extends ScopedService implements IProgressService { - public serviceId = IProgressService; + public _serviceBrand: any; private isActive: boolean; private progressbar: ProgressBar; private progressState: ProgressState; diff --git a/src/vs/workbench/services/quickopen/common/quickOpenService.ts b/src/vs/workbench/services/quickopen/common/quickOpenService.ts index 382498b2761..1adade277c0 100644 --- a/src/vs/workbench/services/quickopen/common/quickOpenService.ts +++ b/src/vs/workbench/services/quickopen/common/quickOpenService.ts @@ -7,7 +7,7 @@ import {TPromise} from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import {IQuickNavigateConfiguration, IAutoFocus, IEntryRunContext} from 'vs/base/parts/quickopen/common/quickOpen'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export interface IPickOpenEntry { id?: string; @@ -81,8 +81,8 @@ export interface IShowOptions { export var IQuickOpenService = createDecorator('quickOpenService'); export interface IQuickOpenService { - - serviceId: ServiceIdentifier; + + _serviceBrand: any; /** * Asks the container to show the quick open control with the optional prefix set. If the optional parameter diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index eedd80d63de..e2ffd52dcf6 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -21,7 +21,7 @@ import {IRawSearch, ISerializedSearchComplete, ISerializedSearchProgressItem, IR import {ISearchChannel, SearchChannelClient} from './searchIpc'; export class SearchService implements ISearchService { - public serviceId = ISearchService; + public _serviceBrand: any; private diskSearch: DiskSearch; diff --git a/src/vs/workbench/services/themes/common/themeService.ts b/src/vs/workbench/services/themes/common/themeService.ts index 95549454de5..b10190f54df 100644 --- a/src/vs/workbench/services/themes/common/themeService.ts +++ b/src/vs/workbench/services/themes/common/themeService.ts @@ -4,14 +4,14 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {TPromise} from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; export let IThemeService = createDecorator('themeService'); export interface IThemeService { - serviceId: ServiceIdentifier; + _serviceBrand: any; setTheme(themeId: string, broadcastToAllWindows: boolean): TPromise; getTheme(): string; getThemes(): TPromise; diff --git a/src/vs/workbench/services/themes/electron-browser/themeService.ts b/src/vs/workbench/services/themes/electron-browser/themeService.ts index 466e6393549..3c77c79e399 100644 --- a/src/vs/workbench/services/themes/electron-browser/themeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/themeService.ts @@ -98,7 +98,7 @@ interface IInternalThemeData extends IThemeData { } export class ThemeService implements IThemeService { - serviceId = IThemeService; + _serviceBrand: any; private knownThemes: IInternalThemeData[]; private currentTheme: string; diff --git a/src/vs/workbench/services/thread/common/extHostThreadService.ts b/src/vs/workbench/services/thread/common/extHostThreadService.ts index b29ddef1d7e..faf6bc70f8a 100644 --- a/src/vs/workbench/services/thread/common/extHostThreadService.ts +++ b/src/vs/workbench/services/thread/common/extHostThreadService.ts @@ -10,7 +10,7 @@ import {AbstractThreadService} from 'vs/workbench/services/thread/common/abstrac import {IThreadService} from 'vs/workbench/services/thread/common/threadService'; export class ExtHostThreadService extends AbstractThreadService implements IThreadService { - public serviceId = IThreadService; + public _serviceBrand: any; protected _remoteCom: IRemoteCom; constructor(remoteCom: IRemoteCom) { diff --git a/src/vs/workbench/services/thread/common/threadService.ts b/src/vs/workbench/services/thread/common/threadService.ts index b336978ea8f..81ea6b841ff 100644 --- a/src/vs/workbench/services/thread/common/threadService.ts +++ b/src/vs/workbench/services/thread/common/threadService.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; export const IThreadService = createDecorator('threadService'); export interface IThreadService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Always returns a proxy. diff --git a/src/vs/workbench/services/thread/electron-browser/threadService.ts b/src/vs/workbench/services/thread/electron-browser/threadService.ts index eaeea328869..87bc8b9406d 100644 --- a/src/vs/workbench/services/thread/electron-browser/threadService.ts +++ b/src/vs/workbench/services/thread/electron-browser/threadService.ts @@ -38,7 +38,7 @@ export interface ILogEntry { } export class MainThreadService extends AbstractThreadService implements IThreadService { - public serviceId = IThreadService; + public _serviceBrand: any; private extensionHostProcessManager: ExtensionHostProcessManager; private remoteCom: IMainProcessExtHostIPC; diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index 8a267920e20..90ce3e962c6 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -5,7 +5,7 @@ 'use strict'; import URI from 'vs/base/common/uri'; -import {ServiceIdentifier, createDecorator, IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator, IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {EventType} from 'vs/base/common/events'; import arrays = require('vs/base/common/arrays'); import {UntitledEditorInput} from 'vs/workbench/common/editor/untitledEditorInput'; @@ -14,7 +14,7 @@ export var IUntitledEditorService = createDecorator('unt export interface IUntitledEditorService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Returns the untitled editor input matching the provided resource. @@ -57,7 +57,7 @@ export interface IUntitledEditorService { } export class UntitledEditorService implements IUntitledEditorService { - public serviceId = IUntitledEditorService; + public _serviceBrand: any; private static CACHE: { [resource: string]: UntitledEditorInput } = Object.create(null); private static KNOWN_ASSOCIATED_FILE_PATHS: { [resource: string]: boolean } = Object.create(null); diff --git a/src/vs/workbench/services/viewlet/common/viewletService.ts b/src/vs/workbench/services/viewlet/common/viewletService.ts index 489ef0fb67a..edc418a34f9 100644 --- a/src/vs/workbench/services/viewlet/common/viewletService.ts +++ b/src/vs/workbench/services/viewlet/common/viewletService.ts @@ -11,7 +11,7 @@ import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/comm export var IViewletService = createDecorator('viewletService'); export interface IViewletService { - serviceId : ServiceIdentifier; + _serviceBrand : ServiceIdentifier; /** * Opens a viewlet with the given identifier and pass keyboard focus to it if specified. diff --git a/src/vs/workbench/services/window/electron-browser/windowService.ts b/src/vs/workbench/services/window/electron-browser/windowService.ts index 78faac7c20d..dfdd752d6d4 100644 --- a/src/vs/workbench/services/window/electron-browser/windowService.ts +++ b/src/vs/workbench/services/window/electron-browser/windowService.ts @@ -6,7 +6,7 @@ 'use strict'; import {ElectronWindow} from 'vs/workbench/electron-browser/window'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import Event, {Emitter} from 'vs/base/common/event'; import {ipcRenderer as ipc, remote} from 'electron'; @@ -25,7 +25,7 @@ export interface IBroadcast { } export interface IWindowService { - serviceId: ServiceIdentifier; + _serviceBrand: any; getWindowId(): number; @@ -39,7 +39,7 @@ export interface IWindowService { } export class WindowService implements IWindowService { - public serviceId = IWindowService; + public _serviceBrand: any; private win: ElectronWindow; private windowId: number; diff --git a/src/vs/workbench/services/workspace/common/contextService.ts b/src/vs/workbench/services/workspace/common/contextService.ts index bb089d6d4c0..59e9b2a9430 100644 --- a/src/vs/workbench/services/workspace/common/contextService.ts +++ b/src/vs/workbench/services/workspace/common/contextService.ts @@ -7,14 +7,14 @@ import {IOptions} from 'vs/workbench/common/options'; import {EventType, OptionsChangeEvent} from 'vs/workbench/common/events'; import {IEventService} from 'vs/platform/event/common/event'; -import {createDecorator, ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation'; +import {createDecorator} from 'vs/platform/instantiation/common/instantiation'; import {IWorkspace, IConfiguration, IWorkspaceContextService as IBaseWorkspaceContextService} from 'vs/platform/workspace/common/workspace'; import {BaseWorkspaceContextService} from 'vs/platform/workspace/common/baseWorkspaceContextService'; export var IWorkspaceContextService = createDecorator('contextService'); export interface IWorkspaceContextService extends IBaseWorkspaceContextService { - serviceId: ServiceIdentifier; + _serviceBrand: any; /** * Provides access to the options object the platform is running with. @@ -28,7 +28,7 @@ export interface IWorkspaceContextService extends IBaseWorkspaceContextService { } export class WorkspaceContextService extends BaseWorkspaceContextService implements IWorkspaceContextService { - public serviceId = IWorkspaceContextService; + public _serviceBrand: any; constructor( private eventService: IEventService, diff --git a/src/vs/workbench/test/browser/services.test.ts b/src/vs/workbench/test/browser/services.test.ts index 397e12c921b..080825826fd 100644 --- a/src/vs/workbench/test/browser/services.test.ts +++ b/src/vs/workbench/test/browser/services.test.ts @@ -111,7 +111,7 @@ class TestEditorPart implements IEditorPart { } class TestViewletService implements IViewletService { - public serviceId = IViewletService; + public _serviceBrand: any; public openViewlet(id: string, focus?: boolean): Promise { return TPromise.as(null); } diff --git a/src/vs/workbench/test/common/editor/editorStacksModel.test.ts b/src/vs/workbench/test/common/editor/editorStacksModel.test.ts index 3147339032f..13fd92ec52b 100644 --- a/src/vs/workbench/test/common/editor/editorStacksModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorStacksModel.test.ts @@ -20,6 +20,7 @@ import {Registry} from 'vs/platform/platform'; import {Position, Direction} from 'vs/platform/editor/common/editor'; import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation'; import {DiffEditorInput} from 'vs/workbench/common/editor/diffEditorInput'; +import 'vs/workbench/browser/parts/editor/baseEditor'; function create(): EditorStacksModel { let services = new ServiceCollection(); diff --git a/src/vs/workbench/test/common/servicesTestUtils.ts b/src/vs/workbench/test/common/servicesTestUtils.ts index 4616d31990c..202c8e25fdb 100644 --- a/src/vs/workbench/test/common/servicesTestUtils.ts +++ b/src/vs/workbench/test/common/servicesTestUtils.ts @@ -54,7 +54,7 @@ export const TestConfiguration: IConfiguration = { }; export class TestHistoryService implements IHistoryService { - public serviceId = IHistoryService; + public _serviceBrand: any; public forward(): void { @@ -82,7 +82,7 @@ export class TestHistoryService implements IHistoryService { } export class TestContextService implements WorkspaceContextService.IWorkspaceContextService { - public serviceId = WorkspaceContextService.IWorkspaceContextService; + public _serviceBrand: any; private workspace: any; private configuration: any; @@ -166,7 +166,7 @@ export abstract class TestTextFileService extends TextFileService { } export class TestMessageService implements IMessageService { - public serviceId = IMessageService; + public _serviceBrand: any; private counter: number; @@ -194,7 +194,7 @@ export class TestMessageService implements IMessageService { } export class TestPartService implements PartService.IPartService { - public serviceId = PartService.IPartService; + public _serviceBrand: any; public layout(): void { } @@ -242,11 +242,11 @@ export class TestPartService implements PartService.IPartService { } export class TestEventService extends EventEmitter.EventEmitter implements IEventService { - public serviceId = IEventService; + public _serviceBrand: any; } export class TestStorageService extends EventEmitter.EventEmitter implements IStorageService { - public serviceId = IStorageService; + public _serviceBrand: any; private storage: Storage.Storage; @@ -325,7 +325,7 @@ export class MockRequestService extends BaseRequestService { } export class TestUntitledEditorService implements IUntitledEditorService { - public serviceId = IUntitledEditorService; + public _serviceBrand: any; public get(resource: URI) { return null; @@ -357,7 +357,7 @@ export class TestUntitledEditorService implements IUntitledEditorService { } export class TestEditorGroupService implements IEditorGroupService { - public serviceId = IEditorGroupService; + public _serviceBrand: any; private stacksModel: EditorStacksModel; @@ -447,7 +447,7 @@ export class TestEditorGroupService implements IEditorGroupService { } export class TestEditorService implements WorkbenchEditorService.IWorkbenchEditorService { - public serviceId = WorkbenchEditorService.IWorkbenchEditorService; + public _serviceBrand: any; public activeEditorInput; public activeEditorOptions; @@ -527,7 +527,7 @@ export class TestEditorService implements WorkbenchEditorService.IWorkbenchEdito } export class TestQuickOpenService implements QuickOpenService.IQuickOpenService { - public serviceId = QuickOpenService.IQuickOpenService; + public _serviceBrand: any; private callback: (prefix: string) => void; @@ -616,7 +616,7 @@ export const TestFileService = { }; export class TestConfigurationService extends EventEmitter.EventEmitter implements IConfigurationService { - public serviceId = IConfigurationService; + public _serviceBrand: any; private configuration = Object.create(null); @@ -645,7 +645,7 @@ export class TestConfigurationService extends EventEmitter.EventEmitter implemen export class TestLifecycleService implements ILifecycleService { - public serviceId = ILifecycleService; + public _serviceBrand: any; private _onWillShutdown = new Emitter(); private _onShutdown = new Emitter(); diff --git a/src/vs/workbench/test/node/api/extHostApiCommands.test.ts b/src/vs/workbench/test/node/api/extHostApiCommands.test.ts index dc5b8b05625..77f673f8a38 100644 --- a/src/vs/workbench/test/node/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/node/api/extHostApiCommands.test.ts @@ -60,7 +60,7 @@ suite('ExtHostLanguageFeatureCommands', function() { threadService = new TestThreadService(); services.set(ICommandService, { - serviceId: undefined, + _serviceBrand: undefined, executeCommand(id, args): any { let {handler} = CommandsRegistry.getCommands()[id]; return TPromise.as(instantiationService.invokeFunction(handler, args)); @@ -72,7 +72,7 @@ suite('ExtHostLanguageFeatureCommands', function() { services.set(IMarkerService, new MarkerService()); services.set(IThreadService, threadService); services.set(IModelService, { - serviceId: IModelService, + _serviceBrand: IModelService, getModel(): any { return model; }, createModel(): any { throw new Error(); }, destroyModel(): any { throw new Error(); }, diff --git a/src/vs/workbench/test/node/api/testThreadService.ts b/src/vs/workbench/test/node/api/testThreadService.ts index c13761607e5..1fa73af6c48 100644 --- a/src/vs/workbench/test/node/api/testThreadService.ts +++ b/src/vs/workbench/test/node/api/testThreadService.ts @@ -10,7 +10,7 @@ import {AbstractThreadService} from 'vs/workbench/services/thread/common/abstrac import {IThreadService, ProxyIdentifier} from 'vs/workbench/services/thread/common/threadService'; export class TestThreadService extends AbstractThreadService implements IThreadService { - public serviceId = IThreadService; + public _serviceBrand: any; constructor() { super(false);