From b9f3cada8affdab080108895e3e9bf3613857d25 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 12 Oct 2023 10:36:15 +0200 Subject: [PATCH] fix(plugin): show warning of removed core plugin when trying to load them without having the extra --- lua/lazyvim/util/plugin.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 75d49899..f23bec3b 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -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 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)