UNPKG

1.13 kBTypeScriptView Raw
1import { Point, TextEditor, Range } from "atom";
2import { LanguageClientConnection, ServerCapabilities } from "../languageclient";
3export default class CodeHighlightAdapter {
4 /** @returns A {Boolean} indicating this adapter can adapt the server based on the given serverCapabilities. */
5 static canAdapt(serverCapabilities: ServerCapabilities): boolean;
6 /**
7 * Public: Creates highlight markers for a given editor position. Throws an error if documentHighlightProvider is not
8 * a registered capability.
9 *
10 * @param connection A {LanguageClientConnection} to the language server that provides highlights.
11 * @param serverCapabilities The {ServerCapabilities} of the language server that will be used.
12 * @param editor The Atom {TextEditor} containing the text to be highlighted.
13 * @param position The Atom {Point} to fetch highlights for.
14 * @returns A {Promise} of an {Array} of {Range}s to be turned into highlights.
15 */
16 static highlight(connection: LanguageClientConnection, serverCapabilities: ServerCapabilities, editor: TextEditor, position: Point): Promise<Range[]>;
17}