codemirror-languageservice
Version:
Integrate a Language Server Protocol compatible language service into CodeMirror
30 lines • 1.22 kB
TypeScript
import { type HoverTooltipSource } from '@codemirror/view';
import { type Hover, type Position } from 'vscode-languageserver-protocol';
import { type TextDocument } from 'vscode-languageserver-textdocument';
import { fromMarkupContent } from './markup-content.js';
import { type LSPResult } from './types.js';
export declare namespace createHoverTooltipSource {
interface Options extends fromMarkupContent.Options {
/**
* Provide LSP hover info.
*
* @param textDocument
* The text document for which to provide hover info.
* @param position
* The position for which to provide hover info.
* @returns
* The hover info for the given document and position.
*/
doHover: (textDocument: TextDocument, position: Position) => LSPResult<Hover>;
}
}
/**
* Create an LSP based hover tooltip provider.
*
* @param options
* Options to configure the hover tooltips.
* @returns
* A CodeMirror hover tooltip source that uses LSP based hover information.
*/
export declare function createHoverTooltipSource(options: createHoverTooltipSource.Options): HoverTooltipSource;
//# sourceMappingURL=hover-tooltip.d.ts.map