Closed nmiguel closed 1 day ago
I'm not sure if this is the same issue but I'm still facing something similar.
Consider (in lua):
local foo = { bar = {} }
When I type
foo.
and I select and accept bar
from the completion menu, the entire line is replaced, so rather than foo.bar
I now have just bar
. This is incorrect because as a field of foo
, inserting bar
should not remove foo.
If instead I type
foo.b
and then accept bar
from the completion menu, the completion is correctly applied and the line becomes foo.bar
.
You can see this behavior in the following video:
As a side note, when I type
foo.
the completion menu also displays snippets, such as if
and date
. This is also visible in the above video. Accepting a snippet instead of a field replaces the entire line as well, which I believe is the correct behavior.
Sounds like a different issue, but it should be fixed by https://github.com/Saghen/blink.cmp/commit/fc348dac16f190042d20aee62ea61b66c7c1380a
Some LSP's like gopls and lua_ls are replacing instead of inserting when a completion is accepted. In Lua_ls' case this was not happening with nvim-cmp, so at least for Lua it seems to be caused by the plugin.
To exemplify what I mean: if I place my cursor at the beginning of the word foo and get a completion for bar, I'd expect to get barfoo, but get only bar.
Here is my config for blink and some LSP stuff just to make sure the problem is not there.