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
Prefetching can reduce latency to 0ms, removing the final bottleneck for blink.cmp's latency, the LSP itself!
With #697 merged, we now have a reliable way to pass the source of a completion request upstream, meaning completion.trigger.prefetch_on_insert = true seems to work reliably. Some ideas of when to prefetch:
InsertEnter
CursorHold? Only in insert mode?
After pressing c in normal mode?
After deleting characters onto a trigger character (a.b| -> a.|)
After typing , (for function arguments)
After pressing some trigger characters ((, [, etc) regardless of source's trigger characters, by language
Possibly on CmdlineEnter or CmdwinEnter for cmdline prefetching? #305 and #665 should also probably allow prefetching somehow, although I'm not sure if that's already handled by InsertEnter.
This may not be a good idea. Pressing c following a huge text object or motion may change the whole buffer content a lot, making the prefetched completion items unusable.
After deleting characters onto a trigger character (a.b| -> a.|)
This makes sense and it seems that this is the default behavior of nvim-cmp
CursorHold
Is cursorhold autocmd repeatedly triggered? Some AI related sources are expensive and may not want to be silently triggered at background.
Just added the idea of prefetching after , since that's the typical case for typing functions. Also after some characters like ( and [, which aren't ideal for showing the menu, but are for prefetching. In general, since prefetching doesn't show the menu, we can be much more liberal with when we trigger it
Pressing c following a huge text object or motion may change the whole buffer content a lot, making the prefetched completion items unusable
It may but in this case the completions will be thrown away so this should be harmless. I believe on average the prefetched completions would be useful, but we'd need to test this
Is cursorhold autocmd repeatedly triggered? Some AI related sources are expensive and may not want to be silently triggered at background.
Good point, we should make prefetching opt-in for the sources
Feature Description
Prefetching can reduce latency to 0ms, removing the final bottleneck for blink.cmp's latency, the LSP itself!
With #697 merged, we now have a reliable way to pass the source of a completion request upstream, meaning
completion.trigger.prefetch_on_insert = true
seems to work reliably. Some ideas of when to prefetch:InsertEnter
CursorHold
? Only in insert mode?c
in normal mode?a.b|
->a.|
),
(for function arguments)(
,[
, etc) regardless of source's trigger characters, by languageCC @stefanboca
The text was updated successfully, but these errors were encountered: