From a8a0acb502ce44c44695ce8ed4f7e99c541b18f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 4 Jun 2026 13:16:02 +0000 Subject: [PATCH 1/2] fix(lsp): replace deprecated vim.lsp.stop_client() with client:stop() vim.lsp.stop_client(id) is deprecated in Neovim 0.12; the new API is the client:stop() method directly on the client object. Removes the TODO comment that tracked this work. https://claude.ai/code/session_014eiycWG5KeoanDfLHDC825 --- lua/config/plugin_config.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/config/plugin_config.lua b/lua/config/plugin_config.lua index fee4ec2..58d4288 100644 --- a/lua/config/plugin_config.lua +++ b/lua/config/plugin_config.lua @@ -119,8 +119,7 @@ if not is_vscode then vim.api.nvim_create_user_command("LspToggle", function(opts) local name = opts.args for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0, name = name })) do - -- TODO: replace with Client:stop() after current api deprecate - vim.lsp.stop_client(client.id) + client:stop() return end vim.lsp.enable(name) From 57b01a2c3bfc4c67305041608b6c5e8c9c19cd6f Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 15:24:06 +0000 Subject: [PATCH 2/2] fix(lsp): make LspToggle stop_client backward compatible with nvim 0.11 Use vim.fn.has('nvim-0.12') to branch between client:stop() (0.12+) and vim.lsp.stop_client(client.id) (0.11 and below). Co-authored-by: Zhiyuan --- lua/config/plugin_config.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/config/plugin_config.lua b/lua/config/plugin_config.lua index 58d4288..9768e66 100644 --- a/lua/config/plugin_config.lua +++ b/lua/config/plugin_config.lua @@ -119,7 +119,11 @@ if not is_vscode then vim.api.nvim_create_user_command("LspToggle", function(opts) local name = opts.args for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0, name = name })) do - client:stop() + if vim.fn.has('nvim-0.12') == 1 then + client:stop() + else + vim.lsp.stop_client(client.id) + end return end vim.lsp.enable(name)