mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 23:20:08 +02:00
refactor: deprecate lvim.lang.FOO (#1913)
Consolidate configuration styles for linters and formatters Fixes #1756
This commit is contained in:
parent
37e6e5fd5c
commit
e79b6bf8aa
3 changed files with 3 additions and 19 deletions
|
@ -128,7 +128,7 @@ lvim.plugins = {
|
||||||
|
|
||||||
## Breaking changes
|
## Breaking changes
|
||||||
|
|
||||||
- `lvim.lang.FOO.lsp` is no longer supported after #1584.
|
- `lvim.lang.FOO` is no longer supported. Refer to <https://www.lunarvim.org/languages> for up-to-date instructions.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,9 @@ local function handle_deprecated_settings()
|
||||||
|
|
||||||
---lvim.lang.FOO.lsp
|
---lvim.lang.FOO.lsp
|
||||||
for lang, entry in pairs(lvim.lang) do
|
for lang, entry in pairs(lvim.lang) do
|
||||||
local deprecated_config = entry["lsp"] or {}
|
local deprecated_config = entry.formatters or entry.linters or {}
|
||||||
if not vim.tbl_isempty(deprecated_config) then
|
if not vim.tbl_isempty(deprecated_config) then
|
||||||
deprecation_notice(string.format("lvim.lang.%s.lsp", lang))
|
deprecation_notice(string.format("lvim.lang.%s", lang))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local Log = require "lvim.core.log"
|
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()
|
function M:setup()
|
||||||
local status_ok, null_ls = pcall(require, "null-ls")
|
local status_ok, null_ls = pcall(require, "null-ls")
|
||||||
|
@ -19,20 +17,6 @@ function M:setup()
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lspconfig")["null-ls"].setup(lvim.lsp.null_ls.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
|
|
||||||
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
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue