feat: configure multiple filetypes per provider (#1725)

This commit is contained in:
kylo252 2021-10-09 13:39:15 +02:00 committed by GitHub
parent 195b07a464
commit efd82c8756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 11 deletions

View file

@ -15,10 +15,16 @@ function M:setup()
require("lspconfig")["null-ls"].setup(lvim.lsp.null_ls.setup)
for filetype, config in pairs(lvim.lang) do
if not vim.tbl_isempty(config.formatters) then
formatters.setup(config.formatters, filetype)
vim.tbl_map(function(c)
c.filetypes = { filetype }
end, config.formatters)
formatters.setup(config.formatters)
end
if not vim.tbl_isempty(config.linters) then
linters.setup(config.linters, filetype)
vim.tbl_map(function(c)
c.filetypes = { filetype }
end, config.formatters)
linters.setup(config.linters)
end
end
end