From 6c94309c999bccade9d86b6ad3ac60b86d8a94c9 Mon Sep 17 00:00:00 2001 From: Jose Alvarez Date: Tue, 21 Dec 2021 18:13:58 -0500 Subject: fix: only stop/restart managed clients on :LspStop/:LspRestart (#1591) --- lua/lspconfig/util.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lua') 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 -- cgit v1.2.3-70-g09d2