@codingame/monaco-vscode-extensions-service-override
Version:
VSCode public API plugged on the monaco editor - extensions service-override
42 lines (40 loc) • 1.33 kB
JavaScript
function extHostNamedCustomer(id) {
return function (ctor) {
ExtHostCustomersRegistryImpl.INSTANCE.registerNamedCustomer(id, ctor);
};
}
function extHostCustomer(ctor) {
ExtHostCustomersRegistryImpl.INSTANCE.registerCustomer(ctor);
}
var ExtHostCustomersRegistry;
( (function(ExtHostCustomersRegistry) {
function getNamedCustomers() {
return ExtHostCustomersRegistryImpl.INSTANCE.getNamedCustomers();
}
ExtHostCustomersRegistry.getNamedCustomers = getNamedCustomers;
function getCustomers() {
return ExtHostCustomersRegistryImpl.INSTANCE.getCustomers();
}
ExtHostCustomersRegistry.getCustomers = getCustomers;
})(ExtHostCustomersRegistry || (ExtHostCustomersRegistry = {})));
class ExtHostCustomersRegistryImpl {
static { this.INSTANCE = ( new ExtHostCustomersRegistryImpl()); }
constructor() {
this._namedCustomers = [];
this._customers = [];
}
registerNamedCustomer(id, ctor) {
const entry = [id, ctor];
this._namedCustomers.push(entry);
}
getNamedCustomers() {
return this._namedCustomers;
}
registerCustomer(ctor) {
this._customers.push(ctor);
}
getCustomers() {
return this._customers;
}
}
export { ExtHostCustomersRegistry, extHostCustomer, extHostNamedCustomer };