UNPKG

@jupyter-lsp/jupyterlab-lsp

Version:

Language Server Protocol integration for JupyterLab

42 lines (41 loc) 1.6 kB
import { IFeature, ILSPDocumentConnectionManager, EditorAdapter } from '@jupyterlab/lsp'; import { ISettingRegistry } from '@jupyterlab/settingregistry'; import { Signal } from '@lumino/signaling'; import * as lsProtocol from 'vscode-languageserver-protocol'; export interface IFeatureSettings<T> { readonly composite: Required<T>; readonly changed: Signal<IFeatureSettings<T>, void>; readonly ready?: Promise<void>; set(setting: keyof T, value: any): void; } export declare namespace Feature { interface IOptions { connectionManager: ILSPDocumentConnectionManager; } } export declare abstract class Feature implements IFeature { /** * The feature identifier. It must be the same as the feature plugin id. */ abstract readonly id: string; /** * LSP capabilities implemented by the feature. */ abstract readonly capabilities?: lsProtocol.ClientCapabilities; /** * Editor extension factory linked to the LSP feature. */ extensionFactory?: EditorAdapter.ILSPEditorExtensionFactory; protected connectionManager: ILSPDocumentConnectionManager; constructor(options: Feature.IOptions); } export declare class FeatureSettings<T> implements IFeatureSettings<T> { protected settingRegistry: ISettingRegistry; protected settings: ISettingRegistry.ISettings; changed: Signal<FeatureSettings<T>, void>; private _ready; constructor(settingRegistry: ISettingRegistry, featureID: string); get ready(): Promise<void>; get composite(): Required<T>; set(setting: keyof T, value: any): void; }