-
Notifications
You must be signed in to change notification settings - Fork 327
/
protocol.inlayHint.ts
132 lines (118 loc) · 4.16 KB
/
protocol.inlayHint.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { Range, TextDocumentIdentifier, InlayHint } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import type { StaticRegistrationOptions, TextDocumentRegistrationOptions, WorkDoneProgressOptions, WorkDoneProgressParams } from './protocol';
/**
* @since 3.18.0
*/
export type ClientInlayHintResolveOptions = {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
};
/**
* Inlay hint client capabilities.
*
* @since 3.17.0
*/
export type InlayHintClientCapabilities = {
/**
* Whether inlay hints support dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Indicates which properties a client can resolve lazily on an inlay
* hint.
*/
resolveSupport?: ClientInlayHintResolveOptions;
};
/**
* Client workspace capabilities specific to inlay hints.
*
* @since 3.17.0
*/
export type InlayHintWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from
* the server to the client.
*
* Note that this event is global and will force the client to refresh all
* inlay hints currently shown. It should be used with absolute care and
* is useful for situation where a server for example detects a project wide
* change that requires such a calculation.
*/
refreshSupport?: boolean;
};
/**
* Inlay hint options used during static registration.
*
* @since 3.17.0
*/
export type InlayHintOptions = WorkDoneProgressOptions & {
/**
* The server provides support to resolve additional
* information for an inlay hint item.
*/
resolveProvider?: boolean;
};
/**
* Inlay hint options used during static or dynamic registration.
*
* @since 3.17.0
*/
export type InlayHintRegistrationOptions = InlayHintOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inlay hint requests.
*
* @since 3.17.0
*/
export type InlayHintParams = WorkDoneProgressParams & {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The document range for which inlay hints should be computed.
*/
range: Range;
};
/**
* A request to provide inlay hints in a document. The request's parameter is of
* type {@link InlayHintsParams}, the response is of type
* {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
export namespace InlayHintRequest {
export const method: 'textDocument/inlayHint' = 'textDocument/inlayHint';
export const messageDirection: MessageDirection = MessageDirection.clientToServer;
export const type = new ProtocolRequestType<InlayHintParams, InlayHint[] | null, InlayHint[], void, InlayHintRegistrationOptions>(method);
export type HandlerSignature = RequestHandler<InlayHintParams, InlayHint[] | null, void>;
}
/**
* A request to resolve additional properties for an inlay hint.
* The request's parameter is of type {@link InlayHint}, the response is
* of type {@link InlayHint} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
export namespace InlayHintResolveRequest {
export const method: 'inlayHint/resolve' = 'inlayHint/resolve';
export const messageDirection: MessageDirection = MessageDirection.clientToServer;
export const type = new ProtocolRequestType<InlayHint, InlayHint, never, void, void>(method);
export type HandlerSignature = RequestHandler<InlayHint, InlayHint, void>;
}
/**
* @since 3.17.0
*/
export namespace InlayHintRefreshRequest {
export const method: `workspace/inlayHint/refresh` = `workspace/inlayHint/refresh`;
export const messageDirection: MessageDirection = MessageDirection.serverToClient;
export const type = new ProtocolRequestType0<void, void, void, void>(method);
export type HandlerSignature = RequestHandler0<void, void>;
}