UNPKG

1.5 kBTypeScriptView Raw
1import { RequestHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
2import { LSPAny, URI } from 'vscode-languageserver-types';
3import { MessageDirection, ProtocolRequestType } from './messages';
4/**
5 * The 'workspace/configuration' request is sent from the server to the client to fetch a certain
6 * configuration setting.
7 *
8 * This pull model replaces the old push model were the client signaled configuration change via an
9 * event. If the server still needs to react to configuration changes (since the server caches the
10 * result of `workspace/configuration` requests) the server should register for an empty configuration
11 * change event and empty the cache if such an event is received.
12 */
13export declare namespace ConfigurationRequest {
14 const method: 'workspace/configuration';
15 const messageDirection: MessageDirection;
16 const type: ProtocolRequestType<ConfigurationParams, any[], never, void, void>;
17 type HandlerSignature = RequestHandler<ConfigurationParams, LSPAny[], void>;
18 type MiddlewareSignature = (params: ConfigurationParams, token: CancellationToken, next: HandlerSignature) => HandlerResult<LSPAny[], void>;
19}
20export interface ConfigurationItem {
21 /**
22 * The scope to get the configuration section for.
23 */
24 scopeUri?: URI;
25 /**
26 * The configuration section asked for.
27 */
28 section?: string;
29}
30/**
31 * The parameters of a configuration request.
32 */
33export interface ConfigurationParams {
34 items: ConfigurationItem[];
35}