install.fairie/dotfiles/.vim/plugged/ale/autoload/asyncomplete/sources/ale.vim
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

26 lines
947 B
VimL

function! asyncomplete#sources#ale#get_source_options(...) abort
let l:default = extend({
\ 'name': 'ale',
\ 'completor': function('asyncomplete#sources#ale#completor'),
\ 'whitelist': ['*'],
\ 'triggers': asyncomplete#sources#ale#get_triggers(),
\ }, a:0 >= 1 ? a:1 : {})
return extend(l:default, {'refresh_pattern': '\k\+$'})
endfunction
function! asyncomplete#sources#ale#get_triggers() abort
let l:triggers = ale#completion#GetAllTriggers()
let l:triggers['*'] = l:triggers['<default>']
return l:triggers
endfunction
function! asyncomplete#sources#ale#completor(options, context) abort
let l:keyword = matchstr(a:context.typed, '\w\+$')
let l:startcol = a:context.col - len(l:keyword)
call ale#completion#GetCompletions('ale-callback', { 'callback': {completions ->
\ asyncomplete#complete(a:options.name, a:context, l:startcol, completions)
\ }})
endfunction