Closed heygarrett closed 1 year ago
I just ran into this with lua-language-server, so it doesn't seem to be an issue unique to sourcekit-lsp.
It's a weird issue, because snippy shouldn't be interfering with omni completion. I don't have a lot of time right know, but will try to look into it as soon as possible.
I tried to reproduce the bug but wasn't successful. Could you try to reproduce it using the minimal config below?
You can save it as minimal.lua
and run as nvim --clean -u minimal-lazy.lua <file to edit>
. I used the file below:
fooooooo = {
bar = 1,
baz = 2,
}
I tried the following:
foo
, press <c-x><c-o>
then <c-n>
to select fooooooo
and press '.'.<c-x><c-o>
again. It shows bar and baz. Seems to work.I found a way to reproduce it with your minimal.lua (though I had to change the snippy branch from local-snippets
to master
). First, add plugin neodev (which I can reproduce the issue without, but for the simplicity of this example) and set vim.bo.omnifunc
in the config
function:
Then follow these steps to reproduce inside your ~/.config/nvim
directory:
nvim -u minimal.lua <file-to-edit>.lua
vim.fn.api
<c-x><c-o>
(it should insert completion vim.fn.api_info
) ().
<c-x><c-o>
It may be an upstream bug in Neovim. I just pushed a commit to try to work around that.
Description
I'm using sourcekit-lsp for Swift. When using omni complete (eg,
<c-x><c-o>
), selecting the result from the pop-up menu and then continuing to type seems to create a weird state in which triggering omni complete a second time enters the first result again.Steps to Reproduce
mkdir swift_test && cd swift_test && swift package init --type executable
)nvim Sources/swift_test/swift_test.swift
swift_
and then use<c-x><c-o>
to open the pop-up menu for omni complete<c-n>
or<c-p>
to highlight theswift_test
module in the pop-up menu<c-x><c-o>
againExpected Result
At step 5
swift_test
would be inserted as text.At step 6 the pop-up menu would be dismissed.
At step 7 the inserted text would remain as is and the pop-up menu would open again.
Actual Result
At step 7 the text
swift_test.
is replaced withsswift_test
. If you type two periods at step 6 instead of only one,swift_test.
is replaced withswswift_test
.Additional Context
https://user-images.githubusercontent.com/1154912/206866641-80674c1e-118d-46bf-acab-2854e29d25d5.mp4
Here's my snippy config: