I am trying to create a new source for compe to auto-complete Vlime suggestions, but I am utterly at a loss here. I wrote sources for completion-nvim and NCM2 (here and here), so I know what to do on the Vlime end, but I have no idea what to do on the compe end.
The documentation barely exists and what is there is in broken English. It lists functions which need to be implemented, but it does not list what arguments those functions take and what they return. I have tried to piece together something from other sources, but to no effect. Has someone the experience with Vlime to help me out? Or at least help improve the documentation of compe.
Other people have created sources, so either I’m too stupid to use compe, or they have some sort of super power.
Thank you for the feedback, but I must be doing something wrong because nothing is happening. I have the following code:
" plugin/compe-vlime.vim
if get(s:, 'compe_vlime_loaded', v:false)
finish
endif
let s:compe_vlime_loaded = v:true
let s:source = {
\ 'get_metadata': function('compe#vlime#get_metadata'),
\ 'determine': function('compe#vlime#determine'),
\ 'complete': function('compe#vlime#complete'),
\ }
call compe#register_source('vlime', s:source)
This gets called just fine
" autoload/compe/vlime.vim
function! compe#vlime#get_metadata(...) abort
" Common Lisp is a Lisp-2, hence we allow duplicates
return {'priority': 100, 'filetypes': ['lisp'], 'dup': v:true, 'menu': 'Vlime'}
endfunction
function! compe#vlime#determine(context)
" I have no idea what this does, I'm just copying what others are doing.
return compe#helper#determine(a:context)
endfunction
function! compe#vlime#complete(self, context)
echom 'ping'
endfunction
Now when I try to complete something in a Lisp buffer there should be a ping message, but there is nothing. Maybe I am doing some order of instructions wrong?