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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 8 deletions

View file

@ -79,6 +79,8 @@ local defaults = {
M.renames = {
["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
@ -181,6 +183,14 @@ function M.init()
local add = Plugin.Spec.add
Plugin.Spec.add = function(self, plugin, ...)
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]]
end
return add(self, plugin, ...)

View file

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

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ return {
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
"nvimtools/none-ls.nvim",
opts = function(_, opts)
local nls = require("null-ls")
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)
if type(opts.sources) == "table" then
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)
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
end,

View file

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