-
Notifications
You must be signed in to change notification settings - Fork 385
Expand file tree
/
Copy pathprotocol.workspaceFolder.ts
More file actions
106 lines (94 loc) · 3.84 KB
/
protocol.workspaceFolder.ts
File metadata and controls
106 lines (94 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { WorkspaceFolder } from 'vscode-languageserver-types';
import { RequestHandler0, NotificationHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType, CM } from './messages';
export interface WorkspaceFoldersInitializeParams {
/**
* The workspace folders configured in the client when the server starts.
*
* This property is only available if the client supports workspace folders.
* It can be `null` if the client supports workspace folders but none are
* configured.
*
* @since 3.6.0
*/
workspaceFolders?: WorkspaceFolder[] | null;
}
export interface WorkspaceFoldersClientCapabilities {
/**
* The client has support for workspace folder change notifications.
*
* @since 3.18.0
*/
changeNotifications?: {
/**
* Whether the client supports dynamic registration for the
* `workspace/didChangeWorkspaceFolders` notification.
*/
dynamicRegistration?: boolean;
};
}
export interface WorkspaceFoldersServerCapabilities {
/**
* The server has support for workspace folders
*/
supported?: boolean;
/**
* Whether the server wants to receive workspace folder
* change notifications.
*
* If a string is provided the string is treated as an ID
* under which the notification is registered on the client
* side. The ID can be used to unregister for these events
* using the `client/unregisterCapability` request.
*/
changeNotifications?: string | boolean;
}
/**
* The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
*/
export namespace WorkspaceFoldersRequest {
export const method: 'workspace/workspaceFolders' = 'workspace/workspaceFolders';
export const messageDirection: MessageDirection = MessageDirection.serverToClient;
export const type = new ProtocolRequestType0<WorkspaceFolder[] | null, never, void, void>(method);
export type HandlerSignature = RequestHandler0<WorkspaceFolder[] | null, void>;
export type MiddlewareSignature = (token: CancellationToken, next: HandlerSignature) => HandlerResult<WorkspaceFolder[] | null, void>;
export const capabilities = CM.create('workspace.workspaceFolders', 'workspace.workspaceFolders');
}
/**
* The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
* folder configuration changes.
*/
export namespace DidChangeWorkspaceFoldersNotification {
export const method: 'workspace/didChangeWorkspaceFolders' = 'workspace/didChangeWorkspaceFolders';
export const messageDirection: MessageDirection = MessageDirection.clientToServer;
export const type = new ProtocolNotificationType<DidChangeWorkspaceFoldersParams, void>(method);
export type HandlerSignature = NotificationHandler<DidChangeWorkspaceFoldersParams>;
export type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
export const capabilities = CM.create('workspace.workspaceFolders.changeNotifications', 'workspace.workspaceFolders.changeNotifications');
}
/**
* The parameters of a `workspace/didChangeWorkspaceFolders` notification.
*/
export interface DidChangeWorkspaceFoldersParams {
/**
* The actual workspace folder change event.
*/
event: WorkspaceFoldersChangeEvent;
}
/**
* The workspace folder change event.
*/
export interface WorkspaceFoldersChangeEvent {
/**
* The array of added workspace folders
*/
added: WorkspaceFolder[];
/**
* The array of the removed workspace folders
*/
removed: WorkspaceFolder[];
}