UNPKG

3.02 kBTypeScriptView Raw
1import { TextDocumentIdentifier, Range, InlineValue, InlineValueContext } from 'vscode-languageserver-types';
2import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
3import { MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
4import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistrationOptions, WorkDoneProgressParams } from './protocol';
5/**
6 * Client capabilities specific to inline values.
7 *
8 * @since 3.17.0
9 */
10export type InlineValueClientCapabilities = {
11 /**
12 * Whether implementation supports dynamic registration for inline value providers.
13 */
14 dynamicRegistration?: boolean;
15};
16/**
17 * Client workspace capabilities specific to inline values.
18 *
19 * @since 3.17.0
20 */
21export type InlineValueWorkspaceClientCapabilities = {
22 /**
23 * Whether the client implementation supports a refresh request sent from the
24 * server to the client.
25 *
26 * Note that this event is global and will force the client to refresh all
27 * inline values currently shown. It should be used with absolute care and is
28 * useful for situation where a server for example detects a project wide
29 * change that requires such a calculation.
30 */
31 refreshSupport?: boolean;
32};
33/**
34 * Inline value options used during static registration.
35 *
36 * @since 3.17.0
37 */
38export type InlineValueOptions = WorkDoneProgressOptions;
39/**
40 * Inline value options used during static or dynamic registration.
41 *
42 * @since 3.17.0
43 */
44export type InlineValueRegistrationOptions = InlineValueOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
45/**
46 * A parameter literal used in inline value requests.
47 *
48 * @since 3.17.0
49 */
50export type InlineValueParams = WorkDoneProgressParams & {
51 /**
52 * The text document.
53 */
54 textDocument: TextDocumentIdentifier;
55 /**
56 * The document range for which inline values should be computed.
57 */
58 range: Range;
59 /**
60 * Additional information about the context in which inline values were
61 * requested.
62 */
63 context: InlineValueContext;
64};
65/**
66 * A request to provide inline values in a document. The request's parameter is of
67 * type {@link InlineValueParams}, the response is of type
68 * {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
69 *
70 * @since 3.17.0
71 */
72export declare namespace InlineValueRequest {
73 const method: 'textDocument/inlineValue';
74 const messageDirection: MessageDirection;
75 const type: ProtocolRequestType<InlineValueParams, InlineValue[] | null, InlineValue[], void, InlineValueRegistrationOptions>;
76 type HandlerSignature = RequestHandler<InlineValueParams, InlineValue[] | null, void>;
77}
78/**
79 * @since 3.17.0
80 */
81export declare namespace InlineValueRefreshRequest {
82 const method: `workspace/inlineValue/refresh`;
83 const messageDirection: MessageDirection;
84 const type: ProtocolRequestType0<void, void, void, void>;
85 type HandlerSignature = RequestHandler0<void, void>;
86}