diff options
| author | Vsevolod <kefirchik3@gmail.com> | 2021-10-18 02:13:21 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-17 16:13:21 -0700 |
| commit | a209627886c3edc6926bede732543f9c09aaf22c (patch) | |
| tree | 088da10576a493acb63740a19b1dbd2ce95474e2 /lua/lspconfig/util.lua | |
| parent | docs: update CONFIG.md (diff) | |
| download | nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar.gz nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar.bz2 nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar.lz nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar.xz nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.tar.zst nvim-lspconfig-a209627886c3edc6926bede732543f9c09aaf22c.zip | |
feat: improve interface for `:Lsp*` commands (#1324)
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 |
