From 1677b3b84f53d410d50c5a2aca32ca7c5e900917 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 4 Jun 2024 11:14:48 +0200 Subject: [PATCH] feat(lazydev): use lazydev with neodev types (not the plugin) on Neovim 0.9.x --- lua/lazyvim/plugins/compat/nvim-0_9.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua index fc56b925..6488952b 100644 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -8,12 +8,22 @@ return { { "folke/ts-comments.nvim", enabled = false }, { import = "lazyvim.plugins.extras.coding.mini-comment" }, - -- Use neodev instead of lazydev - { "folke/lazydev.nvim", enabled = false }, + -- Use neodev-types with lazydev + { "folke/neodev.nvim", config = function() end }, + { + "folke/lazydev.nvim", + opts = function(_, opts) + opts.library = opts.library or {} + table.insert(opts.library, { "neodev.nvim/types/stable" }) + end, + config = function(_, opts) + -- force lazydev to load on Neovim 0.9 + require("lazydev.config").have_0_10 = true + require("lazydev").setup(opts) + end, + }, { "neovim/nvim-lspconfig", - dependencies = { - { "folke/neodev.nvim", opts = {} }, - }, + dependencies = {}, }, }