UNPKG

1.92 kBTypeScriptView Raw
1import { RequestHandler } from 'vscode-jsonrpc';
2import { TextDocumentIdentifier, Position, SelectionRange } from 'vscode-languageserver-types';
3import { MessageDirection, ProtocolRequestType } from './messages';
4import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistrationOptions, WorkDoneProgressParams, PartialResultParams } from './protocol';
5export interface SelectionRangeClientCapabilities {
6 /**
7 * Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
8 * the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
9 * capability as well.
10 */
11 dynamicRegistration?: boolean;
12}
13export interface SelectionRangeOptions extends WorkDoneProgressOptions {
14}
15export interface SelectionRangeRegistrationOptions extends SelectionRangeOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
16}
17/**
18 * A parameter literal used in selection range requests.
19 */
20export interface SelectionRangeParams extends WorkDoneProgressParams, PartialResultParams {
21 /**
22 * The text document.
23 */
24 textDocument: TextDocumentIdentifier;
25 /**
26 * The positions inside the text document.
27 */
28 positions: Position[];
29}
30/**
31 * A request to provide selection ranges in a document. The request's
32 * parameter is of type {@link SelectionRangeParams}, the
33 * response is of type {@link SelectionRange SelectionRange[]} or a Thenable
34 * that resolves to such.
35 */
36export declare namespace SelectionRangeRequest {
37 const method: 'textDocument/selectionRange';
38 const messageDirection: MessageDirection;
39 const type: ProtocolRequestType<SelectionRangeParams, SelectionRange[] | null, SelectionRange[], void, SelectionRangeRegistrationOptions>;
40 type HandlerSignature = RequestHandler<SelectionRangeParams, SelectionRange[] | null, void>;
41}