-
Notifications
You must be signed in to change notification settings - Fork 272
Support neosnippet for function arguments completion #396
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
Comments
Kind of duplicate with #379. |
I got the same problem ,Is there any solution? |
@pendragonsaber I've switched to https://github.com/neoclide/coc.nvim and it seems to work a lot better (even without neosnippet) |
I have tried it, but there are some problems with the configuration, I can't jump the code block. |
It may fixes the problem. autocmd CompleteDone * call neosnippet#complete_done() I think LanguageClient-neovim should use |
thanks i will try it |
After implementing this, completing class snippet becomes like this
|
@rraks It must be reproduce-able for other people. |
@Shougo is there any configuration required to make it work? |
Nothing. But please use the latest version of neosnippet plugin. |
@Shougo looks like it works, but I found a strange behavior. After expanding a function I got snippet in the following format:
I can move between 1-3 elements (function arguments) with |
@jubnzv Please upload the minimal vimrc with the reroduce-able instructions like this issue. |
If not, I cannot help you. |
It should be jumped to the last of |
@Shougo Thank you for your reply. Here is minimal vimrc; this issue can be reproduced like on my screencast from previous post:
My environment: latest versions of related vim plugins; neovim 0.3.4, cquery language server. init.vim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'https://github.com/Shougo/neosnippet.vim'
Plug 'https://github.com/Shougo/neosnippet-snippets'
Plug 'https://github.com/Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
call plug#end()
set hidden
filetype plugin indent on
syntax enable
let g:python3_host_prog = '/usr/bin/python3.6'
" Deoplete
let g:deoplete#enable_at_startup = 1
let g:deoplete#auto_complete_start_length = 1
let g:deoplete#enable_smart_case = 1
call deoplete#custom#source('LanguageClient',
\ 'min_pattern_length',
\ 2)
inoremap <expr><A-q> pumvisible() ? deoplete#mappings#close_popup() : "\<CR>"
inoremap <expr><A-j> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr><A-k> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr><A-o> deoplete#mappings#manual_complete()
" neosnippet
imap <A-l> <Plug>(neosnippet_expand_or_jump)
smap <A-l> <Plug>(neosnippet_expand_or_jump)
xmap <A-l> <Plug>(neosnippet_expand_target)
if has('conceal')
set conceallevel=2 concealcursor=niv
endif
" LanguageClient
let g:LanguageClient_loggingLevel = 'DEBUG'
let g:LanguageClient_settingsPath = '~/.config/nvim/settings.json'
let g:LanguageClient_loggingFile='/tmp/lc.log'
let g:LanguageClient_serverCommands = {
\ 'cpp': ['/usr/local/bin/cquery', '--log-file=/tmp/cquery.log'],
\ 'c': ['/usr/local/bin/cquery', '--log-file=/tmp/cquery.log'],
\ }
let g:LanguageClient_rootMarkers = {
\ 'cpp': ['compile_commands.json', 'build'],
\ 'c': ['compile_commands.json', 'build'],
\ }
let g:LanguageClient_autoStart = 0
let g:LanguageClient_hasSnippetSupport = 1
nnoremap <F5> :call LanguageClient_contextMenu()<CR> |
Confirmed. It is conflict of |
@rraks I have added |
@Shougo Thanks! |
Verified. Closing. |
@Shougo Shougo/neosnippet.vim@a3c6182 breaks down snippet expansion keybindings. With init.vim from #396 (comment) I can't expand selected snippet from pumvisible anymore. |
The same here, the very last commit broke everything for me either. |
Please use the latest version of neosnippet. |
Just verified, everything works with the latest master (Shougo/neosnippet.vim@c9b41fe). |
Summary
It seems that
LanguageClient-neovim
does not work well withneosnippet
for function arguments completion.Reproduction
nvim --version
orvim --version
):git rev-parse --short HEAD
): b96f442bin/languageclient --version
):String::from
in the rust.Current Behavior
It will autocomplete
String::from(${1:s})
with the cursor in the end of the line.Expected Behavior
It should trigger neosnippet to expand each arguments in the function.
The text was updated successfully, but these errors were encountered: