UNPKG

2.9 kBTypeScriptView Raw
1import { WorkspaceFolder } from 'vscode-languageserver-types';
2import { RequestHandler0, NotificationHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
3import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType } from './messages';
4export interface WorkspaceFoldersInitializeParams {
5 /**
6 * The workspace folders configured in the client when the server starts.
7 *
8 * This property is only available if the client supports workspace folders.
9 * It can be `null` if the client supports workspace folders but none are
10 * configured.
11 *
12 * @since 3.6.0
13 */
14 workspaceFolders?: WorkspaceFolder[] | null;
15}
16export interface WorkspaceFoldersServerCapabilities {
17 /**
18 * The server has support for workspace folders
19 */
20 supported?: boolean;
21 /**
22 * Whether the server wants to receive workspace folder
23 * change notifications.
24 *
25 * If a string is provided the string is treated as an ID
26 * under which the notification is registered on the client
27 * side. The ID can be used to unregister for these events
28 * using the `client/unregisterCapability` request.
29 */
30 changeNotifications?: string | boolean;
31}
32/**
33 * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
34 */
35export declare namespace WorkspaceFoldersRequest {
36 const method: 'workspace/workspaceFolders';
37 const messageDirection: MessageDirection;
38 const type: ProtocolRequestType0<WorkspaceFolder[] | null, never, void, void>;
39 type HandlerSignature = RequestHandler0<WorkspaceFolder[] | null, void>;
40 type MiddlewareSignature = (token: CancellationToken, next: HandlerSignature) => HandlerResult<WorkspaceFolder[] | null, void>;
41}
42/**
43 * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
44 * folder configuration changes.
45 */
46export declare namespace DidChangeWorkspaceFoldersNotification {
47 const method: 'workspace/didChangeWorkspaceFolders';
48 const messageDirection: MessageDirection;
49 const type: ProtocolNotificationType<DidChangeWorkspaceFoldersParams, void>;
50 type HandlerSignature = NotificationHandler<DidChangeWorkspaceFoldersParams>;
51 type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
52}
53/**
54 * The parameters of a `workspace/didChangeWorkspaceFolders` notification.
55 */
56export interface DidChangeWorkspaceFoldersParams {
57 /**
58 * The actual workspace folder change event.
59 */
60 event: WorkspaceFoldersChangeEvent;
61}
62/**
63 * The workspace folder change event.
64 */
65export interface WorkspaceFoldersChangeEvent {
66 /**
67 * The array of added workspace folders
68 */
69 added: WorkspaceFolder[];
70 /**
71 * The array of the removed workspace folders
72 */
73 removed: WorkspaceFolder[];
74}