Skip to content

Commit 87aa6ea

Browse files
committed
Add WorkspaceFoldersClientCapabilities
1 parent df05883 commit 87aa6ea

File tree

3 files changed

+57
-5
lines changed

3 files changed

+57
-5
lines changed

protocol/metaModel.json

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,6 +2081,7 @@
20812081
"method": "workspace/didChangeWorkspaceFolders",
20822082
"typeName": "DidChangeWorkspaceFoldersNotification",
20832083
"messageDirection": "clientToServer",
2084+
"clientCapability": "workspace.workspaceFolders.changeNotifications",
20842085
"serverCapability": "workspace.workspaceFolders.changeNotifications",
20852086
"params": {
20862087
"kind": "reference",
@@ -11206,8 +11207,17 @@
1120611207
{
1120711208
"name": "workspaceFolders",
1120811209
"type": {
11209-
"kind": "base",
11210-
"name": "boolean"
11210+
"kind": "or",
11211+
"items": [
11212+
{
11213+
"kind": "base",
11214+
"name": "boolean"
11215+
},
11216+
{
11217+
"kind": "reference",
11218+
"name": "WorkspaceFoldersClientCapabilities"
11219+
}
11220+
]
1121111221
},
1121211222
"optional": true,
1121311223
"documentation": "The client has support for workspace folders.\n\n@since 3.6.0",
@@ -12256,6 +12266,33 @@
1225612266
],
1225712267
"documentation": "The client capabilities of a {@link ExecuteCommandRequest}."
1225812268
},
12269+
{
12270+
"name": "WorkspaceFoldersClientCapabilities",
12271+
"properties": [
12272+
{
12273+
"name": "changeNotifications",
12274+
"type": {
12275+
"kind": "literal",
12276+
"value": {
12277+
"properties": [
12278+
{
12279+
"name": "dynamicRegistration",
12280+
"type": {
12281+
"kind": "base",
12282+
"name": "boolean"
12283+
},
12284+
"optional": true,
12285+
"documentation": "Whether the client supports dynamic registration for the\n`workspace/didChangeWorkspaceFolders` notification."
12286+
}
12287+
]
12288+
}
12289+
},
12290+
"optional": true,
12291+
"documentation": "The client has support for workspace folder change notifications.\n\n@since 3.18.0",
12292+
"since": "3.18.0"
12293+
}
12294+
]
12295+
},
1225912296
{
1226012297
"name": "SemanticTokensWorkspaceClientCapabilities",
1226112298
"properties": [

protocol/src/common/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131

3232
import {
3333
WorkspaceFoldersRequest, DidChangeWorkspaceFoldersNotification, DidChangeWorkspaceFoldersParams,
34-
WorkspaceFoldersChangeEvent, WorkspaceFoldersInitializeParams, WorkspaceFoldersServerCapabilities
34+
WorkspaceFoldersChangeEvent, WorkspaceFoldersInitializeParams, WorkspaceFoldersClientCapabilities, WorkspaceFoldersServerCapabilities
3535
} from './protocol.workspaceFolder';
3636

3737
import {
@@ -605,7 +605,7 @@ export interface WorkspaceClientCapabilities {
605605
*
606606
* @since 3.6.0
607607
*/
608-
workspaceFolders?: boolean;
608+
workspaceFolders?: boolean | WorkspaceFoldersClientCapabilities;
609609

610610
/**
611611
* The client supports `workspace/configuration` requests.

protocol/src/common/protocol.workspaceFolder.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ export interface WorkspaceFoldersInitializeParams {
2121
workspaceFolders?: WorkspaceFolder[] | null;
2222
}
2323

24+
export interface WorkspaceFoldersClientCapabilities {
25+
/**
26+
* The client has support for workspace folder change notifications.
27+
*
28+
* @since 3.18.0
29+
*/
30+
changeNotifications?: {
31+
/**
32+
* Whether the client supports dynamic registration for the
33+
* `workspace/didChangeWorkspaceFolders` notification.
34+
*/
35+
dynamicRegistration?: boolean;
36+
};
37+
}
38+
2439
export interface WorkspaceFoldersServerCapabilities {
2540

2641
/**
@@ -62,7 +77,7 @@ export namespace DidChangeWorkspaceFoldersNotification {
6277
export const type = new ProtocolNotificationType<DidChangeWorkspaceFoldersParams, void>(method);
6378
export type HandlerSignature = NotificationHandler<DidChangeWorkspaceFoldersParams>;
6479
export type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
65-
export const capabilities = CM.create(undefined, 'workspace.workspaceFolders.changeNotifications');
80+
export const capabilities = CM.create('workspace.workspaceFolders.changeNotifications', 'workspace.workspaceFolders.changeNotifications');
6681
}
6782

6883
/**

0 commit comments

Comments
 (0)