diff --git a/src/common/services/InstantiationService.ts b/src/common/services/InstantiationService.ts index 375e442def..7e76954856 100644 --- a/src/common/services/InstantiationService.ts +++ b/src/common/services/InstantiationService.ts @@ -67,7 +67,7 @@ export class InstantiationService implements IInstantiationService { for (const dependency of serviceDependencies) { const service = this._services.get(dependency.id); if (!service) { - throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`); + throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id._id}.`); } serviceArgs.push(service); } diff --git a/src/common/services/ServiceRegistry.ts b/src/common/services/ServiceRegistry.ts index 6510fb8e04..7d887bc612 100644 --- a/src/common/services/ServiceRegistry.ts +++ b/src/common/services/ServiceRegistry.ts @@ -33,7 +33,7 @@ export function createDecorator(id: string): IServiceIdentifier { storeServiceDependency(decorator, target, index); }; - decorator.toString = () => id; + decorator._id = id; serviceRegistry.set(id, decorator); return decorator; diff --git a/src/common/services/Services.ts b/src/common/services/Services.ts index 0e5c518484..be1dec064a 100644 --- a/src/common/services/Services.ts +++ b/src/common/services/Services.ts @@ -124,6 +124,7 @@ export interface ICharsetService { export interface IServiceIdentifier { (...args: any[]): void; type: T; + _id: string; } export interface IBrandedService {