diff options
| author | Rishikesh Vaishnav <rishhvaishnav@gmail.com> | 2022-06-01 07:43:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-01 07:43:01 -0700 |
| commit | c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a (patch) | |
| tree | dc6372ba298bec68bcca4af8dc96002cad234399 /lua/lspconfig/util.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar.gz nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar.bz2 nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar.lz nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar.xz nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.tar.zst nvim-lspconfig-c5dae15c0c94703a0565e8ba35a9f5cb96ca7b8a.zip | |
fix: no-argument :LspStop, :LspRestart with standalone files #1785
The no-argument versions of `:LspStop` and `:LspRestart` currently only apply to
buffers that have a valid root directory. It seems that these commands should stop/restart
all clients, including those associated with standalone files.
Closes #1784
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index a1eb75ba..88ba42f9 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -295,9 +295,10 @@ function M.server_per_root_dir_manager(make_config) return client_id end - function manager.clients() + function manager.clients(single_file) local res = {} - for _, id in pairs(clients) do + local client_list = single_file and single_file_clients or clients + for _, id in pairs(client_list) do local client = lsp.get_client_by_id(id) if client then table.insert(res, client) @@ -422,6 +423,7 @@ function M.get_managed_clients() for _, config in pairs(configs) do if config.manager then vim.list_extend(clients, config.manager.clients()) + vim.list_extend(clients, config.manager.clients(true)) end end return clients |
