summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/init.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp/init.lua')
-rw-r--r--.config/nvim/lua/lsp/init.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/.config/nvim/lua/lsp/init.lua b/.config/nvim/lua/lsp/init.lua
index 42c2536..f92ecd3 100644
--- a/.config/nvim/lua/lsp/init.lua
+++ b/.config/nvim/lua/lsp/init.lua
@@ -95,17 +95,16 @@ function M.common_capabilities()
end
local function select_default_formater(client)
- local client_formatting = client.resolved_capabilities.document_formatting
- or client.resolved_capabilities.document_range_formatting
- if client.name == "null-ls" or not client_formatting then
+ if
+ client.name == "null-ls" or not client.resolved_capabilities.document_formatting
+ then
return
end
Log:debug("Checking for formatter overriding for " .. client.name)
+ local formatters = require "lvim.lsp.null-ls.formatters"
local client_filetypes = client.config.filetypes or {}
for _, filetype in ipairs(client_filetypes) do
- if
- options.lang[filetype] and #vim.tbl_keys(options.lang[filetype].formatters) > 0
- then
+ if #vim.tbl_keys(formatters.list_registered_providers(filetype)) > 0 then
Log:debug(
"Formatter overriding detected. Disabling formatting capabilities for "
.. client.name