@jupyter-lsp/jupyterlab-lsp
Version:
Language Server Protocol integration for JupyterLab
45 lines • 1.44 kB
JavaScript
import { PromiseDelegate } from '@lumino/coreutils';
import { Signal } from '@lumino/signaling';
export class Feature {
constructor(options) {
/**
* Editor extension factory linked to the LSP feature.
*/
this.extensionFactory = undefined;
this.connectionManager = options.connectionManager;
}
}
export class FeatureSettings {
constructor(settingRegistry, featureID) {
this.settingRegistry = settingRegistry;
this._ready = new PromiseDelegate();
this.changed = new Signal(this);
if (!(featureID in settingRegistry.plugins)) {
this._ready.reject(`${featureID} settings schema could not be found and was not loaded`);
}
else {
settingRegistry
.load(featureID)
.then(settings => {
this.settings = settings;
this._ready.resolve(void 0);
this.changed.emit();
settings.changed.connect(() => {
this.settings = settings;
this.changed.emit();
});
})
.catch(console.warn);
}
}
get ready() {
return this._ready.promise;
}
get composite() {
return this.settings.composite;
}
set(setting, value) {
this.settings.set(setting, value).catch(console.warn);
}
}
//# sourceMappingURL=feature.js.map