aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 07b4e8b926..1f21bd7eb0 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -716,6 +716,7 @@ function protocol.make_client_capabilities()
};
hierarchicalWorkspaceSymbolSupport = true;
};
+ workspaceFolders = true;
applyEdit = true;
};
callHierarchy = {
@@ -974,6 +975,28 @@ function protocol.resolve_capabilities(server_capabilities)
error("The server sent invalid implementationProvider")
end
+ local workspace = server_capabilities.workspace
+ local workspace_properties = {}
+ if workspace == nil or workspace.workspaceFolders == nil then
+ -- Defaults if omitted.
+ workspace_properties = {
+ workspace_folder_properties = {
+ supported = false;
+ changeNotifications=false;
+ }
+ }
+ elseif type(workspace.workspaceFolders) == 'table' then
+ workspace_properties = {
+ workspace_folder_properties = {
+ supported = vim.F.ifnil(workspace.workspaceFolders.supported, false);
+ changeNotifications = vim.F.ifnil(workspace.workspaceFolders.changeNotifications, false);
+
+ }
+ }
+ else
+ error("The server sent invalid workspace")
+ end
+
local signature_help_properties
if server_capabilities.signatureHelpProvider == nil then
signature_help_properties = {
@@ -993,6 +1016,7 @@ function protocol.resolve_capabilities(server_capabilities)
return vim.tbl_extend("error"
, text_document_sync_properties
, signature_help_properties
+ , workspace_properties
, general_properties
)
end