diff options
| author | Raphael <glepnir@neovim.pro> | 2022-12-20 14:27:21 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-20 14:27:21 +0800 |
| commit | d597b0f3605f43526f1b6948c6d7ca2919ea32ac (patch) | |
| tree | 6839b289225c4969840fafee7f6c0894f2b2d1da /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar.gz nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar.bz2 nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar.lz nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar.xz nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.tar.zst nvim-lspconfig-d597b0f3605f43526f1b6948c6d7ca2919ea32ac.zip | |
fix: send the lsp method request after insert workspace folders (#2330)
* fix: send the lsp method request after insert workspace folders
* fix: use client do rpc request
* fix: check client support workspace
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index b38b8ec6..fcf286d0 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -257,7 +257,13 @@ function M.server_per_root_dir_manager(make_config) return end local client = lsp.get_client_by_id(id) - if client and client.name == conf.name then + if + client + and client.server_capabilities + and client.server_capabilities.workspaceFolders + and client.server_capabilities.workspaceFolders.supported + and client.name == conf.name + then return client end return nil @@ -272,6 +278,7 @@ function M.server_per_root_dir_manager(make_config) { { uri = vim.uri_from_fname(root_dir), name = root_dir } }, { {} } ) + client.rpc.notify('workspace/didChangeWorkspaceFolders', params) if not client.workspace_folders then client.workspace_folders = {} end |
