From 53a2de1c8b928655b50a6ecbbe28f53e42b14f82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:55:48 +0200 Subject: [PATCH 01/23] chore(main): release 14.15.1 (#6420) :robot: I have created a release *beep* *boop* --- ## [14.15.1](https://github.com/LazyVim/LazyVim/compare/v14.15.0...v14.15.1) (2025-09-15) ### Bug Fixes * **blink:** use .get method to access presets ([#6183](https://github.com/LazyVim/LazyVim/issues/6183)) ([1a729e2](https://github.com/LazyVim/LazyVim/commit/1a729e2d4c4162501fe13224d669a654849deb36)) * **extras.ai.copilot:** update status retrieval for lualine ([#5900](https://github.com/LazyVim/LazyVim/issues/5900)) ([55e9944](https://github.com/LazyVim/LazyVim/commit/55e9944e2b1e152b5acdc9cc015978a905fc2966)) * **lang.python:** enable venv-selector even when telescope is not available ([#5829](https://github.com/LazyVim/LazyVim/issues/5829)) ([10e5bf5](https://github.com/LazyVim/LazyVim/commit/10e5bf5c5b5fb4da0afbb2d4d2b75595502c9690)) * **lsp:** fixed deprecated warnings ([bed725a](https://github.com/LazyVim/LazyVim/commit/bed725a054ed3e8c8c56dce7e2100335e567cf01)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 5f6e5685..d4bbf7f7 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "14.15.0" + ".": "14.15.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 873ac748..3e2be0c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [14.15.1](https://github.com/LazyVim/LazyVim/compare/v14.15.0...v14.15.1) (2025-09-15) + + +### Bug Fixes + +* **blink:** use .get method to access presets ([#6183](https://github.com/LazyVim/LazyVim/issues/6183)) ([1a729e2](https://github.com/LazyVim/LazyVim/commit/1a729e2d4c4162501fe13224d669a654849deb36)) +* **extras.ai.copilot:** update status retrieval for lualine ([#5900](https://github.com/LazyVim/LazyVim/issues/5900)) ([55e9944](https://github.com/LazyVim/LazyVim/commit/55e9944e2b1e152b5acdc9cc015978a905fc2966)) +* **lang.python:** enable venv-selector even when telescope is not available ([#5829](https://github.com/LazyVim/LazyVim/issues/5829)) ([10e5bf5](https://github.com/LazyVim/LazyVim/commit/10e5bf5c5b5fb4da0afbb2d4d2b75595502c9690)) +* **lsp:** fixed deprecated warnings ([bed725a](https://github.com/LazyVim/LazyVim/commit/bed725a054ed3e8c8c56dce7e2100335e567cf01)) + ## [14.15.0](https://github.com/LazyVim/LazyVim/compare/v14.14.0...v14.15.0) (2025-05-12) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 73c35f1f..d622dfdf 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "14.15.0" -- x-release-please-version +M.version = "14.15.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From e7ce65e1bb814f79ecb45bfeca934e997e0ee42c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 10:58:22 +0200 Subject: [PATCH 02/23] feat!: LazyVim now requires Neovim >= 0.11 See #6421 for more info --- lua/lazyvim/plugins/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/init.lua b/lua/lazyvim/plugins/init.lua index c06fa9bc..a0faebcd 100644 --- a/lua/lazyvim/plugins/init.lua +++ b/lua/lazyvim/plugins/init.lua @@ -1,6 +1,7 @@ -if vim.fn.has("nvim-0.9.0") == 0 then +if vim.fn.has("nvim-0.11.0") == 0 then vim.api.nvim_echo({ - { "LazyVim requires Neovim >= 0.9.0\n", "ErrorMsg" }, + { "LazyVim requires Neovim >= 0.11.0\n", "ErrorMsg" }, + { "For more info, see: https://github.com/LazyVim/LazyVim/issues/6421\n", "Comment" }, { "Press any key to exit", "MoreMsg" }, }, true, {}) vim.fn.getchar() From 0e56786aa4772c427375a1bb86dc27baf08ded7b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 10:59:26 +0200 Subject: [PATCH 03/23] docs: update required Neovim version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4d379504..fd6a3fe0 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ to tweak your config as needed, along with the convenience of a pre-configured s ## ⚡️ Requirements -- Neovim >= **0.9.0** (needs to be built with **LuaJIT**) +- Neovim >= **0.11.0** (needs to be built with **LuaJIT**) - Git >= **2.19.0** (for partial clones support) - a [Nerd Font](https://www.nerdfonts.com/) **_(optional)_** - a **C** compiler for `nvim-treesitter`. See [here](https://github.com/nvim-treesitter/nvim-treesitter#requirements) From 80573196a1e526d6906dfa7d1af2fcf71317c731 Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Mon, 15 Sep 2025 09:00:43 +0000 Subject: [PATCH 04/23] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 58aa462d..0b861808 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -53,7 +53,7 @@ FEATURES *LazyVim-features* REQUIREMENTS *LazyVim-requirements* -- Neovim >= **0.9.0** (needs to be built with **LuaJIT**) +- Neovim >= **0.11.0** (needs to be built with **LuaJIT**) - Git >= **2.19.0** (for partial clones support) - a Nerd Font **(optional)** - a **C** compiler for `nvim-treesitter`. See here From 3516ae736a333185f6f17b70af20b088d04cbbb6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 11:04:50 +0200 Subject: [PATCH 05/23] fix: remove 0.9 compat --- lua/lazyvim/plugins/compat/nvim-0_9.lua | 41 ------------------------- lua/lazyvim/plugins/xtras.lua | 8 ----- 2 files changed, 49 deletions(-) delete mode 100644 lua/lazyvim/plugins/compat/nvim-0_9.lua diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua deleted file mode 100644 index 81514ef8..00000000 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ /dev/null @@ -1,41 +0,0 @@ --- Compatibility with Neovim 0.9 -return { - -- Use LuaSnip instead of native snippets - { "garymjr/nvim-snippets", enabled = false }, - { import = "lazyvim.plugins.extras.coding.luasnip" }, - - -- Use nvim-cmp instead of blink.cmp - { import = "lazyvim.plugins.extras.coding.nvim-cmp" }, - - -- Use mini.comment instead of ts-comments - { "folke/ts-comments.nvim", enabled = false }, - { import = "lazyvim.plugins.extras.coding.mini-comment" }, - - -- 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 = {}, - }, - - -- dummy import to save core imports - { - import = "foobar", - enabled = function() - LazyVim.plugin.save_core() - return false - end, - }, -} diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index bb061d80..3f71b2aa 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -42,15 +42,7 @@ end ---@type string[] extras = LazyVim.dedup(extras) -local version = vim.version() -local v = version.major .. "_" .. version.minor - -local compat = { "0_9" } - LazyVim.plugin.save_core() -if vim.tbl_contains(compat, v) then - table.insert(extras, 1, "lazyvim.plugins.compat.nvim-" .. v) -end if vim.g.vscode then table.insert(extras, 1, "lazyvim.plugins.extras.vscode") end From a7a94c50ac1ae5e791ce88fab455d5c6edee385e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 11:16:51 +0200 Subject: [PATCH 06/23] refactor: remove all <0.11 compat code --- lua/lazyvim/config/init.lua | 2 +- lua/lazyvim/config/keymaps.lua | 10 --- lua/lazyvim/config/options.lua | 14 ++-- lua/lazyvim/health.lua | 9 +-- lua/lazyvim/plugins/extras/editor/navic.lua | 2 +- lua/lazyvim/plugins/extras/lang/ruby.lua | 4 -- lua/lazyvim/plugins/extras/lang/rust.lua | 1 - lua/lazyvim/plugins/extras/lang/svelte.lua | 5 -- .../plugins/extras/lang/typescript.lua | 4 +- lua/lazyvim/plugins/extras/lang/yaml.lua | 10 --- lua/lazyvim/plugins/lsp/init.lua | 64 ++++++++----------- lua/lazyvim/util/lsp.lua | 54 ++-------------- lua/lazyvim/util/ui.lua | 5 -- 13 files changed, 40 insertions(+), 144 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d622dfdf..9e0903c2 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -353,7 +353,7 @@ function M.get_defaults() { name = "telescope", extra = "editor.telescope" }, }, cmp = { - { name = "blink.cmp", extra = "coding.blink", enabled = vim.fn.has("nvim-0.10") == 1 }, + { name = "blink.cmp", extra = "coding.blink" }, { name = "nvim-cmp", extra = "coding.nvim-cmp" }, }, explorer = { diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index fbc7f5d1..acaf44d9 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -209,13 +209,3 @@ map("n", "", "tabnew", { desc = "New Tab" }) map("n", "]", "tabnext", { desc = "Next Tab" }) map("n", "d", "tabclose", { desc = "Close Tab" }) map("n", "[", "tabprevious", { desc = "Previous Tab" }) - --- native snippets. only needed on < 0.11, as 0.11 creates these by default -if vim.fn.has("nvim-0.11") == 0 then - map("s", "", function() - return vim.snippet.active({ direction = 1 }) and "lua vim.snippet.jump(1)" or "" - end, { expr = true, desc = "Jump Next" }) - map({ "i", "s" }, "", function() - return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" - end, { expr = true, desc = "Jump Previous" }) -end diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 0bbaacba..b5d444d0 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -68,7 +68,10 @@ opt.fillchars = { diff = "╱", eob = " ", } +opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" opt.foldlevel = 99 +opt.foldmethod = "expr" +opt.foldtext = "" opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()" opt.formatoptions = "jcroqlnt" -- tcqj opt.grepformat = "%f:%l:%c:%m" @@ -95,6 +98,7 @@ opt.sidescrolloff = 8 -- Columns of context opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time opt.smartcase = true -- Don't ignore case with capitals opt.smartindent = true -- Insert indents automatically +opt.smoothscroll = true opt.spelllang = { "en" } opt.splitbelow = true -- Put new windows below current opt.splitkeep = "screen" @@ -111,15 +115,5 @@ opt.wildmode = "longest:full,full" -- Command-line completion mode opt.winminwidth = 5 -- Minimum window width opt.wrap = false -- Disable line wrap -if vim.fn.has("nvim-0.10") == 1 then - opt.smoothscroll = true - opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()" - opt.foldmethod = "expr" - opt.foldtext = "" -else - opt.foldmethod = "indent" - opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()" -end - -- Fix markdown indentation settings vim.g.markdown_recommended_style = 0 diff --git a/lua/lazyvim/health.lua b/lua/lazyvim/health.lua index 9fdc5a56..716c60a8 100644 --- a/lua/lazyvim/health.lua +++ b/lua/lazyvim/health.lua @@ -8,13 +8,10 @@ local error = vim.health.error or vim.health.report_error function M.check() start("LazyVim") - if vim.fn.has("nvim-0.9.0") == 1 then - ok("Using Neovim >= 0.9.0") - if vim.fn.has("nvim-0.10.0") == 0 then - warn("Use Neovim >= 0.10.0 for the best experience") - end + if vim.fn.has("nvim-0.11.0") == 1 then + ok("Using Neovim >= 0.11.0") else - error("Neovim >= 0.9.0 is required") + error("Neovim >= 0.11.0 is required") end for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit", "fzf", "curl" }) do diff --git a/lua/lazyvim/plugins/extras/editor/navic.lua b/lua/lazyvim/plugins/extras/editor/navic.lua index e25d1b51..91ec203c 100644 --- a/lua/lazyvim/plugins/extras/editor/navic.lua +++ b/lua/lazyvim/plugins/extras/editor/navic.lua @@ -8,7 +8,7 @@ return { init = function() vim.g.navic_silence = true LazyVim.lsp.on_attach(function(client, buffer) - if client.supports_method("textDocument/documentSymbol") then + if client:supports_method("textDocument/documentSymbol") then require("nvim-navic").attach(client, buffer) end end) diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index 4224e6d8..65620f4e 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -6,10 +6,6 @@ if lazyvim_docs then end local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp" -if vim.fn.has("nvim-0.10") == 0 then - -- ruby_lsp does not work well with Neovim < 0.10 - lsp = vim.g.lazyvim_ruby_lsp or "solargraph" -end local formatter = vim.g.lazyvim_ruby_formatter or "rubocop" return { diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 0adddf18..eca1b597 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -56,7 +56,6 @@ return { { "mrcjkb/rustaceanvim", - version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false, ft = { "rust" }, opts = { server = { diff --git a/lua/lazyvim/plugins/extras/lang/svelte.lua b/lua/lazyvim/plugins/extras/lang/svelte.lua index 565e50e5..4060e2f3 100644 --- a/lua/lazyvim/plugins/extras/lang/svelte.lua +++ b/lua/lazyvim/plugins/extras/lang/svelte.lua @@ -31,11 +31,6 @@ return { desc = "Organize Imports", }, }, - capabilities = { - workspace = { - didChangeWatchedFiles = vim.fn.has("nvim-0.10") == 0 and { dynamicRegistration = true }, - }, - }, }, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index f7cc3231..f9132807 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -137,14 +137,14 @@ return { local action, uri, range = unpack(command.arguments) local function move(newf) - client.request("workspace/executeCommand", { + client:request("workspace/executeCommand", { command = command.command, arguments = { action, uri, range, newf }, }) end local fname = vim.uri_to_fname(uri) - client.request("workspace/executeCommand", { + client:request("workspace/executeCommand", { command = "typescript.tsserverRequest", arguments = { "getMoveToRefactoringFileSuggestions", diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index 9a3aadb8..b460f3c5 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -55,16 +55,6 @@ return { }, }, }, - setup = { - yamlls = function() - -- Neovim < 0.10 does not have dynamic registration for formatting - if vim.fn.has("nvim-0.10") == 0 then - LazyVim.lsp.on_attach(function(client, _) - client.server_capabilities.documentFormattingProvider = true - end, "yamlls") - end - end, - }, }, }, } diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index b5cba5f1..54f410fc 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -125,53 +125,39 @@ return { LazyVim.lsp.setup() LazyVim.lsp.on_dynamic_capability(require("lazyvim.plugins.lsp.keymaps").on_attach) - -- diagnostics signs - if vim.fn.has("nvim-0.10.0") == 0 then - if type(opts.diagnostics.signs) ~= "boolean" then - for severity, icon in pairs(opts.diagnostics.signs.text) do - local name = vim.diagnostic.severity[severity]:lower():gsub("^%l", string.upper) - name = "DiagnosticSign" .. name - vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" }) + -- inlay hints + if opts.inlay_hints.enabled then + LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) + if + vim.api.nvim_buf_is_valid(buffer) + and vim.bo[buffer].buftype == "" + and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype) + then + vim.lsp.inlay_hint.enable(true, { bufnr = buffer }) end - end + end) end - if vim.fn.has("nvim-0.10") == 1 then - -- inlay hints - if opts.inlay_hints.enabled then - LazyVim.lsp.on_supports_method("textDocument/inlayHint", function(client, buffer) - if - vim.api.nvim_buf_is_valid(buffer) - and vim.bo[buffer].buftype == "" - and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype) - then - vim.lsp.inlay_hint.enable(true, { bufnr = buffer }) - end - end) - end - - -- code lens - if opts.codelens.enabled and vim.lsp.codelens then - LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer) - vim.lsp.codelens.refresh() - vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { - buffer = buffer, - callback = vim.lsp.codelens.refresh, - }) - end) - end + -- code lens + if opts.codelens.enabled and vim.lsp.codelens then + LazyVim.lsp.on_supports_method("textDocument/codeLens", function(client, buffer) + vim.lsp.codelens.refresh() + vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "InsertLeave" }, { + buffer = buffer, + callback = vim.lsp.codelens.refresh, + }) + end) end if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then - opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" - or function(diagnostic) - local icons = LazyVim.config.icons.diagnostics - for d, icon in pairs(icons) do - if diagnostic.severity == vim.diagnostic.severity[d:upper()] then - return icon - end + opts.diagnostics.virtual_text.prefix = function(diagnostic) + local icons = LazyVim.config.icons.diagnostics + for d, icon in pairs(icons) do + if diagnostic.severity == vim.diagnostic.severity[d:upper()] then + return icon end end + end end vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 51aa471a..02ab8b6e 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -3,56 +3,10 @@ local M = {} ---@alias lsp.Client.filter {id?: number, bufnr?: number, name?: string, method?: string, filter?:fun(client: vim.lsp.Client):boolean} ---- Neovim 0.11 uses a lua class for clients, while older versions use a table. ---- Wraps older style clients to be compatible with the new style. ----@param client vim.lsp.Client ----@return vim.lsp.Client -local function wrap(client) - local meta = getmetatable(client) - if meta and meta.request then - return client - end - ---@diagnostic disable-next-line: undefined-field - if client.wrapped then - return client - end - local methods = { "request", "supports_method", "cancel_request", "notify" } - -- old style - return setmetatable({ wrapped = true }, { - __index = function(_, k) - if k == "supports_method" then - -- supports_method doesn't support the bufnr argument - return function(_, method) - return client[k](method) - end - end - if vim.tbl_contains(methods, k) then - return function(_, ...) - return client[k](...) - end - end - return client[k] - end, - }) -end - ---@param opts? lsp.Client.filter function M.get_clients(opts) local ret = {} ---@type vim.lsp.Client[] - if vim.lsp.get_clients then - ret = vim.lsp.get_clients(opts) - ret = vim.tbl_map(wrap, ret) - else - ---@diagnostic disable-next-line: deprecated - ret = vim.lsp.get_active_clients(opts) - ret = vim.tbl_map(wrap, ret) - if opts and opts.method then - ---@param client vim.lsp.Client - ret = vim.tbl_filter(function(client) - return client.supports_method(opts.method, { bufnr = opts.bufnr }) - end, ret) - end - end + ret = vim.lsp.get_clients(opts) return opts and opts.filter and vim.tbl_filter(opts.filter, ret) or ret end @@ -64,7 +18,7 @@ function M.on_attach(on_attach, name) local buffer = args.buf ---@type number local client = vim.lsp.get_client_by_id(args.data.client_id) if client and (not name or client.name == name) then - return on_attach(wrap(client), buffer) + return on_attach(client, buffer) end end, }) @@ -204,8 +158,8 @@ function M.formatter(opts) local clients = M.get_clients(LazyVim.merge({}, filter, { bufnr = buf })) ---@param client vim.lsp.Client local ret = vim.tbl_filter(function(client) - return client.supports_method("textDocument/formatting") - or client.supports_method("textDocument/rangeFormatting") + return client:supports_method("textDocument/formatting") + or client:supports_method("textDocument/rangeFormatting") end, clients) ---@param client vim.lsp.Client return vim.tbl_map(function(client) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 3460b0ab..c8c899d5 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -1,11 +1,6 @@ ---@class lazyvim.util.ui local M = {} --- foldtext for Neovim < 0.10.0 -function M.foldtext() - return vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1] -end - -- optimized treesitter foldexpr for Neovim >= 0.10.0 function M.foldexpr() local buf = vim.api.nvim_get_current_buf() From 02d0c9aebddb902d9c974a38bb44db9bae4eac6d Mon Sep 17 00:00:00 2001 From: flippette Date: Mon, 15 Sep 2025 12:21:32 +0300 Subject: [PATCH 07/23] fix(catppuccin): follow renamed integration (#6354) ## Description [This commit](https://github.com/catppuccin/nvim/commit/30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86) renamed a Catppuccin integration; this PR follows the rename. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/colorscheme.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/colorscheme.lua b/lua/lazyvim/plugins/colorscheme.lua index fa611bf4..4c41d492 100644 --- a/lua/lazyvim/plugins/colorscheme.lua +++ b/lua/lazyvim/plugins/colorscheme.lua @@ -58,7 +58,7 @@ return { optional = true, opts = function(_, opts) if (vim.g.colors_name or ""):find("catppuccin") then - opts.highlights = require("catppuccin.groups.integrations.bufferline").get() + opts.highlights = require("catppuccin.groups.integrations.bufferline").get_theme() end end, }, From e2ba6bb51107cbd076b53b49ed7be99fc2fa3991 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 11:24:41 +0200 Subject: [PATCH 08/23] fix(harpoon): keymaps for 1-9. Fixes #6319 --- lua/lazyvim/plugins/extras/editor/harpoon2.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/harpoon2.lua b/lua/lazyvim/plugins/extras/editor/harpoon2.lua index 760d805a..699c2546 100644 --- a/lua/lazyvim/plugins/extras/editor/harpoon2.lua +++ b/lua/lazyvim/plugins/extras/editor/harpoon2.lua @@ -28,7 +28,7 @@ return { }, } - for i = 1, 5 do + for i = 1, 9 do table.insert(keys, { "" .. i, function() From 848dd3132af50f6d211d0c07166ea7c1a4259088 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:27:29 +0300 Subject: [PATCH 09/23] fix(neo-tree): import neo-tree Extra before edgy Extra (#5763) ## Description Seems like since the move of `neo-tree` into Extras, its plugin spec is loaded after edgy's and that causes problems. Give `neo-tree` Extra higher prio than edgy Extra. ## Related Issue(s) Fixes #5762 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/xtras.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 3f71b2aa..19a5c6da 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -3,7 +3,8 @@ local prios = { ["lazyvim.plugins.extras.test.core"] = 1, ["lazyvim.plugins.extras.dap.core"] = 1, ["lazyvim.plugins.extras.coding.nvim-cmp"] = 2, - ["lazyvim.plugins.extras.ui.edgy"] = 2, + ["lazyvim.plugins.extras.editor.neo-tree"] = 2, + ["lazyvim.plugins.extras.ui.edgy"] = 3, ["lazyvim.plugins.extras.lang.typescript"] = 5, ["lazyvim.plugins.extras.coding.blink"] = 5, ["lazyvim.plugins.extras.formatting.prettier"] = 10, From ae3aaf2dd3a04eb5dbc5b1e34843558c85e45ac2 Mon Sep 17 00:00:00 2001 From: Sergey Kochetkov Date: Mon, 15 Sep 2025 11:45:00 +0200 Subject: [PATCH 10/23] fix(mini): update mini plugin references from echasnovski to nvim-mini (#6374) Updates all `mini.nvim` plugin references to use the new `nvim-mini` organization namespace instead of the legacy `echasnovski` namespace across all LazyVim configuration files. ## Description https://github.com/nvim-mini/mini.nvim/discussions/1970 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/coding.lua | 4 ++-- .../plugins/extras/coding/mini-comment.lua | 2 +- .../plugins/extras/coding/mini-snippets.lua | 6 +++--- .../plugins/extras/coding/mini-surround.lua | 2 +- lua/lazyvim/plugins/extras/editor/leap.lua | 2 +- lua/lazyvim/plugins/extras/editor/mini-diff.lua | 2 +- lua/lazyvim/plugins/extras/editor/mini-files.lua | 2 +- lua/lazyvim/plugins/extras/editor/mini-move.lua | 2 +- .../plugins/extras/editor/snacks_picker.lua | 2 +- lua/lazyvim/plugins/extras/lang/go.lua | 2 +- lua/lazyvim/plugins/extras/lang/typescript.lua | 2 +- lua/lazyvim/plugins/extras/ui/mini-animate.lua | 2 +- .../plugins/extras/ui/mini-indentscope.lua | 2 +- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 4 ++-- lua/lazyvim/plugins/extras/ui/smear-cursor.lua | 2 +- lua/lazyvim/plugins/extras/util/chezmoi.lua | 2 +- .../plugins/extras/util/mini-hipatterns.lua | 2 +- lua/lazyvim/plugins/extras/util/project.lua | 2 +- lua/lazyvim/plugins/ui.lua | 2 +- lua/lazyvim/util/plugin.lua | 15 ++++++++++++--- tests/minit.lua | 2 +- 21 files changed, 36 insertions(+), 27 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 0e614e48..8b242eb8 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -1,7 +1,7 @@ return { -- auto pairs { - "echasnovski/mini.pairs", + "nvim-mini/mini.pairs", event = "VeryLazy", opts = { modes = { insert = true, command = true, terminal = false }, @@ -29,7 +29,7 @@ return { -- Better text-objects { - "echasnovski/mini.ai", + "nvim-mini/mini.ai", event = "VeryLazy", opts = function() local ai = require("mini.ai") diff --git a/lua/lazyvim/plugins/extras/coding/mini-comment.lua b/lua/lazyvim/plugins/extras/coding/mini-comment.lua index 457787ef..19113d67 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-comment.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-comment.lua @@ -1,6 +1,6 @@ return { { - "echasnovski/mini.comment", + "nvim-mini/mini.comment", event = "VeryLazy", opts = { options = { diff --git a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua index d0a747a8..714d867d 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-snippets.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-snippets.lua @@ -4,14 +4,14 @@ if lazyvim_docs then vim.g.lazyvim_mini_snippets_in_completion = true -- NOTE: Please also read: - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-snippets.md#expand + -- https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-snippets.md#expand -- :h MiniSnippets-session -- Example override for your own config: --[[ return { { - "echasnovski/mini.snippets", + "nvim-mini/mini.snippets", opts = function(_, opts) -- By default, for opts.snippets, the extra for mini.snippets only adds gen_loader.from_lang() -- This provides a sensible quickstart, integrating with friendly-snippets @@ -63,7 +63,7 @@ return { -- add mini.snippets desc = "Manage and expand snippets (alternative to Luasnip)", { - "echasnovski/mini.snippets", + "nvim-mini/mini.snippets", event = "InsertEnter", -- don't depend on other plugins to load... dependencies = "rafamadriz/friendly-snippets", opts = function() diff --git a/lua/lazyvim/plugins/extras/coding/mini-surround.lua b/lua/lazyvim/plugins/extras/coding/mini-surround.lua index d8ff25c5..19c5de8f 100644 --- a/lua/lazyvim/plugins/extras/coding/mini-surround.lua +++ b/lua/lazyvim/plugins/extras/coding/mini-surround.lua @@ -3,7 +3,7 @@ -- to select the text inside, change or modify the surrounding characters, -- and more. return { - "echasnovski/mini.surround", + "nvim-mini/mini.surround", keys = function(_, keys) -- Populate the keys based on the user's options local opts = LazyVim.opts("mini.surround") diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index 19c8b331..3fe4c5e7 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -37,7 +37,7 @@ return { -- rename surround mappings from gs to gz to prevent conflict with leap { - "echasnovski/mini.surround", + "nvim-mini/mini.surround", optional = true, opts = { mappings = { diff --git a/lua/lazyvim/plugins/extras/editor/mini-diff.lua b/lua/lazyvim/plugins/extras/editor/mini-diff.lua index fe25c11e..ea2e216d 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-diff.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-diff.lua @@ -7,7 +7,7 @@ return { -- setup mini.diff { - "echasnovski/mini.diff", + "nvim-mini/mini.diff", event = "VeryLazy", keys = { { diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 70a42940..30cc14fc 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -1,5 +1,5 @@ return { - "echasnovski/mini.files", + "nvim-mini/mini.files", opts = { windows = { preview = true, diff --git a/lua/lazyvim/plugins/extras/editor/mini-move.lua b/lua/lazyvim/plugins/extras/editor/mini-move.lua index aa8823ef..26e977fd 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-move.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-move.lua @@ -1,6 +1,6 @@ return { { - "echasnovski/mini.move", + "nvim-mini/mini.move", event = "VeryLazy", opts = {}, }, diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 93f32fab..591da5ea 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -178,7 +178,7 @@ return { end, }, { - "echasnovski/mini.starter", + "nvim-mini/mini.starter", optional = true, opts = function(_, opts) local items = { diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index ff8def2e..77536fea 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -139,7 +139,7 @@ return { -- Filetype icons { - "echasnovski/mini.icons", + "nvim-mini/mini.icons", opts = { file = { [".go-version"] = { glyph = "", hl = "MiniIconsBlue" }, diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index f9132807..3830f795 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -263,7 +263,7 @@ return { -- Filetype icons { - "echasnovski/mini.icons", + "nvim-mini/mini.icons", opts = { file = { [".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index bbd3e587..5a3fdef6 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -10,7 +10,7 @@ return { -- setup animate { - "echasnovski/mini.animate", + "nvim-mini/mini.animate", event = "VeryLazy", cond = vim.g.neovide == nil, opts = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua index 91ec1d45..ea266b24 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua @@ -3,7 +3,7 @@ return { -- code, this highlights the current level of indentation, and animates -- the highlighting. { - "echasnovski/mini.indentscope", + "nvim-mini/mini.indentscope", version = false, -- wait till new 0.7.0 release to put it back on semver event = "LazyFile", opts = { diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index c1bd7bc1..51444df5 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -5,7 +5,7 @@ return { -- enable mini.starter { - "echasnovski/mini.starter", + "nvim-mini/mini.starter", version = false, -- wait till new 0.7.0 release to put it back on semver event = "VimEnter", opts = function() @@ -67,7 +67,7 @@ return { local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) local pad_footer = string.rep(" ", 8) starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - -- INFO: based on @echasnovski's recommendation (thanks a lot!!!) + -- INFO: based on @nvim-mini's recommendation (thanks a lot!!!) if vim.bo[ev.buf].filetype == "ministarter" then pcall(starter.refresh) end diff --git a/lua/lazyvim/plugins/extras/ui/smear-cursor.lua b/lua/lazyvim/plugins/extras/ui/smear-cursor.lua index 070d2623..2ca27780 100644 --- a/lua/lazyvim/plugins/extras/ui/smear-cursor.lua +++ b/lua/lazyvim/plugins/extras/ui/smear-cursor.lua @@ -9,7 +9,7 @@ return { specs = { -- disable mini.animate cursor { - "echasnovski/mini.animate", + "nvim-mini/mini.animate", optional = true, opts = { cursor = { enable = false }, diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index 6c88fc45..2c1b2f31 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -135,7 +135,7 @@ return { -- Filetype icons { - "echasnovski/mini.icons", + "nvim-mini/mini.icons", opts = { file = { [".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" }, diff --git a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua index 287c0d77..b8fa4d1a 100644 --- a/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua +++ b/lua/lazyvim/plugins/extras/util/mini-hipatterns.lua @@ -4,7 +4,7 @@ local M = {} M.hl = {} M.plugin = { - "echasnovski/mini.hipatterns", + "nvim-mini/mini.hipatterns", recommended = true, desc = "Highlight colors in your code. Also includes Tailwind CSS support.", event = "LazyFile", diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 01a25bc2..dafaa594 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -134,7 +134,7 @@ return { }, { - "echasnovski/mini.starter", + "nvim-mini/mini.starter", optional = true, opts = function(_, opts) local items = { diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 7985825a..9dd7254b 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -245,7 +245,7 @@ return { -- icons { - "echasnovski/mini.icons", + "nvim-mini/mini.icons", lazy = true, opts = { file = { diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index 9fede549..ff3f3634 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -1,3 +1,4 @@ +local Meta = require("lazy.core.meta") local Plugin = require("lazy.core.plugin") ---@class lazyvim.util.plugin @@ -102,9 +103,17 @@ function M.fix_imports() end function M.fix_renames() - Plugin.Spec.add = LazyVim.inject.args(Plugin.Spec.add, function(self, plugin) + ---@param plugin LazyPluginSpec + Meta.add = LazyVim.inject.args(Meta.add, function(self, plugin) if type(plugin) == "table" then - if M.renames[plugin[1]] then + local name = plugin[1] + if not name then + return + end + if name:find("echasnovski") then + M.renames[name] = name:gsub("echasnovski", "nvim-mini") + end + if M.renames[name] then LazyVim.warn( ("Plugin `%s` was renamed to `%s`.\nPlease update your config for `%s`"):format( plugin[1], @@ -113,7 +122,7 @@ function M.fix_renames() ), { title = "LazyVim" } ) - plugin[1] = M.renames[plugin[1]] + plugin[1] = M.renames[name] end end end) diff --git a/tests/minit.lua b/tests/minit.lua index 807a2ac5..c7240d96 100644 --- a/tests/minit.lua +++ b/tests/minit.lua @@ -11,6 +11,6 @@ require("lazy.minit").setup({ { "nvim-treesitter/nvim-treesitter" }, { "mason-org/mason-lspconfig.nvim", version = "^1.0.0" }, { "mason-org/mason.nvim", version = "^1.0.0" }, - { "echasnovski/mini.icons", opts = {} }, + { "nvim-mini/mini.icons", opts = {} }, }, }) From 3aa2916569df2664cb68e1c7c38882868f36f8d0 Mon Sep 17 00:00:00 2001 From: S1M0N38 Date: Mon, 15 Sep 2025 11:49:11 +0200 Subject: [PATCH 11/23] fix(extras): disable blink path source in CopilotChat (#5666) (#5754) Fix #5666 with the answer given in the discussion. - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: svirschevskiy --- .../plugins/extras/ai/copilot-chat.lua | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua index 58169b1e..fbf4ee39 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua @@ -85,4 +85,24 @@ return { }) end, }, + + -- Blink integration + { + "saghen/blink.cmp", + optional = true, + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + sources = { + providers = { + path = { + -- Path sources triggered by "/" interfere with CopilotChat commands + enabled = function() + return vim.bo.filetype ~= "copilot-chat" + end, + }, + }, + }, + }, + }, } From 773f28b4912d5505a21da9686d56ab7cf41a9be7 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:08:19 +0300 Subject: [PATCH 12/23] fix(mason): migrate to mason v2 (#6053) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description `mason-lspconfig` v2 made changes to conform with latest Neovim `vim.lsp.config`/`vim.lsp.enable` API. - Lock `mason` and `mason-lspconfig` to v1 versions for Neovim <0.11 and latest HEAD for Neovim >=0.11. - Change `:get_install_path()` method in LazyVim to use `LazyVim.get_pkg_path()` and also update name references to new ones. - Change `nvim-lspconfig` from `LazyFile` to `{ "BufReadPre", "BufNewFile", "BufWritePre" }` for Neovim >=0.11, since on `BufReadPost` the LSP would not attach on the first buffer. Previously the `setup.handlers()` function from `mason-lspconfig` would take care of that, but that has been removed on v2. I fail to think if there's a better way to handle this. Most of the changes in `/lsp/init.lua` are thanks to @williamboman comment [here](https://github.com/LazyVim/LazyVim/pull/6041#issuecomment-2857266471). I've also seen that both `mason-lspconfig` and `rustaceanvim` now have as minimum requirements Neovim >=0.11. As such I would suggest, instead of all the conditional checks for Neovim versions to create a stable release where we pin `mason` and `mason-lspconfig` to v1 versions and then only incorporate William's suggestions in a new release and mention in the README that users who are on Neovim <0.11 should use the stable release where the plugin versions are pinned to v1. Not sure how you want to tackle this, so this is merely just a suggestion from my part. Both #6041 and #6045 tackle only with the new name references and the offending line that was causing the error, but don't take into consideration the LSP servers configurations. `opts.setup` would not execute on both, since that was handled by `setup_handlers()` function in the past. I checked with Typescript lang and with those PRs there are no Javascript settings in `vtsls` (by checking with `:=LazyVim.opts("nvim-lspconfig").servers.vtsls`). #6045 also tried to change the method `:get_install_pkg()` by using `vim.fn.exepath`, but to my understanding that only returns the binary path not the package installation path and that is later concatenated to find other paths, which I believe is not correct. PS: There are 2 commits, because my LazyVim fork was not up to date and updated it and then merged the branch I had into a new branch. Sorry if that causes any inconvenience. ## Related Issue(s) Fixes #6039 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre Co-authored-by: William Boman Co-authored-by: Luis Durão --- lua/lazyvim/plugins/extras/lang/java.lua | 11 +--- lua/lazyvim/plugins/extras/lang/php.lua | 5 +- lua/lazyvim/plugins/extras/lang/rust.lua | 10 +--- lua/lazyvim/plugins/lsp/init.lua | 71 +++++++++++++----------- lua/lazyvim/util/init.lua | 17 ++++-- tests/extras/extra_spec.lua | 3 +- tests/minit.lua | 4 +- 7 files changed, 63 insertions(+), 58 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 8098b6b3..9e5047cf 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -87,8 +87,7 @@ return { opts = function() local cmd = { vim.fn.exepath("jdtls") } if LazyVim.has("mason.nvim") then - local mason_registry = require("mason-registry") - local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar" + local lombok_jar = vim.fn.expand("$MASON/share/jdtls/lombok.jar") table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar)) end return { @@ -151,17 +150,13 @@ return { if LazyVim.has("mason.nvim") then local mason_registry = require("mason-registry") if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then - local java_dbg_pkg = mason_registry.get_package("java-debug-adapter") - local java_dbg_path = java_dbg_pkg:get_install_path() local jar_patterns = { - java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar", + vim.fn.expand("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin-*.jar"), } -- java-test also depends on java-debug-adapter. if opts.test and mason_registry.is_installed("java-test") then - local java_test_pkg = mason_registry.get_package("java-test") - local java_test_path = java_test_pkg:get_install_path() vim.list_extend(jar_patterns, { - java_test_path .. "/extension/server/*.jar", + vim.fn.expand("$MASON/share/java-test/*.jar"), }) end for _, jar_pattern in ipairs(jar_patterns) do diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 5a2835aa..04469223 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -48,11 +48,10 @@ return { optional = true, opts = function() local dap = require("dap") - local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path() dap.adapters.php = { type = "executable", - command = "node", - args = { path .. "/extension/out/phpDebug.js" }, + command = "php-debug-adapter", + args = {}, } end, }, diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index eca1b597..b66dde9b 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -110,13 +110,9 @@ return { }, config = function(_, opts) if LazyVim.has("mason.nvim") then - local package_path = require("mason-registry").get_package("codelldb"):get_install_path() - local codelldb = package_path .. "/extension/adapter/codelldb" - local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib" - local uname = io.popen("uname"):read("*l") - if uname == "Linux" then - library_path = package_path .. "/extension/lldb/lib/liblldb.so" - end + local codelldb = vim.fn.exepath("codelldb") + local codelldb_lib_ext = io.popen("uname"):read("*l") == "Linux" and ".so" or ".dylib" + local library_path = vim.fn.expand("$MASON/opt/lldb/lib/liblldb" .. codelldb_lib_ext) opts.dap = { adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path), } diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 54f410fc..b1d6a23d 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -2,7 +2,7 @@ return { -- lspconfig { "neovim/nvim-lspconfig", - event = "LazyFile", + event = { "BufReadPre", "BufNewFile", "BufWritePre" }, dependencies = { "mason.nvim", { "mason-org/mason-lspconfig.nvim", config = function() end }, @@ -174,31 +174,35 @@ return { opts.capabilities or {} ) - local function setup(server) - local server_opts = vim.tbl_deep_extend("force", { - capabilities = vim.deepcopy(capabilities), - }, servers[server] or {}) - if server_opts.enabled == false then - return - end - - if opts.setup[server] then - if opts.setup[server](server, server_opts) then - return - end - elseif opts.setup["*"] then - if opts.setup["*"](server, server_opts) then - return - end - end - require("lspconfig")[server].setup(server_opts) - end - -- get all the servers that are available through mason-lspconfig local have_mason, mlsp = pcall(require, "mason-lspconfig") local all_mslp_servers = {} - if have_mason then - all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package) + all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package) + + local exclude_automatic_enable = {} ---@type string[] + + local function configure(server) + local server_opts = vim.tbl_deep_extend("force", { + capabilities = vim.deepcopy(capabilities), + }, servers[server] or {}) + + if opts.setup[server] then + if opts.setup[server](server, server_opts) then + return true + end + elseif opts.setup["*"] then + if opts.setup["*"](server, server_opts) then + return true + end + end + vim.lsp.config(server, server_opts) + + -- manually enable if mason=false or if this is a server that cannot be installed with mason-lspconfig + if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + vim.lsp.enable(server) + return true + end + return false end local ensure_installed = {} ---@type string[] @@ -207,24 +211,31 @@ return { server_opts = server_opts == true and {} or server_opts if server_opts.enabled ~= false then -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then - setup(server) + if configure(server) then + exclude_automatic_enable[#exclude_automatic_enable + 1] = server else ensure_installed[#ensure_installed + 1] = server end + else + exclude_automatic_enable[#exclude_automatic_enable + 1] = server end end end if have_mason then - mlsp.setup({ + local setup_config = { ensure_installed = vim.tbl_deep_extend( "force", ensure_installed, LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {} ), - handlers = { setup }, - }) + } + + setup_config.automatic_enable = { + exclude = exclude_automatic_enable, + } + + mlsp.setup(setup_config) end if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then @@ -278,8 +289,4 @@ return { end) end, }, - - -- pin to v1 for now - { "mason-org/mason.nvim", version = "^1.0.0" }, - { "mason-org/mason-lspconfig.nvim", version = "^1.0.0" }, } diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 4b49f539..339fdadb 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -253,11 +253,18 @@ function M.get_pkg_path(pkg, path, opts) opts = opts or {} opts.warn = opts.warn == nil and true or opts.warn path = path or "" - local ret = root .. "/packages/" .. pkg .. "/" .. path - if opts.warn and not vim.loop.fs_stat(ret) and not require("lazy.core.config").headless() then - M.warn( - ("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format(pkg, path) - ) + local ret = vim.fs.normalize(root .. "/packages/" .. pkg .. "/" .. path) + if opts.warn then + vim.schedule(function() + if not require("lazy.core.config").headless() and not vim.loop.fs_stat(ret) then + M.warn( + ("Mason package path not found for **%s**:\n- `%s`\nYou may need to force update the package."):format( + pkg, + path + ) + ) + end + end) end return ret end diff --git a/tests/extras/extra_spec.lua b/tests/extras/extra_spec.lua index 2afb6b94..2a4a9bc8 100644 --- a/tests/extras/extra_spec.lua +++ b/tests/extras/extra_spec.lua @@ -26,7 +26,8 @@ describe("Extra", function() return not vim.tbl_contains(ignore, extra.modname) end, extras) - local lsp_to_pkg = require("mason-lspconfig.mappings.server").lspconfig_to_package + local lsp_to_pkg = {} + lsp_to_pkg = require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package local tsspec = Plugin.Spec.new({ import = "lazyvim.plugins.treesitter", diff --git a/tests/minit.lua b/tests/minit.lua index c7240d96..41907e75 100644 --- a/tests/minit.lua +++ b/tests/minit.lua @@ -9,8 +9,8 @@ require("lazy.minit").setup({ { dir = vim.uv.cwd() }, { "LazyVim/starter" }, { "nvim-treesitter/nvim-treesitter" }, - { "mason-org/mason-lspconfig.nvim", version = "^1.0.0" }, - { "mason-org/mason.nvim", version = "^1.0.0" }, + { "mason-org/mason-lspconfig.nvim" }, + { "mason-org/mason.nvim" }, { "nvim-mini/mini.icons", opts = {} }, }, }) From 5e7da4384d2ebd1a5f48119d0793f54a447f2db9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 12:12:43 +0200 Subject: [PATCH 13/23] docs: updated news --- NEWS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NEWS.md b/NEWS.md index 9d00ddd6..9fc3f95a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,17 @@ # What's new? +## 15.x + +**Neovim** `>= 0.11.0` includes a lot of changes to the underlying LSP implementation. + +Going forward, **LazyVim** requires **Neovim** `>= 0.11.0`, and drops support for older versions. + +### Changes + +- removed compatibility code for Neovim `< 0.11` +- updated all LSP code to use the new LSP implementation +- migrated **mason.nvim** and **mason-lspconfig.nvim** to `v2.x` + ## 14.x Big new release with a lot of changes and improvements! From 0d27e89a362d541fadc9713dbdcea86c124b93de Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 16:28:46 +0200 Subject: [PATCH 14/23] refactor(lsp): cleanup lsp config --- lua/lazyvim/plugins/extras/lang/ruby.lua | 3 +- lua/lazyvim/plugins/lsp/init.lua | 70 ++++++++++-------------- 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index 65620f4e..e9c68d11 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -21,9 +21,8 @@ return { }, { "neovim/nvim-lspconfig", - ---@class PluginLspOpts + ---@type PluginLspOpts opts = { - ---@type lspconfig.options servers = { ruby_lsp = { enabled = lsp == "ruby_lsp", diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index b1d6a23d..f4bdce22 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -63,7 +63,7 @@ return { timeout_ms = nil, }, -- LSP Server Settings - ---@type lspconfig.options + ---@type table servers = { lua_ls = { -- mason = false, -- set to false if you don't want this server to be installed with mason @@ -99,7 +99,7 @@ return { }, -- you can do any additional lsp server setup here -- return true if you don't want this server to be setup with lspconfig - ---@type table + ---@type table setup = { -- example to setup with typescript.nvim -- tsserver = function(_, opts) @@ -149,6 +149,7 @@ return { end) end + -- diagnostics if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then opts.diagnostics.virtual_text.prefix = function(diagnostic) local icons = LazyVim.config.icons.diagnostics @@ -157,48 +158,42 @@ return { return icon end end + return "●" end end - vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) - local servers = opts.servers - local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") - local has_blink, blink = pcall(require, "blink.cmp") local capabilities = vim.tbl_deep_extend( "force", {}, vim.lsp.protocol.make_client_capabilities(), - has_cmp and cmp_nvim_lsp.default_capabilities() or {}, - has_blink and blink.get_lsp_capabilities() or {}, + LazyVim.has("nvim-cmp") and require("cmp_nvim_lsp").default_capabilities() or {}, + LazyVim.has("blink.nvim") and require("blink.cmp").get_lsp_capabilities() or {}, opts.capabilities or {} ) -- get all the servers that are available through mason-lspconfig - local have_mason, mlsp = pcall(require, "mason-lspconfig") - local all_mslp_servers = {} - all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package) + local have_mason = LazyVim.has("mason-lspconfig.nvim") + local mason_all = have_mason + and vim.tbl_keys(require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package) + or {} --[[ @as string[] ]] local exclude_automatic_enable = {} ---@type string[] local function configure(server) local server_opts = vim.tbl_deep_extend("force", { capabilities = vim.deepcopy(capabilities), - }, servers[server] or {}) + }, opts.servers[server] or {}) - if opts.setup[server] then - if opts.setup[server](server, server_opts) then - return true - end - elseif opts.setup["*"] then - if opts.setup["*"](server, server_opts) then - return true - end + local setup = opts.setup[server] or opts.setup["*"] + if setup and setup(server, server_opts) then + return true -- lsp will be setup by the setup function end + vim.lsp.config(server, server_opts) -- manually enable if mason=false or if this is a server that cannot be installed with mason-lspconfig - if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then + if server_opts.mason == false or not vim.tbl_contains(mason_all, server) then vim.lsp.enable(server) return true end @@ -206,36 +201,31 @@ return { end local ensure_installed = {} ---@type string[] - for server, server_opts in pairs(servers) do - if server_opts then - server_opts = server_opts == true and {} or server_opts - if server_opts.enabled ~= false then - -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig - if configure(server) then - exclude_automatic_enable[#exclude_automatic_enable + 1] = server - else - ensure_installed[#ensure_installed + 1] = server - end - else + for server, server_opts in pairs(opts.servers) do + server_opts = server_opts == true and {} or server_opts or false + if server_opts and server_opts.enabled ~= false then + -- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig + if configure(server) then exclude_automatic_enable[#exclude_automatic_enable + 1] = server + else + ensure_installed[#ensure_installed + 1] = server end + else + exclude_automatic_enable[#exclude_automatic_enable + 1] = server end end if have_mason then - local setup_config = { + require("mason-lspconfig").setup({ ensure_installed = vim.tbl_deep_extend( "force", ensure_installed, LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {} ), - } - - setup_config.automatic_enable = { - exclude = exclude_automatic_enable, - } - - mlsp.setup(setup_config) + automatic_enable = { + exclude = exclude_automatic_enable, + }, + }) end if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then From 5668ad72ca806b3a7915bb7b35dcc5cccfe774f7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 17:13:40 +0200 Subject: [PATCH 15/23] feat(extras): added an experimental extra for the treesitter `main` branch --- NEWS.md | 11 +-- .../plugins/extras/ui/treesitter-main.lua | 87 +++++++++++++++++++ 2 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/ui/treesitter-main.lua diff --git a/NEWS.md b/NEWS.md index 9fc3f95a..37221e79 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,6 +11,8 @@ Going forward, **LazyVim** requires **Neovim** `>= 0.11.0`, and drops support fo - removed compatibility code for Neovim `< 0.11` - updated all LSP code to use the new LSP implementation - migrated **mason.nvim** and **mason-lspconfig.nvim** to `v2.x` +- added new `treesitter-main` extra to test the new `main` branch of `nvim-treesitter` + - after enabling, you will get errors. Update with `:Lazy` and restart Neovim ## 14.x @@ -122,7 +124,6 @@ vim.g.snacks_animate = false ## 11.x - **Keymaps:** - - `gB` to open the current repo in the browser - `gco` and `gcO` to add a comment below or above the current line - `wm` to toggle window maximize @@ -135,7 +136,6 @@ vim.g.snacks_animate = false It's a great plugin that enhances the native text objects. - `:LazyExtras` now has multiple new sections: - - **Enabled**: extras that are currently enabled - **Recommended Languages**: language extras recommended for the current buffer / directory - **Recommended Plugins**: extras that are recommended for most users @@ -173,7 +173,6 @@ Additionally, some core plugins have been moved to extras. ``` - plugins moved to extras: - - `mini.surround` - `mini.indentscope` scopes are now also highlighted with `indent-blankline` - `nvim-treesitter-context` @@ -191,7 +190,6 @@ Additionally, some core plugins have been moved to extras. You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev) - The **lazygit** integration now configures: - - the theme based on the colorscheme - nerd font icons (v3) - editor preset is set to `nvim-remote` for better interop with Neovim @@ -232,9 +230,7 @@ Additionally, some core plugins have been moved to extras. - New `:LazyExtras` command for managing **LazyVim** extras - Improved **formatting**: - - **LazyVim** can now work with multiple formatters. Types: - - **primary**: only one primary formatter can be active at a time. _(conform, none-ls, LSP)_ - **secondary**: multiple secondary formatters can be active _(eslint, ...)_ @@ -253,18 +249,15 @@ Additionally, some core plugins have been moved to extras. ``` - `none-ls.nvim` is no longer installed by default - - `conform.nvim` is now the default formatter - `nvim-lint` is now the default linter - If you want to keep using `none-ls.nvim`, you can enable the **lsp.none-ls** extra - `dashboard.nvim` is the new default dashboard plugin - - If you want to keep using `alpha.nvim`, you can enable the **ui.alpha** extra - Improved **root detection**: - - New `:LazyRoot` command that shows info about the root dir detection - Configurable with `vim.g.root_spec` diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-main.lua b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua new file mode 100644 index 00000000..934d311a --- /dev/null +++ b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua @@ -0,0 +1,87 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + version = false, -- last release is way too old and doesn't work on Windows + branch = "main", + build = ":TSUpdate", + lazy = true, + cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" }, + enabled = function() + if vim.fn.executable("tree-sitter") == 0 then + LazyVim.error("**treesitter-main** requires the `tree-sitter` executable to be installed") + return false + end + return true + end, + init = function() end, + ---@param opts TSConfig + config = function(_, opts) + if type(opts.ensure_installed) ~= "table" then + error("opts.ensure_installed must be a table") + end + + local TS = require("nvim-treesitter") + TS.setup(opts) + + local needed = LazyVim.dedup(opts.ensure_installed --[[@as string[] ]]) + local installed = TS.get_installed("parsers") + local install = vim.tbl_filter(function(lang) + return not vim.tbl_contains(installed, lang) + end, needed) + + if #install > 0 then + TS.install(install, { summary = true }) + end + + -- backwards compatibility with the old treesitter config for indent + if vim.tbl_get(opts, "indent", "enable") then + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end + + -- backwards compatibility with the old treesitter config for highlight + if vim.tbl_get(opts, "highlight", "enable") then + vim.api.nvim_create_autocmd("FileType", { + callback = function() + pcall(vim.treesitter.start) + end, + }) + end + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + branch = "main", + event = "VeryLazy", + opts = {}, + keys = function() + local moves = { + goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" }, + goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" }, + goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" }, + goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" }, + } + local ret = {} ---@type LazyKeysSpec[] + for method, keymaps in pairs(moves) do + for key, query in pairs(keymaps) do + local desc = query:gsub("@", ""):gsub("%..*", "") + desc = desc:sub(1, 1):upper() .. desc:sub(2) + desc = (key:sub(1, 1) == "[" and "Prev " or "Next ") .. desc + desc = desc .. (key:sub(2, 2) == key:sub(2, 2):upper() and " End" or " Start") + ret[#ret + 1] = { + key, + function() + require("nvim-treesitter-textobjects.move")[method](query, "textobjects") + end, + desc = desc, + mode = { "n", "x", "o" }, + silent = true, + } + end + end + return ret + end, + config = function(_, opts) + require("nvim-treesitter-textobjects").setup(opts) + end, + }, +} From 44ade7fdea98a0356c64ff9edaf2534547b958bc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 17:15:51 +0200 Subject: [PATCH 16/23] fix(lsp): buffer should be second arg for supports_method --- lua/lazyvim/util/lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 02ab8b6e..074346d3 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -64,7 +64,7 @@ function M._check_methods(client, buffer) for method, clients in pairs(M._supports_method) do clients[client] = clients[client] or {} if not clients[client][buffer] then - if client.supports_method and client:supports_method(method, { bufnr = buffer }) then + if client.supports_method and client:supports_method(method, buffer) then clients[client][buffer] = true vim.api.nvim_exec_autocmds("User", { pattern = "LspSupportsMethod", @@ -107,7 +107,7 @@ function M.on_supports_method(method, fn) }) end ----@return _.lspconfig.options +---@return vim.lsp.Config function M.get_config(server) local configs = require("lspconfig.configs") return rawget(configs, server) From 96316e5a69b4cc45311f5b7225e7d7bea1f977ee Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 17:17:21 +0200 Subject: [PATCH 17/23] fix(treesitter-main): move exe check to config --- lua/lazyvim/plugins/extras/ui/treesitter-main.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-main.lua b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua index 934d311a..8987b732 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-main.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua @@ -6,16 +6,13 @@ return { build = ":TSUpdate", lazy = true, cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" }, - enabled = function() - if vim.fn.executable("tree-sitter") == 0 then - LazyVim.error("**treesitter-main** requires the `tree-sitter` executable to be installed") - return false - end - return true - end, init = function() end, ---@param opts TSConfig config = function(_, opts) + if vim.fn.executable("tree-sitter") == 0 then + LazyVim.error("**treesitter-main** requires the `tree-sitter` executable to be installed") + return + end if type(opts.ensure_installed) ~= "table" then error("opts.ensure_installed must be a table") end From 167d39b2bef24024be1a48267e14cc6c82146462 Mon Sep 17 00:00:00 2001 From: Jinfeng Guo Date: Mon, 15 Sep 2025 23:19:23 +0800 Subject: [PATCH 18/23] fix(clangd): rewrite the root_dir function (#6060) ## Description Nvim 0.11 had some breaking changes in lsp related parts. And one of them is that if the root_dir field of lsp config is a function, the bufnr and a function would be passed instead of the file name in nvim 0.10. As a result, the configurations of extra.lang.clangd broke. However, before the breaking changes of mason and mason-lspconfig, the configurations of clangd still worked. So maybe what really broke the configurations is mason-lspconfig, which uses a new way to enable lsp in v2. I rewrite the root_dir function and make it work both on 0.11 and 0.10. It would check whether the first argument is a string to decide whether to adapt the new interface. To test whether it works, you can just add a plugin/clangd.lua to you personal config with the content below: ```lua return { "neovim/nvim-lspconfig", opts = { servers = { clangd = { root_dir = function(bufnr, ondir) local root_directory = function(fname) return require("lspconfig.util").root_pattern( "Makefile", "configure.ac", "configure.in", "config.h.in", "meson.build", "meson_options.txt", "build.ninja" )(fname) or require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt")( fname ) or require("lspconfig.util").find_git_ancestor(fname) end if type(bufnr) == "string" then return root_directory(bufnr) else local fname = vim.api.nvim_buf_get_name(bufnr) ondir(root_directory(fname)) end end, }, }, }, } ``` ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/clangd.lua | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 33dc4ed4..19f3d1c2 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -60,18 +60,27 @@ return { keys = { { "ch", "ClangdSwitchSourceHeader", desc = "Switch Source/Header (C/C++)" }, }, - root_dir = function(fname) - return require("lspconfig.util").root_pattern( - "Makefile", - "configure.ac", - "configure.in", - "config.h.in", - "meson.build", - "meson_options.txt", - "build.ninja" - )(fname) or require("lspconfig.util").root_pattern("compile_commands.json", "compile_flags.txt")( - fname - ) or require("lspconfig.util").find_git_ancestor(fname) + root_dir = function(bufnr, ondir) + local root_directory = function(fname) + return require("lspconfig.util").root_pattern( + "Makefile", + "configure.ac", + "configure.in", + "config.h.in", + "meson.build", + "meson_options.txt", + "build.ninja" + )(fname) or require("lspconfig.util").root_pattern( + "compile_commands.json", + "compile_flags.txt" + )(fname) or require("lspconfig.util").find_git_ancestor(fname) + end + if type(bufnr) == "string" then + return root_directory(bufnr) + else + local fname = vim.api.nvim_buf_get_name(bufnr) + ondir(root_directory(fname)) + end end, capabilities = { offsetEncoding = { "utf-16" }, From 23b9cdeb3471b655532e9884fa2dd36ee83062d5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 20:42:10 +0200 Subject: [PATCH 19/23] fix(lspconfig): remove all references to lspconfig. Closes #6426 --- lua/lazyvim/plugins/extras/lang/clangd.lua | 38 +++++++++----------- lua/lazyvim/plugins/extras/lang/java.lua | 4 +-- lua/lazyvim/plugins/extras/lang/ocaml.lua | 20 +++++------ lua/lazyvim/plugins/extras/lang/r.lua | 6 +--- lua/lazyvim/plugins/extras/lang/tailwind.lua | 3 +- lua/lazyvim/plugins/lsp/init.lua | 25 ++++++++----- lua/lazyvim/util/lsp.lua | 33 ----------------- 7 files changed, 44 insertions(+), 85 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 19f3d1c2..9417b257 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -60,28 +60,22 @@ return { keys = { { "ch", "ClangdSwitchSourceHeader", desc = "Switch Source/Header (C/C++)" }, }, - root_dir = function(bufnr, ondir) - local root_directory = function(fname) - return require("lspconfig.util").root_pattern( - "Makefile", - "configure.ac", - "configure.in", - "config.h.in", - "meson.build", - "meson_options.txt", - "build.ninja" - )(fname) or require("lspconfig.util").root_pattern( - "compile_commands.json", - "compile_flags.txt" - )(fname) or require("lspconfig.util").find_git_ancestor(fname) - end - if type(bufnr) == "string" then - return root_directory(bufnr) - else - local fname = vim.api.nvim_buf_get_name(bufnr) - ondir(root_directory(fname)) - end - end, + root_markers = { + ".clangd", + ".clang-tidy", + ".clang-format", + "compile_commands.json", + "compile_flags.txt", + "configure.ac", -- AutoTools + "Makefile", + "configure.ac", + "configure.in", + "config.h.in", + "meson.build", + "meson_options.txt", + "build.ninja", + ".git", + }, capabilities = { offsetEncoding = { "utf-16" }, }, diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 9e5047cf..43c9442f 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -91,9 +91,7 @@ return { table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar)) end return { - -- How to find the root dir for a given filename. The default comes from - -- lspconfig which provides a function specifically for java projects. - root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir, + root_dir = vim.fs.root(0, vim.lsp.config.jdtls.root_markers), -- How to find the project name for a given root dir. project_name = function(root_dir) diff --git a/lua/lazyvim/plugins/extras/lang/ocaml.lua b/lua/lazyvim/plugins/extras/lang/ocaml.lua index 83f72a72..a8de495c 100644 --- a/lua/lazyvim/plugins/extras/lang/ocaml.lua +++ b/lua/lazyvim/plugins/extras/lang/ocaml.lua @@ -26,17 +26,15 @@ return { "reason", "dune", }, - root_dir = function(fname) - return require("lspconfig.util").root_pattern( - "*.opam", - "esy.json", - "package.json", - ".git", - "dune-project", - "dune-workspace", - "*.ml" - )(fname) - end, + root_markers = { + "*.opam", + "esy.json", + "package.json", + ".git", + "dune-project", + "dune-workspace", + "*.ml", + }, }, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 6320f624..f8feb0ea 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -65,11 +65,7 @@ return { opts = { servers = { r_language_server = { - root_dir = function(fname) - return require("lspconfig.util").root_pattern("DESCRIPTION", "NAMESPACE", ".Rbuildignore")(fname) - or require("lspconfig.util").find_git_ancestor(fname) - or vim.loop.os_homedir() - end, + root_markers = { "DESCRIPTION", "NAMESPACE", ".Rbuildignore" }, }, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/tailwind.lua b/lua/lazyvim/plugins/extras/lang/tailwind.lua index cbdd612e..3c7b3fac 100644 --- a/lua/lazyvim/plugins/extras/lang/tailwind.lua +++ b/lua/lazyvim/plugins/extras/lang/tailwind.lua @@ -28,11 +28,10 @@ return { }, setup = { tailwindcss = function(_, opts) - local tw = LazyVim.lsp.get_raw_config("tailwindcss") opts.filetypes = opts.filetypes or {} -- Add default filetypes - vim.list_extend(opts.filetypes, tw.default_config.filetypes) + vim.list_extend(opts.filetypes, vim.lsp.config.tailwindcss.filetypes) -- Remove excluded filetypes --- @param ft string diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index f4bdce22..335da15e 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -228,15 +228,22 @@ return { }) end - if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then - local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc") - LazyVim.lsp.disable("vtsls", is_deno) - LazyVim.lsp.disable("denols", function(root_dir, config) - if not is_deno(root_dir) then - config.settings.deno.enable = false - end - return false - end) + if vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then + ---@param server string + ---@param markers string[] + local resolve = function(server, markers) + vim.lsp.config(server, { + root_dir = function(bufnr, on_dir) + local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil + if is_deno == (server == "denols") then + local root = vim.fs.root(bufnr, markers) + return root and on_dir(root) + end + end, + }) + end + resolve("denols", vim.lsp.config.denols.root_markers) + resolve("vtsls", vim.lsp.config.vtsls.root_markers) end end, }, diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 074346d3..632a7b9f 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -107,39 +107,6 @@ function M.on_supports_method(method, fn) }) end ----@return vim.lsp.Config -function M.get_config(server) - local configs = require("lspconfig.configs") - return rawget(configs, server) -end - ----@return {default_config:lspconfig.Config} -function M.get_raw_config(server) - local ok, ret = pcall(require, "lspconfig.configs." .. server) - if ok then - return ret - end - return require("lspconfig.server_configurations." .. server) -end - -function M.is_enabled(server) - local c = M.get_config(server) - return c and c.enabled ~= false -end - ----@param server string ----@param cond fun( root_dir, config): boolean -function M.disable(server, cond) - local util = require("lspconfig.util") - local def = M.get_config(server) - ---@diagnostic disable-next-line: undefined-field - def.document_config.on_new_config = util.add_hook_before(def.document_config.on_new_config, function(config, root_dir) - if cond(root_dir, config) then - config.enabled = false - end - end) -end - ---@param opts? LazyFormatter| {filter?: (string|lsp.Client.filter)} function M.formatter(opts) opts = opts or {} From 271fecb067ec223a8eab90c1abd1162e9ebae5df Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 20:44:14 +0200 Subject: [PATCH 20/23] fix(jdtls): root_dir --- lua/lazyvim/plugins/extras/lang/java.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 43c9442f..75971afb 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -91,7 +91,6 @@ return { table.insert(cmd, string.format("--jvm-arg=-javaagent:%s", lombok_jar)) end return { - root_dir = vim.fs.root(0, vim.lsp.config.jdtls.root_markers), -- How to find the project name for a given root dir. project_name = function(root_dir) @@ -165,12 +164,10 @@ return { end end local function attach_jdtls() - local fname = vim.api.nvim_buf_get_name(0) - -- Configuration can be augmented and overridden by opts.jdtls local config = extend_or_override({ cmd = opts.full_cmd(opts), - root_dir = opts.root_dir(fname), + root_dir = vim.fs.root(0, vim.lsp.config.jdtls.root_markers), init_options = { bundles = bundles, }, From 2f75d9a90fc9cf43f7ba2365dbb745e5595fc02e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 21:00:19 +0200 Subject: [PATCH 21/23] fix(lsp): properly ambiguate denols vs vtsls --- lua/lazyvim/plugins/lsp/init.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 335da15e..48c96059 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -230,20 +230,24 @@ return { if vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then ---@param server string - ---@param markers string[] - local resolve = function(server, markers) + local resolve = function(server) + local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir vim.lsp.config(server, { root_dir = function(bufnr, on_dir) local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil if is_deno == (server == "denols") then - local root = vim.fs.root(bufnr, markers) - return root and on_dir(root) + if root_dir then + return root_dir(bufnr, on_dir) + elseif type(markers) == "table" then + local root = vim.fs.root(bufnr, markers) + return root and on_dir(root) + end end end, }) end - resolve("denols", vim.lsp.config.denols.root_markers) - resolve("vtsls", vim.lsp.config.vtsls.root_markers) + resolve("denols") + resolve("vtsls") end end, }, From 2f309fc8b5bf93af25293c1e4688d409de718a36 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Sep 2025 21:14:42 +0200 Subject: [PATCH 22/23] perf(treesitter-main): only enable highlighting for installed treesitter langs --- lua/lazyvim/plugins/extras/ui/treesitter-main.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-main.lua b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua index 8987b732..1571cc03 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-main.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-main.lua @@ -28,6 +28,7 @@ return { if #install > 0 then TS.install(install, { summary = true }) + vim.list_extend(installed, install) end -- backwards compatibility with the old treesitter config for indent @@ -38,8 +39,11 @@ return { -- backwards compatibility with the old treesitter config for highlight if vim.tbl_get(opts, "highlight", "enable") then vim.api.nvim_create_autocmd("FileType", { - callback = function() - pcall(vim.treesitter.start) + callback = function(ev) + local lang = vim.treesitter.language.get_lang(ev.match) + if vim.tbl_contains(installed, lang) then + pcall(vim.treesitter.start) + end end, }) end From 14d2a9baa1306bd0969112fcf8f69a11840cc5e6 Mon Sep 17 00:00:00 2001 From: "Md. Iftakhar Awal Chowdhury" <42291930+AtifChy@users.noreply.github.com> Date: Tue, 16 Sep 2025 01:17:45 +0600 Subject: [PATCH 23/23] fix(schemastore): use `before_init` instead of `on_new_config` to load schema store (#6427) ## Description `vim.lsp.config` doesn't provide `on_new_config`, which is causing `b0o/SchemaStore.nvim` fail to load. This PR replaces `on_new_config` with `before_init` fixing the issue. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/json.lua | 2 +- lua/lazyvim/plugins/extras/lang/yaml.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/json.lua b/lua/lazyvim/plugins/extras/lang/json.lua index d51a6b19..453a6a77 100644 --- a/lua/lazyvim/plugins/extras/lang/json.lua +++ b/lua/lazyvim/plugins/extras/lang/json.lua @@ -27,7 +27,7 @@ return { servers = { jsonls = { -- lazy-load schemastore when needed - on_new_config = function(new_config) + before_init = function(_, new_config) new_config.settings.json.schemas = new_config.settings.json.schemas or {} vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas()) end, diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index b460f3c5..9d8135e7 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -29,7 +29,7 @@ return { }, }, -- lazy-load schemastore when needed - on_new_config = function(new_config) + before_init = function(_, new_config) new_config.settings.yaml.schemas = vim.tbl_deep_extend( "force", new_config.settings.yaml.schemas or {},