Skip to content

[audit] Guard native LSP completion when blink.cmp active; drop dead <0.11 compat#282

Merged
stanfish06 merged 1 commit into
masterfrom
claude/festive-goodall-s176j4
Jul 11, 2026
Merged

[audit] Guard native LSP completion when blink.cmp active; drop dead <0.11 compat#282
stanfish06 merged 1 commit into
masterfrom
claude/festive-goodall-s176j4

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

What

Two mechanical fixes in lua/config/plugin_config.lua.

1. vim.lsp.completion.enable conflicts with blink.cmp (line 140)

Before:

if client and client:supports_method("textDocument/completion") then
    pcall(function()
        vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
    end)
end

After:

if not blink_ok and client and client:supports_method("textDocument/completion") then
    ...
end

Why: When blink.cmp is installed and set up, it takes over the completion pipeline and registers its own InsertCharPre/CompleteDone autocmds. Calling vim.lsp.completion.enable(autotrigger=true) on top of that registers a second set of competing autocmds, causing both systems to fire on every keystroke. The pcall wrapper only prevents crashes — it does not prevent the runtime conflict. The guard makes native completion a fallback for when blink is absent.

2. Dead Neovim <0.11 branch in LspToggle (line 152)

Before:

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

After:

client:stop()

Why: The entire LSP configuration already uses vim.lsp.config / vim.lsp.enable (0.11+ only APIs), so the else branch (vim.lsp.stop_client) can never be reached on any Neovim version that can load this config.


Generated by Claude Code

…<0.11 compat

When blink.cmp is installed, vim.lsp.completion.enable(autotrigger=true) in
LspAttach races with blink's own insert-event triggers. Guard it with
`if not blink_ok` so native completion only fires when blink is absent.

Also remove the unreachable nvim<0.11 fallback in LspToggle: vim.lsp.config/enable
(0.11+ only) are already used throughout, so vim.lsp.stop_client() can never
be reached.
@stanfish06 stanfish06 merged commit 2befbfc into master Jul 11, 2026
1 check passed
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