summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp/utils.lua')
-rw-r--r--.config/nvim/lua/lsp/utils.lua19
1 files changed, 12 insertions, 7 deletions
diff --git a/.config/nvim/lua/lsp/utils.lua b/.config/nvim/lua/lsp/utils.lua
index 5900340..afc3eba 100644
--- a/.config/nvim/lua/lsp/utils.lua
+++ b/.config/nvim/lua/lsp/utils.lua
@@ -49,14 +49,19 @@ function M.get_client_capabilities(client_id)
end
function M.get_supported_filetypes(server_name)
- -- print("got filetypes query request for: " .. server_name)
- local configs = require "lspconfig/configs"
- pcall(require, ("lspconfig/" .. server_name))
- for _, config in pairs(configs) do
- if config.name == server_name then
- return config.document_config.default_config.filetypes or {}
- end
+ -- temporary workaround: https://github.com/neovim/nvim-lspconfig/pull/1358
+ if server_name == "dockerls" then
+ return { "dockerfile" }
+ end
+ local lsp_installer_servers = require "nvim-lsp-installer.servers"
+ local server_available, requested_server = lsp_installer_servers.get_server(
+ server_name
+ )
+ if not server_available then
+ return {}
end
+
+ return requested_server:get_supported_filetypes()
end
return M