aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/util.lua16
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