Forráskód Böngészése

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

Consolidate configuration styles for linters and formatters

Fixes #1756

Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
Christian Chiarulli 3 éve
szülő
commit
e2bd7fb922
3 módosított fájl, 3 hozzáadás és 19 törlés
  1. 1 1
      README.md
  2. 2 2
      lua/lvim/config/init.lua
  3. 0 16
      lua/lvim/lsp/null-ls/init.lua

+ 1 - 1
README.md

@@ -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
 
 

+ 2 - 2
lua/lvim/config/init.lua

@@ -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

+ 0 - 16
lua/lvim/lsp/null-ls/init.lua

@@ -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