fix: register null-ls providers per filetype (#1709)

This commit is contained in:
kylo252 2021-10-08 08:57:11 +02:00 committed by GitHub
parent 68d2678af3
commit f4899e3165
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 15 deletions

View file

@ -13,12 +13,12 @@ function M:setup()
null_ls.config()
require("lspconfig")["null-ls"].setup(lvim.lsp.null_ls.setup)
for _, filetype in pairs(lvim.lang) do
if filetype.formatters then
formatters.setup(filetype.formatters, filetype)
for filetype, config in pairs(lvim.lang) do
if not vim.tbl_isempty(config.formatters) then
formatters.setup(config.formatters, filetype)
end
if filetype.linters then
linters.setup(filetype.linters, filetype)
if not vim.tbl_isempty(config.linters) then
linters.setup(config.linters, filetype)
end
end
end