feat(null-ls)!: use none-ls instead of null-ls (#1517)

* FEATURE: use none-ls instead of null-ls

Fixes #1516

* fix(none-ls): automatically migrate null-ls to none-ls

* feat(config): show warning if user config contains renamed references

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
Ahmed W
2023-09-29 04:52:45 -05:00
committed by GitHub
parent 274649e923
commit 7cac6f064c
9 changed files with 18 additions and 8 deletions

View File

@ -79,6 +79,8 @@ local defaults = {
M.renames = { M.renames = {
["windwp/nvim-spectre"] = "nvim-pack/nvim-spectre", ["windwp/nvim-spectre"] = "nvim-pack/nvim-spectre",
["jose-elias-alvarez/null-ls.nvim"] = "nvimtools/none-ls.nvim",
["null-ls.nvim"] = "none-ls.nvim",
} }
---@type LazyVimConfig ---@type LazyVimConfig
@ -181,6 +183,14 @@ function M.init()
local add = Plugin.Spec.add local add = Plugin.Spec.add
Plugin.Spec.add = function(self, plugin, ...) Plugin.Spec.add = function(self, plugin, ...)
if type(plugin) == "table" and M.renames[plugin[1]] then if type(plugin) == "table" and M.renames[plugin[1]] then
require("lazy.core.util").warn(
("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format(
plugin[1],
M.renames[plugin[1]],
self.importing or "LazyVim"
),
{ title = "LazyVim" }
)
plugin[1] = M.renames[plugin[1]] plugin[1] = M.renames[plugin[1]]
end end
return add(self, plugin, ...) return add(self, plugin, ...)

View File

@ -6,7 +6,7 @@ return {
end, end,
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
table.insert(opts.sources, nls.builtins.formatting.prettierd) table.insert(opts.sources, nls.builtins.formatting.prettierd)

View File

@ -8,7 +8,7 @@ return {
end, end,
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
opts.sources = opts.sources or {} opts.sources = opts.sources or {}

View File

@ -8,7 +8,7 @@ return {
end, end,
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
opts.sources = opts.sources or {} opts.sources = opts.sources or {}

View File

@ -83,7 +83,7 @@ return {
}, },
-- Ensure Go tools are installed -- Ensure Go tools are installed
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
if type(opts.sources) == "table" then if type(opts.sources) == "table" then
local nls = require("null-ls") local nls = require("null-ls")

View File

@ -9,7 +9,7 @@ return {
end, end,
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
local nls = require("null-ls") local nls = require("null-ls")
table.insert(opts.sources, nls.builtins.formatting.csharpier) table.insert(opts.sources, nls.builtins.formatting.csharpier)

View File

@ -25,7 +25,7 @@ return {
}, },
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
if type(opts.sources) == "table" then if type(opts.sources) == "table" then
local null_ls = require("null-ls") local null_ls = require("null-ls")

View File

@ -53,7 +53,7 @@ return {
}, },
}, },
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
opts = function(_, opts) opts = function(_, opts)
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions")) table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
end, end,

View File

@ -205,7 +205,7 @@ return {
-- formatters -- formatters
{ {
"jose-elias-alvarez/null-ls.nvim", "nvimtools/none-ls.nvim",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
dependencies = { "mason.nvim" }, dependencies = { "mason.nvim" },
opts = function() opts = function()