From c9e2adbbc8fd7a5398c8c66d21f0e02dc7b60203 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 8 Nov 2021 23:13:05 +0100 Subject: Add new lunarvin updates --- .config/nvim/lua/lsp/utils.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to '.config/nvim/lua/lsp/utils.lua') 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 -- cgit v1.2.3-70-g09d2