Declare workspaceFolders support in server capabilities (#4666)

* Declare workspaceFolders support in server capabilities

The `vscode-languageserver-node` dependency will attempt dynamic
capability registration for workspace folder change notifications
if this `workspace.workspaceFolders.changeNotifications` is not set
in the `InitializeResult`. That is problematic for clients that don't
support dynamic capability registration: if we send a JSONRPC error,
the server will exit because of the rejected promise.

The server has support for workspace folders and requests and uses
change notifications as far as I can see, so I believe it's more
correct to declare support for these up-front anyways.

* Fix formatting

---------

Co-authored-by: Heejae Chang <1333179+heejaechang@users.noreply.github.com>
Co-authored-by: Eric Traut <eric@traut.com>
This commit is contained in:
Michael Davis 2023-03-01 15:18:45 -06:00 committed by GitHub
parent 02b4c17b24
commit 7ef5bf86f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,6 +756,12 @@ export abstract class LanguageServerBase implements LanguageServerInterface {
workDoneProgress: true,
},
callHierarchyProvider: true,
workspace: {
workspaceFolders: {
supported: true,
changeNotifications: true,
},
},
},
};