Skip to content

[audit] remove dead nvim<0.12 branch from LspToggle#180

Closed
stanfish06 wants to merge 1 commit into
masterfrom
audit/lsp-toggle-dead-branch
Closed

[audit] remove dead nvim<0.12 branch from LspToggle#180
stanfish06 wants to merge 1 commit into
masterfrom
audit/lsp-toggle-dead-branch

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

What

lua/config/plugin_config.lua — the LspToggle user command — contains a version guard that was added for backward compatibility with Neovim < 0.12:

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

Where

lua/config/plugin_config.luaLspToggle command body, lines 125–130.

Why it matters

The config already requires Neovim 0.12+ exclusively: vim.lsp.config(), vim.lsp.enable(), and vim.pack are all 0.12 APIs used unconditionally throughout the config. The else branch is therefore dead code — it can never execute — and it points at vim.lsp.stop_client(), which is deprecated in 0.12 and will be removed in a future version.

Change

Remove the version guard; call client:stop() unconditionally:

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

Test plan

  • :LspToggle luals on a Lua buffer → luals stops
  • Run again → luals re-enables
  • No vim.lsp.stop_client deprecation warning in :checkhealth

https://claude.ai/code/session_01GHYEWxoG5uHqsZM28upN1w


Generated by Claude Code

The config already requires Neovim 0.12+ (vim.lsp.config, vim.lsp.enable,
vim.pack are all 0.12 APIs), so the else branch calling the deprecated
vim.lsp.stop_client() is unreachable dead code.  Remove the version
guard and call client:stop() unconditionally.

https://claude.ai/code/session_01GHYEWxoG5uHqsZM28upN1w
@stanfish06 stanfish06 closed this Jun 11, 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