Skip to content

[audit] Remove deprecated vim.lsp.stop_client() dead branch in LspToggle#189

Closed
stanfish06 wants to merge 1 commit into
masterfrom
audit/remove-deprecated-lsp-stop-client
Closed

[audit] Remove deprecated vim.lsp.stop_client() dead branch in LspToggle#189
stanfish06 wants to merge 1 commit into
masterfrom
audit/remove-deprecated-lsp-stop-client

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

What

Remove the vim.fn.has('nvim-0.12') version branch inside LspToggle and call client:stop() unconditionally.

File: lua/config/plugin_config.lua:124-130

Before:

for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0, name = name })) do
    if vim.fn.has('nvim-0.12') == 1 then
        client:stop()
    else
        vim.lsp.stop_client(client.id)  -- deprecated in 0.12
    end
    return
end

After:

for _, client in ipairs(vim.lsp.get_clients({ bufnr = 0, name = name })) do
    client:stop()
    return
end

Why it matters

vim.lsp.stop_client() was deprecated in Neovim 0.12 in favour of client:stop() (confirmed in Neovim 0.12 release notes). The config already requires 0.12+ everywhere else (vim.lsp.config, vim.lsp.enable, vim.pack, PackChanged event), so the else branch is dead weight that will never execute.

Risk

None — the removed branch was already unreachable on the effective minimum Neovim version.

https://claude.ai/code/session_01RZqsvzmVzHrEFysuE6VH6a


Generated by Claude Code

The config already targets Neovim 0.12+ (uses vim.lsp.config,
vim.lsp.enable, vim.pack, PackChanged). vim.lsp.stop_client() was
deprecated in 0.12 in favour of client:stop(). The pre-0.12 else
branch is dead weight and can be removed cleanly.

https://claude.ai/code/session_01RZqsvzmVzHrEFysuE6VH6a
@stanfish06 stanfish06 closed this Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants