1 | import type * as atomIde from "atom-ide-base";
|
2 | import { LanguageClientConnection, ServerCapabilities } from "../languageclient";
|
3 | import { Point, TextEditor } from "atom";
|
4 | /** Public: Adapts the language server protocol "textDocument/hover" to the Atom IDE UI Datatip package. */
|
5 | export default class DatatipAdapter {
|
6 | /**
|
7 | * Public: Determine whether this adapter can be used to adapt a language server based on the serverCapabilities
|
8 | * matrix containing a hoverProvider.
|
9 | *
|
10 | * @param serverCapabilities The {ServerCapabilities} of the language server to consider.
|
11 | * @returns A {Boolean} indicating adapter can adapt the server based on the given serverCapabilities.
|
12 | */
|
13 | static canAdapt(serverCapabilities: ServerCapabilities): boolean;
|
14 | /**
|
15 | * Public: Get the Datatip for this {Point} in a {TextEditor} by querying the language server.
|
16 | *
|
17 | * @param connection A {LanguageClientConnection} to the language server that will be queried for the hover text/datatip.
|
18 | * @param editor The Atom {TextEditor} containing the text the Datatip should relate to.
|
19 | * @param point The Atom {Point} containing the point within the text the Datatip should relate to.
|
20 | * @returns A {Promise} containing the {Datatip} to display or {null} if no Datatip is available.
|
21 | */
|
22 | getDatatip(connection: LanguageClientConnection, editor: TextEditor, point: Point): Promise<atomIde.Datatip | null>;
|
23 | private static isEmptyHover;
|
24 | private static convertMarkedString;
|
25 | }
|