mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-18 03:21:36 -04:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
|
||||
import Types = require('vs/base/common/types');
|
||||
import Assert = require('vs/base/common/assert');
|
||||
import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
export interface IRegistry {
|
||||
|
||||
@@ -58,42 +57,3 @@ class RegistryImpl implements IRegistry {
|
||||
}
|
||||
|
||||
export const Registry = <IRegistry>new RegistryImpl();
|
||||
|
||||
/**
|
||||
* A base class for registries that leverage the instantiation service to create instances.
|
||||
*/
|
||||
export class BaseRegistry<T> {
|
||||
private toBeInstantiated: IConstructorSignature0<T>[] = [];
|
||||
private instances: T[] = [];
|
||||
private instantiationService: IInstantiationService;
|
||||
|
||||
public setInstantiationService(service: IInstantiationService): void {
|
||||
this.instantiationService = service;
|
||||
|
||||
while (this.toBeInstantiated.length > 0) {
|
||||
let entry = this.toBeInstantiated.shift();
|
||||
this.instantiate(entry);
|
||||
}
|
||||
}
|
||||
|
||||
private instantiate(ctor: IConstructorSignature0<T>): void {
|
||||
let instance = this.instantiationService.createInstance(ctor);
|
||||
this.instances.push(instance);
|
||||
}
|
||||
|
||||
_register(ctor: IConstructorSignature0<T>): void {
|
||||
if (this.instantiationService) {
|
||||
this.instantiate(ctor);
|
||||
} else {
|
||||
this.toBeInstantiated.push(ctor);
|
||||
}
|
||||
}
|
||||
|
||||
_getInstances(): T[] {
|
||||
return this.instances.slice(0);
|
||||
}
|
||||
|
||||
_setInstances(instances: T[]): void {
|
||||
this.instances = instances;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user