UNPKG

3.11 kBTypeScriptView Raw
1import { FileSystemWatcher as VFileSystemWatcher, WorkspaceFolder as VWorkspaceFolder } from 'vscode';
2import { ClientCapabilities, ConfigurationRequest, DidChangeConfigurationRegistrationOptions, RegistrationType } from 'vscode-languageserver-protocol';
3import { StaticFeature, FeatureClient, FeatureState, DynamicFeature, RegistrationData } from './features';
4export interface ConfigurationMiddleware {
5 configuration?: ConfigurationRequest.MiddlewareSignature;
6}
7interface ConfigurationWorkspaceMiddleware {
8 workspace?: ConfigurationMiddleware;
9}
10/**
11 * Configuration pull model. From server to client.
12 */
13export declare class ConfigurationFeature implements StaticFeature {
14 private readonly _client;
15 constructor(client: FeatureClient<ConfigurationWorkspaceMiddleware>);
16 getState(): FeatureState;
17 fillClientCapabilities(capabilities: ClientCapabilities): void;
18 initialize(): void;
19 private getConfiguration;
20 clear(): void;
21}
22export declare function toJSONObject(obj: any): any;
23export interface DidChangeConfigurationSignature {
24 (this: void, sections: string[] | undefined): Promise<void>;
25}
26export interface DidChangeConfigurationMiddleware {
27 didChangeConfiguration?: (this: void, sections: string[] | undefined, next: DidChangeConfigurationSignature) => Promise<void>;
28}
29interface DidChangeConfigurationWorkspaceMiddleware {
30 workspace?: DidChangeConfigurationMiddleware;
31}
32export type SynchronizeOptions = {
33 /**
34 * The configuration sections to synchronize. Pushing settings from the
35 * client to the server is deprecated in favour of the new pull model
36 * that allows servers to query settings scoped on resources. In this
37 * model the client can only deliver an empty change event since the
38 * actually setting value can vary on the provided resource scope.
39 *
40 * @deprecated Use the new pull model (`workspace/configuration` request)
41 */
42 configurationSection?: string | string[];
43 /**
44 * Asks the client to send file change events to the server. Watchers
45 * operate on workspace folders. The LSP client doesn't support watching
46 * files outside a workspace folder.
47 */
48 fileEvents?: VFileSystemWatcher | VFileSystemWatcher[];
49};
50export type $ConfigurationOptions = {
51 synchronize?: SynchronizeOptions;
52 workspaceFolder?: VWorkspaceFolder;
53};
54export declare class SyncConfigurationFeature implements DynamicFeature<DidChangeConfigurationRegistrationOptions> {
55 private _client;
56 private isCleared;
57 private readonly _listeners;
58 constructor(_client: FeatureClient<DidChangeConfigurationWorkspaceMiddleware, $ConfigurationOptions>);
59 getState(): FeatureState;
60 get registrationType(): RegistrationType<DidChangeConfigurationRegistrationOptions>;
61 fillClientCapabilities(capabilities: ClientCapabilities): void;
62 initialize(): void;
63 register(data: RegistrationData<DidChangeConfigurationRegistrationOptions>): void;
64 unregister(id: string): void;
65 clear(): void;
66 private onDidChangeConfiguration;
67 private extractSettingsInformation;
68}
69export {};