UNPKG

3.32 kBTypeScriptView Raw
1import { MessageDirection, ProtocolRequestType } from './messages';
2import type { WorkDoneProgressOptions, WorkDoneProgressParams, PartialResultParams, TextDocumentRegistrationOptions, TextDocumentPositionParams } from './protocol';
3/**
4 * Moniker uniqueness level to define scope of the moniker.
5 *
6 * @since 3.16.0
7 */
8export declare namespace UniquenessLevel {
9 /**
10 * The moniker is only unique inside a document
11 */
12 const document = "document";
13 /**
14 * The moniker is unique inside a project for which a dump got created
15 */
16 const project = "project";
17 /**
18 * The moniker is unique inside the group to which a project belongs
19 */
20 const group = "group";
21 /**
22 * The moniker is unique inside the moniker scheme.
23 */
24 const scheme = "scheme";
25 /**
26 * The moniker is globally unique
27 */
28 const global = "global";
29}
30export type UniquenessLevel = 'document' | 'project' | 'group' | 'scheme' | 'global';
31/**
32 * The moniker kind.
33 *
34 * @since 3.16.0
35 */
36export declare namespace MonikerKind {
37 /**
38 * The moniker represent a symbol that is imported into a project
39 */
40 const $import = "import";
41 /**
42 * The moniker represents a symbol that is exported from a project
43 */
44 const $export = "export";
45 /**
46 * The moniker represents a symbol that is local to a project (e.g. a local
47 * variable of a function, a class not visible outside the project, ...)
48 */
49 const local = "local";
50}
51export type MonikerKind = 'import' | 'export' | 'local';
52/**
53 * Moniker definition to match LSIF 0.5 moniker definition.
54 *
55 * @since 3.16.0
56 */
57export interface Moniker {
58 /**
59 * The scheme of the moniker. For example tsc or .Net
60 */
61 scheme: string;
62 /**
63 * The identifier of the moniker. The value is opaque in LSIF however
64 * schema owners are allowed to define the structure if they want.
65 */
66 identifier: string;
67 /**
68 * The scope in which the moniker is unique
69 */
70 unique: UniquenessLevel;
71 /**
72 * The moniker kind if known.
73 */
74 kind?: MonikerKind;
75}
76/**
77 * Client capabilities specific to the moniker request.
78 *
79 * @since 3.16.0
80 */
81export interface MonikerClientCapabilities {
82 /**
83 * Whether moniker supports dynamic registration. If this is set to `true`
84 * the client supports the new `MonikerRegistrationOptions` return value
85 * for the corresponding server capability as well.
86 */
87 dynamicRegistration?: boolean;
88}
89export interface MonikerServerCapabilities {
90}
91export interface MonikerOptions extends WorkDoneProgressOptions {
92}
93export interface MonikerRegistrationOptions extends TextDocumentRegistrationOptions, MonikerOptions {
94}
95export interface MonikerParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
96}
97/**
98 * A request to get the moniker of a symbol at a given text document position.
99 * The request parameter is of type {@link TextDocumentPositionParams}.
100 * The response is of type {@link Moniker Moniker[]} or `null`.
101 */
102export declare namespace MonikerRequest {
103 const method: 'textDocument/moniker';
104 const messageDirection: MessageDirection;
105 const type: ProtocolRequestType<MonikerParams, Moniker[] | null, Moniker[], void, MonikerRegistrationOptions>;
106}