Pull render service off instantiation service safely

This commit is contained in:
Daniel Imms
2020-02-04 07:01:25 -08:00
parent 489d8110c9
commit 3d2d35f5b6
5 changed files with 20 additions and 13 deletions
+5 -1
View File
@@ -36,7 +36,7 @@ export class ServiceCollection {
return this._entries.has(id);
}
get<T>(id: IServiceIdentifier<T>): T {
get<T>(id: IServiceIdentifier<T>): T | undefined {
return this._entries.get(id);
}
}
@@ -52,6 +52,10 @@ export class InstantiationService implements IInstantiationService {
this._services.set(id, instance);
}
public getService<T>(id: IServiceIdentifier<T>): T | undefined {
return this._services.get(id);
}
public createInstance<T>(ctor: any, ...args: any[]): any {
const serviceDependencies = getServiceDependencies(ctor).sort((a, b) => a.index - b.index);