UNPKG

@jupyter-lsp/jupyterlab-lsp

Version:

Language Server Protocol integration for JupyterLab

43 lines (42 loc) 2.02 kB
import { JupyterFrontEndPlugin } from '@jupyterlab/application'; import { IEditorExtensionRegistry } from '@jupyterlab/codemirror'; import { IEditorTracker } from '@jupyterlab/fileeditor'; import { WidgetLSPAdapter, VirtualDocument } from '@jupyterlab/lsp'; import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; import { ITableOfContentsRegistry } from '@jupyterlab/toc'; import { Throttler } from '@lumino/polling'; import { Widget } from '@lumino/widgets'; import type * as lsProtocol from 'vscode-languageserver-protocol'; import { CodeSymbols as LSPSymbolSettings } from '../_symbol'; import { ContextAssembler } from '../context'; import { FeatureSettings, Feature } from '../feature'; import { BrowserConsole } from '../virtual/console'; export declare class SymbolFeature extends Feature { readonly capabilities: lsProtocol.ClientCapabilities; readonly id: string; protected console: BrowserConsole; protected settings: FeatureSettings<LSPSymbolSettings>; protected cache: WeakMap<WidgetLSPAdapter<any>, lsProtocol.DocumentSymbol>; protected contextAssembler: ContextAssembler; getSymbols: Throttler<lsProtocol.DocumentSymbol[] | null, void, [ WidgetLSPAdapter<any>, VirtualDocument ]>; constructor(options: SymbolFeature.IOptions); isApplicable(widget: Widget): boolean; protected createThrottler(): Throttler<lsProtocol.DocumentSymbol[] | null, void, [WidgetLSPAdapter<any>, VirtualDocument]>; private _getSymbols; private _handleSymbols; } export declare namespace SymbolFeature { interface IOptions extends Feature.IOptions { settings: FeatureSettings<LSPSymbolSettings>; renderMimeRegistry: IRenderMimeRegistry; editorExtensionRegistry: IEditorExtensionRegistry; contextAssembler: ContextAssembler; tocRegistry: ITableOfContentsRegistry | null; editorTracker: IEditorTracker | null; } const id: string; } export declare const SYMBOL_PLUGIN: JupyterFrontEndPlugin<void>;