aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2020-11-25 12:07:02 -0800
committerGitHub <noreply@github.com>2020-11-25 21:07:02 +0100
commit0d83a1c43fbcefae5c96b53e81528553bba5a1ab (patch)
tree45d12288fee1f64dadfa53c24d73dedd52a80a00 /runtime/lua/vim/lsp/protocol.lua
parent2d5dd85eef3be0a0a4073964ddbb849c586bc6a1 (diff)
downloadrneovim-0d83a1c43fbcefae5c96b53e81528553bba5a1ab.tar.gz
rneovim-0d83a1c43fbcefae5c96b53e81528553bba5a1ab.tar.bz2
rneovim-0d83a1c43fbcefae5c96b53e81528553bba5a1ab.zip
LSP: Feature/add workspace folders (#12638)
* First implementation of workspace folders * Add completion for current directory * Add tracking of workspace folders * Add workspace folder listing * Add checks on adding/removing workspaces * Add appropriate initialization options * Add documentation * Make workspaceFolders available wherever client is
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