refactor: deprecate lvim.lang.FOO (#1913)

Consolidate configuration styles for linters and formatters

Fixes #1756
This commit is contained in:
kylo252 2021-11-06 09:23:59 +01:00 committed by GitHub
parent 37e6e5fd5c
commit e79b6bf8aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 19 deletions

View file

@ -1,8 +1,6 @@
local M = {}
local Log = require "lvim.core.log"
local formatters = require "lvim.lsp.null-ls.formatters"
local linters = require "lvim.lsp.null-ls.linters"
function M:setup()
local status_ok, null_ls = pcall(require, "null-ls")
@ -19,20 +17,6 @@ function M:setup()
end
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
vim.tbl_map(function(c)
c.filetypes = { filetype }
end, config.formatters)
formatters.setup(config.formatters)
end
if not vim.tbl_isempty(config.linters) then
vim.tbl_map(function(c)
c.filetypes = { filetype }
end, config.formatters)
linters.setup(config.linters)
end
end
end
return M