UNPKG

2.5 kBTypeScriptView Raw
1import type * as atomIde from "atom-ide-base";
2import { Point, TextEditor } from "atom";
3import { LanguageClientConnection, Location, ServerCapabilities, ReferenceParams } from "../languageclient";
4/**
5 * Public: Adapts the language server definition provider to the Atom IDE UI Definitions package for 'Go To Definition'
6 * functionality.
7 */
8export default class FindReferencesAdapter {
9 /**
10 * Public: Determine whether this adapter can be used to adapt a language server based on the serverCapabilities
11 * matrix containing a referencesProvider.
12 *
13 * @param serverCapabilities The {ServerCapabilities} of the language server to consider.
14 * @returns A {Boolean} indicating adapter can adapt the server based on the given serverCapabilities.
15 */
16 static canAdapt(serverCapabilities: ServerCapabilities): boolean;
17 /**
18 * Public: Get the references for a specific symbol within the document as represented by the {TextEditor} and {Point}
19 * within it via the language server.
20 *
21 * @param connection A {LanguageClientConnection} to the language server that will be queried for the references.
22 * @param editor The Atom {TextEditor} containing the text the references should relate to.
23 * @param point The Atom {Point} containing the point within the text the references should relate to.
24 * @returns A {Promise} containing a {FindReferencesReturn} with all the references the language server could find.
25 */
26 getReferences(connection: LanguageClientConnection, editor: TextEditor, point: Point, projectRoot: string | null): Promise<atomIde.FindReferencesReturn | null>;
27 /**
28 * Public: Create a {ReferenceParams} from a given {TextEditor} for a specific {Point}.
29 *
30 * @param editor A {TextEditor} that represents the document.
31 * @param point A {Point} within the document.
32 * @returns A {ReferenceParams} built from the given parameters.
33 */
34 static createReferenceParams(editor: TextEditor, point: Point): ReferenceParams;
35 /**
36 * Public: Convert a {Location} into a {Reference}.
37 *
38 * @param location A {Location} to convert.
39 * @returns A {Reference} equivalent to the given {Location}.
40 */
41 static locationToReference(location: Location): atomIde.Reference;
42 /** Public: Get a symbol name from a {TextEditor} for a specific {Point} in the document. */
43 static getReferencedSymbolName(editor: TextEditor, point: Point, references: atomIde.Reference[]): string;
44}