diff options
| author | Raphael <glepnir@neovim.pro> | 2022-12-13 20:07:09 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-13 20:07:09 +0800 |
| commit | cbf8762f15fac03a51eaa2c6f983d4a5045c95b4 (patch) | |
| tree | e034d2d9b23a56e16609a647534340eeed22cd72 /lua | |
| parent | docs: fix typo (#2310) (diff) | |
| download | nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar.gz nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar.bz2 nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar.lz nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar.xz nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.tar.zst nvim-lspconfig-cbf8762f15fac03a51eaa2c6f983d4a5045c95b4.zip | |
fix: run all matched client in LspStart (#2314)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index f7614924..b38b8ec6 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -438,8 +438,22 @@ function M.get_other_matching_providers(filetype) return other_matching_configs end +function M.get_config_by_ft(filetype) + local configs = require 'lspconfig.configs' + local matching_configs = {} + for _, config in pairs(configs) do + local filetypes = config.filetypes or {} + for _, ft in pairs(filetypes) do + if ft == filetype then + table.insert(matching_configs, config) + end + end + end + return matching_configs +end + function M.get_active_client_by_name(bufnr, servername) - for _, client in pairs(vim.lsp.buf_get_clients(bufnr)) do + for _, client in pairs(vim.lsp.get_active_clients { bufnr = bufnr }) do if client.name == servername then return client end |
