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
I have this configured so, for example, I can naturally select and auto-import constants by continuing to type after selecting the suggestion. I use it with other characters as well, but space is the one that causes me the most trouble. The idea here is, if I have actually selected something for completion to "confirm" that selection (to trigger auto imports) and insert the key provided, if it wasn't already part of the completion (for example, some servers will include parens, in which case I don't want to insert a second one)
In most cases this hasn't been a problem, but I've noticed that especially with the Godot language server, and especially typing in a comment, this causes nvim to hang. Upon investigation, I finally narrowed it down to this try_accept_completion function and, in particular, cmp:visible(). I can fix the hangs by swapping cmp:visible() for this hack:
localfunctionfast_cmp_visible()
ifnot (cmp.core.viewandcmp.core.view.custom_entries_view) thenreturnfalseendreturncmp.core.view.custom_entries_view:visible()
end
I believe what's happening is the config.get() call is essentially never hitting the cache, due to the oneshot revision constantly increasing. Just typing iasdf <esc> into a blank buffer in a fresh instance can result in require'cmp.config'.onetime == { revision = 8 } with the minimal vimrc.
As far as what's causing the onetime revisions, as far as I can tell it's the async_filter function in core.lua. I added some logging to the other usages of config.set_onetime in the repo and none of them triggered with the above repro except async_filter.
Steps to reproduce
For the many revisions issue, see above. For the slowness in Godot:
Open the Godot editor so the language server is running
Open a Godot file in vim
Start a comment on a newline with eg o# and just type some words separated by spaces
Notice how it hangs
Expected behavior
It should not hang
Actual behavior
It does
Additional context
Thank you!
The text was updated successfully, but these errors were encountered:
FAQ
Announcement
Minimal reproducible full config
Description
I have this configured so, for example, I can naturally select and auto-import constants by continuing to type after selecting the suggestion. I use it with other characters as well, but space is the one that causes me the most trouble. The idea here is, if I have actually selected something for completion to "confirm" that selection (to trigger auto imports) and insert the key provided, if it wasn't already part of the completion (for example, some servers will include parens, in which case I don't want to insert a second one)
In most cases this hasn't been a problem, but I've noticed that especially with the Godot language server, and especially typing in a comment, this causes nvim to hang. Upon investigation, I finally narrowed it down to this
try_accept_completion
function and, in particular,cmp:visible()
. I can fix the hangs by swappingcmp:visible()
for this hack:I believe what's happening is the
config.get()
call is essentially never hitting the cache, due to theoneshot
revision constantly increasing. Just typingiasdf <esc>
into a blank buffer in a fresh instance can result inrequire'cmp.config'.onetime == { revision = 8 }
with the minimal vimrc.As far as what's causing the onetime revisions, as far as I can tell it's the
async_filter
function incore.lua
. I added some logging to the other usages ofconfig.set_onetime
in the repo and none of them triggered with the above repro exceptasync_filter
.Steps to reproduce
For the many revisions issue, see above. For the slowness in Godot:
o#
and just type some words separated by spacesExpected behavior
It should not hang
Actual behavior
It does
Additional context
Thank you!
The text was updated successfully, but these errors were encountered: