fix(plugin): show warning of removed core plugin when trying to load them without having the extra

This commit is contained in:
Folke Lemaitre 2023-10-12 10:36:15 +02:00
parent 777be2fabd
commit b9f3cada8a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -14,6 +14,12 @@ M.deprecated_extras = {
["lazyvim.plugins.extras.ui.dashboard"] = "`dashboard.nvim` is now the default **LazyVim** starter.",
}
M.deprecated_modules = {
["null-ls"] = "lsp.none-ls",
["nvim-navic.lib"] = "editor.navic",
["nvim-navic"] = "editor.navic",
}
---@type table<string, string>
M.renames = {
["windwp/nvim-spectre"] = "nvim-pack/nvim-spectre",
@ -26,6 +32,18 @@ function M.setup()
M.fix_imports()
M.fix_renames()
M.lazy_file()
table.insert(package.loaders, function(module)
if M.deprecated_modules[module] then
Util.warn(
("`%s` is no longer included by default in **LazyVim**.\nPlease install the `%s` extra if you still want to use it."):format(
module,
M.deprecated_modules[module]
),
{ title = "LazyVim" }
)
return function() end
end
end)
end
function M.extra_idx(name)