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
This commit is contained in:
Michael Lingelbach
2020-11-25 12:07:02 -08:00
committed by GitHub
parent 2d5dd85eef
commit 0d83a1c43f
5 changed files with 100 additions and 1 deletions

View File

@@ -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.