diff options
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 6e0f7f41..3691da68 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -373,4 +373,15 @@ function M.get_other_matching_providers(filetype) return other_matching_configs end +function M.get_clients_from_cmd_args(arg) + local result = {} + for id in (arg or ''):gmatch '(%d+) %((%w+)%)' do + result[id] = vim.lsp.get_client_by_id(tonumber(id)) + end + if vim.tbl_isempty(result) then + return vim.lsp.get_active_clients() + end + return vim.tbl_values(result) +end + return M |
