Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with honza/vim-snippets #4

Open
rubdos opened this issue Feb 14, 2018 · 4 comments
Open

Incompatibility with honza/vim-snippets #4

rubdos opened this issue Feb 14, 2018 · 4 comments

Comments

@rubdos
Copy link

rubdos commented Feb 14, 2018

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
Copy link
Author

rubdos commented Mar 9, 2018

@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 :-)

@leoatchina
Copy link

leoatchina commented Jul 26, 2018

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 .

@ghost
Copy link

ghost commented Jul 27, 2018

Works on gvim / windows, should update readme?

@rubdos
Copy link
Author

rubdos commented Jul 27, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants