Open prabirshrestha opened 7 years ago
I'm wondering if #130 helps this issue nicely. So far, I don't find it a big issue that clang call is blocking though, it seems fast enough. If clangd implementation makes it even faster with blocking mode, for me it'd be even more awesome than having asynchronous mode.
I would like to write a clang autocomplete source for asyncomplete.vim
Would it be possible to have an api that looks something like this.
ClangGetCompletionItemsAsync
should take a callback parameter and returncandidates
andstartcol
from where the cursor is.candidates
contains list of completion items andstartcol
is where it should start.person.fi|
if|
is where the cursor is,candidates
would be['first_name', 'last_name']
andstartcol
would be7
. asyncomplete usesstartcol
to cache so if you type ther
, it will reuse the cache. Since caching happens aggressively you can add your customrefresh_pattern
so that it will force call the completor function any time it starts a new word or types.
or '->`.In vimrc you can then register using the following code.