diff options
| author | Jose Alvarez <j.alvarez11@icloud.com> | 2021-12-21 18:13:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-21 15:13:58 -0800 |
| commit | 6c94309c999bccade9d86b6ad3ac60b86d8a94c9 (patch) | |
| tree | 9eea9c87635a9a15299b45128abaacdab54086a7 /lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar.gz nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar.bz2 nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar.lz nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar.xz nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.tar.zst nvim-lspconfig-6c94309c999bccade9d86b6ad3ac60b86d8a94c9.zip | |
fix: only stop/restart managed clients on :LspStop/:LspRestart (#1591)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 477a41f5..917cc765 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -388,7 +388,7 @@ function M.get_clients_from_cmd_args(arg) result[id] = vim.lsp.get_client_by_id(tonumber(id)) end if vim.tbl_isempty(result) then - return vim.lsp.get_active_clients() + return M.get_managed_clients() end return vim.tbl_values(result) end @@ -401,4 +401,15 @@ function M.get_active_client_by_name(bufnr, servername) end end +function M.get_managed_clients() + local configs = require 'lspconfig.configs' + local clients = {} + for _, config in pairs(configs) do + if config.manager then + vim.list_extend(clients, config.manager.clients()) + end + end + return clients +end + return M |
