-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Description
I'm using Kickstart.nvim with the default blink.cmp setup and the Erlang Language Platform (ELP) LSP server. When accepting a function completion, the argument name is duplicated in the buffer.
Example:
Completing link/1 results in:
% Expected:
link(PidOrPort)
% Got:
link(PidOrPort) PidOrPort
Debug info:
The LSP server returns a valid snippet:
{
"label": "link/1",
"insertText": "link(${1:PidOrPort})",
"insertTextFormat": 2
}I used transform_items in blink.cmp to confirm this:
sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' },
providers = {
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
},
transform_items = function(_, items)
for _, item in ipairs(items) do
if item.insertText and item.insertTextFormat == 2 then
item.label = item.insertText
end
end
return items
end
}This confirms the snippet is correct by changing the completion label with the snippet, but the argument is inserted twice. It seems to be a bug in how blink.cmp handles snippet expansion, possibly in combination with Kickstart’s default config.
Versions:
Ubuntu 22.04.5 LTS
NVIM v0.11.3
elp-linux-x86_64-unknown-linux-gnu-otp-27.3
Steps to reproduce:
-Create a hello.erl file
-Add an Erlang module:
-module(hello).
start() -> % <- cursor here-Ensure the ELP LSP server is running
-Start typing "link" and accept the completion "link/1" (C-y by default)
