UNPKG

@jupyter-lsp/jupyterlab-lsp

Version:

Language Server Protocol integration for JupyterLab

22 lines (21 loc) 690 B
import { EditorView, Decoration } from '@codemirror/view'; export interface IMark<Kinds> { from: number; to: number; kind: Kinds; } /** * Manage marks in multiple editor views (e.g. cells). */ export interface ISimpleMarkManager<Kinds> { putMarks(view: EditorView, positions: IMark<Kinds>[]): void; /** * Clear marks from all editor views. */ clearAllMarks(): void; clearEditorMarks(view: EditorView): void; } export type MarkDecorationSpec = Parameters<typeof Decoration.mark>[0] & { class: string; }; export declare function createMarkManager<Kinds extends string | number>(specs: Record<Kinds, MarkDecorationSpec>): ISimpleMarkManager<Kinds>;