asyncomplete-ultisnips.vim icon indicating copy to clipboard operation
asyncomplete-ultisnips.vim copied to clipboard

Incompatibility with `honza/vim-snippets`

Open rubdos opened this issue 7 years ago • 4 comments

Based on your minimal.vimrc:

" install: curl https://raw.githubusercontent.com/prabirshrestha/vim-lsp/master/minimal.vimrc -o /tmp/minimal.vimrc
" uninstall: rm /tmp/plug.vim && rm -rf /tmp/plugged
" run vim/neovim with minimal.vimrc
" vim -u minimal.vimrc
" :PlugInstall

set nocompatible hidden laststatus=2

if !filereadable('/tmp/plug.vim')
  silent !curl --insecure -fLo /tmp/plug.vim
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

source /tmp/plug.vim

call plug#begin('/tmp/plugged')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
Plug 'prabirshrestha/asyncomplete-ultisnips.vim'
call plug#end()

imap <c-space> <Plug>(asyncomplete_force_refresh)
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>"
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif

if executable('pyls')
    " pip install python-language-server
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
endif

let g:UltiSnipsExpandTrigger="<c-e>"
call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
    \ 'name': 'ultisnips',
    \ 'whitelist': ['*'],
    \ 'completor': function('asyncomplete#sources#ultisnips#completor'),
    \ }))

Without honza/vim-snippets, completing after the period .:

l = [1, 2, 3]
l.

triggers the opening of the completion window.

With honza/vim-snippets, it does not open the completion window, instead, I get Pattern not found in my (custom) status:

screenshot_2018-02-14_18-58-23

or just no completion using the minimal.vimrc. Note that this screenshot is Rust code (using vim-lsp, asyncomplete-lsp, and Rusts rls), so it's not only on Python.

Starting to type right after the . or :: starts completing again.

rubdos avatar Feb 14 '18 18:02 rubdos

@prabirshrestha, would you mind having a look here? Since your TextChangedP branch, no completion at all is happening when I use asyncomplete-ultisnips.vim. I got snippets disabled now, and that's a real pity :-)

rubdos avatar Mar 09 '18 09:03 rubdos

should be

au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#ultisnips#get_source_options({
            \ 'name': 'ultisnips',
            \ 'whitelist': ['*'],
            \ 'completor': function('asyncomplete#sources#ultisnips#completor')
            \ }))

it works on my macbook .

leoatchina avatar Jul 26 '18 05:07 leoatchina

Works on gvim / windows, should update readme?

ghost avatar Jul 27 '18 02:07 ghost

Could someone explain to me why the autocommand helps here? Is it because you should only register the completor on asyncomplete_setup?

By the way, I think I haven't seen this issue in a while now, without adding the au User.

rubdos avatar Jul 27 '18 06:07 rubdos