UNPKG

1.93 kBTypeScriptView Raw
1import { RequestHandler } from 'vscode-jsonrpc';
2import { Declaration, DeclarationLink, Location, LocationLink } from 'vscode-languageserver-types';
3import { MessageDirection, ProtocolRequestType } from './messages';
4import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
5/**
6 * @since 3.14.0
7 */
8export interface DeclarationClientCapabilities {
9 /**
10 * Whether declaration supports dynamic registration. If this is set to `true`
11 * the client supports the new `DeclarationRegistrationOptions` return value
12 * for the corresponding server capability as well.
13 */
14 dynamicRegistration?: boolean;
15 /**
16 * The client supports additional metadata in the form of declaration links.
17 */
18 linkSupport?: boolean;
19}
20export interface DeclarationOptions extends WorkDoneProgressOptions {
21}
22export interface DeclarationRegistrationOptions extends DeclarationOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
23}
24export interface DeclarationParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
25}
26/**
27 * A request to resolve the type definition locations of a symbol at a given text
28 * document position. The request's parameter is of type {@link TextDocumentPositionParams}
29 * the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
30 * or a Thenable that resolves to such.
31 */
32export declare namespace DeclarationRequest {
33 const method: 'textDocument/declaration';
34 const messageDirection: MessageDirection;
35 const type: ProtocolRequestType<DeclarationParams, Declaration | LocationLink[] | null, Location[] | LocationLink[], void, DeclarationRegistrationOptions>;
36 type HandlerSignature = RequestHandler<DeclarationParams, Declaration | DeclarationLink[] | null, void>;
37}