|
| 1 | +/*--------------------------------------------------------------------------------------------- |
| 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | + * Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | + *--------------------------------------------------------------------------------------------*/ |
| 5 | + |
| 6 | +import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; |
| 7 | +import { IExtHostOutputService, ExtHostOutputService } from 'vs/workbench/api/common/extHostOutput'; |
| 8 | +import { IExtHostWorkspace, ExtHostWorkspace } from 'vs/workbench/api/common/extHostWorkspace'; |
| 9 | +import { IExtHostDecorations, ExtHostDecorations } from 'vs/workbench/api/common/extHostDecorations'; |
| 10 | +import { IExtHostConfiguration, ExtHostConfiguration } from 'vs/workbench/api/common/extHostConfiguration'; |
| 11 | +import { IExtHostCommands, ExtHostCommands } from 'vs/workbench/api/common/extHostCommands'; |
| 12 | +import { IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors'; |
| 13 | +import { IExtHostTerminalService } from 'vs/workbench/api/common/extHostTerminalService'; |
| 14 | +import { IExtHostTask } from 'vs/workbench/api/common/extHostTask'; |
| 15 | +import { IExtHostDebugService } from 'vs/workbench/api/common/extHostDebugService'; |
| 16 | +import { IExtHostSearch } from 'vs/workbench/api/common/extHostSearch'; |
| 17 | +import { IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; |
| 18 | +import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; |
| 19 | +import { IExtHostStorage, ExtHostStorage } from 'vs/workbench/api/common/extHostStorage'; |
| 20 | +import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensionService'; |
| 21 | +import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; |
| 22 | +import { ExtensionStoragePaths } from 'vs/workbench/api/worker/extHostStoragePaths'; |
| 23 | + |
| 24 | + |
| 25 | +// register singleton services |
| 26 | +registerSingleton(IExtHostOutputService, ExtHostOutputService); |
| 27 | +registerSingleton(IExtHostWorkspace, ExtHostWorkspace); |
| 28 | +registerSingleton(IExtHostDecorations, ExtHostDecorations); |
| 29 | +registerSingleton(IExtHostConfiguration, ExtHostConfiguration); |
| 30 | +registerSingleton(IExtHostCommands, ExtHostCommands); |
| 31 | +registerSingleton(IExtHostDocumentsAndEditors, ExtHostDocumentsAndEditors); |
| 32 | +registerSingleton(IExtHostStorage, ExtHostStorage); |
| 33 | +registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths); |
| 34 | +registerSingleton(IExtHostExtensionService, ExtHostExtensionService); |
| 35 | + |
| 36 | +// register services that only throw errors |
| 37 | +function NotImplementedProxy<T>(name: ServiceIdentifier<T>): { new(): T } { |
| 38 | + return <any>class { |
| 39 | + constructor() { |
| 40 | + return new Proxy({}, { |
| 41 | + get(_target: any, prop: any) { |
| 42 | + throw new Error(`Not Implemented: ${name}->${String(prop)}`); |
| 43 | + } |
| 44 | + }); |
| 45 | + } |
| 46 | + }; |
| 47 | +} |
| 48 | +registerSingleton(IExtHostTerminalService, class extends NotImplementedProxy(IExtHostTerminalService) { }); |
| 49 | +registerSingleton(IExtHostTask, class extends NotImplementedProxy(IExtHostTask) { }); |
| 50 | +registerSingleton(IExtHostDebugService, class extends NotImplementedProxy(IExtHostDebugService) { }); |
| 51 | +registerSingleton(IExtHostSearch, class extends NotImplementedProxy(IExtHostSearch) { }); |
0 commit comments