You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: opencode_ask_cmp missing '@' triggerCharacter, textEdit range, and returns '@' items on non-'@' words #343
opencode: OK
- Neovim: 0.11+
- opencode CLI: available
- snacks.nvim: enabled (with blink.cmp)
Describe the bug
In lua/opencode/ui/ask/cmp.lua, the in-process LSP server (opencode_ask_cmp) for the ask() input buffer has three completion issues when paired with completion engines like blink.cmp or nvim-cmp:
Missing triggerCharacters = { "@" }: handlers[ms.initialize] only returns completionProvider = { resolveProvider = true }. Because @ is not a standard keyword character (iskeyword), typing @ in ask() does not automatically trigger the completion menu unless triggerCharacters = { "@" } is advertised.
Unconditional @ items on every word / path: handlers[ms.textDocument_completion] returns all @ placeholders (@this, @buffer, @diagnostics, etc.) unconditionally on every completion request, even when the user is typing normal prose or a file path (e.g. ./lua/...), causing @ context items to rank above path or buffer completions.
Missing textEdit replacement range covering @:
Completion items set insertText = placeholder (e.g. "@buffer") without a textEdit range starting at the @ character. Because completion engines compute keyword bounds starting after@ (e.g. at b in @b), accepting @buffer after typing @b can produce @@buffer unless a textEdit range covering the leading @ is provided.
Steps To Reproduce
Enable blink.cmp (with lsp, path, buffer sources) for opencode_ask.
Open require("opencode").ask() and type @ — completion does not trigger automatically until a keyword character is typed or <Tab> is pressed.
Type ./ to complete a file path — @this, @buffer, @diagnostics appear above the filesystem paths because opencode_ask_cmp returns them unconditionally.
Expected Behavior
opencode_ask_cmp should advertise triggerCharacters = { "@" } in completionProvider.
textDocument/completion should only return @ context items when the token before the cursor starts with @ (or when manually invoked on an empty token), and include a textEdit range starting at the @ column.
I don't experience any of these 🤔 but I'm still on blink.cmp v1. What version are you testing with?
I did notice 3 when testing mini.input but couldn't diagnose it. Maybe this is the cause? Although I think that reads _G.opencode_completion, not the LSP. But could be the same idea.
I used to report trigger chars but removed it here: fa0a495 Maybe that relied on undefined behavior or a bug in blink.cmp that they recently changed.
Activity
nickjvandyke commentedon Nov 2, 2026
Thanks for finding and reporting this!
I don't experience any of these 🤔 but I'm still on blink.cmp v1. What version are you testing with?
I did notice 3 when testing
mini.inputbut couldn't diagnose it. Maybe this is the cause? Although I think that reads_G.opencode_completion, not the LSP. But could be the same idea.I used to report trigger chars but removed it here: fa0a495 Maybe that relied on undefined behavior or a bug in blink.cmp that they recently changed.