Skip to content

[audit] LspToggle gates client:stop() on nvim-0.12 but the method has been available since 0.11 #263

Description

@stanfish06

What

plugin_config.lua:136–141 in the :LspToggle command:

if vim.fn.has("nvim-0.12") == 1 then
    client:stop()
else
    vim.lsp.stop_client(client.id)   -- deprecated
end

vim.lsp.Client:stop() (the object method on the client table) was introduced in the Neovim 0.11 LSP client rewrite, at the same time vim.lsp.stop_client() (the free function) was deprecated. The has("nvim-0.12") guard means Neovim 0.11 users still hit the deprecated path.

Where

lua/config/plugin_config.lua:136

Why it matters

On Neovim 0.11, :LspToggle calls the deprecated vim.lsp.stop_client(). This may generate deprecation warnings in the future and may stop working if the function is eventually removed. Neovim 0.11 is the current stable release as of mid-2026, so the incorrect branch is the majority path.

Recommended action

Lower the version check to 0.11:

if vim.fn.has("nvim-0.11") == 1 then
    client:stop()
else
    vim.lsp.stop_client(client.id)
end

Or, since vim.lsp.stop_client() is only kept for very old Neovim versions, replace the whole branch with client:stop() and drop the guard entirely if the config already requires 0.11+ in practice (which it does — vim.lsp.config(), vim.lsp.enable(), vim.lsp.completion.enable(), and vim.o.winborder are all 0.11 additions).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions