diff options
author | Michael Lingelbach <m.j.lbach@gmail.com> | 2020-11-25 12:07:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 21:07:02 +0100 |
commit | 0d83a1c43fbcefae5c96b53e81528553bba5a1ab (patch) | |
tree | 45d12288fee1f64dadfa53c24d73dedd52a80a00 /runtime/lua/vim/lsp.lua | |
parent | 2d5dd85eef3be0a0a4073964ddbb849c586bc6a1 (diff) | |
download | rneovim-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.lua')
-rw-r--r-- | runtime/lua/vim/lsp.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index dacdbcfa17..92f56b2ddf 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -597,7 +597,10 @@ function lsp.start_client(config) -- -- workspace folder in the user interface. -- name -- } - workspaceFolders = nil; + workspaceFolders = {{ + uri = vim.uri_from_fname(config.root_dir); + name = string.format("%s", config.root_dir); + }}; } if config.before_init then -- TODO(ashkan) handle errors here. @@ -610,6 +613,7 @@ function lsp.start_client(config) rpc.notify('initialized', {[vim.type_idx]=vim.types.dictionary}) client.initialized = true uninitialized_clients[client_id] = nil + client.workspaceFolders = initialize_params.workspaceFolders client.server_capabilities = assert(result.capabilities, "initialize result doesn't contain capabilities") -- These are the cleaned up capabilities we use for dynamically deciding -- when to send certain events to clients. |