Shougo / neosnippet.vim

neo-snippet plugin
Other
1.12k stars 108 forks source link

Error when work with completion-nvim #504

Closed ctrl2wei closed 2 years ago

ctrl2wei commented 2 years ago

completion-nvim setting

autocmd BufEnter * lua require'completion'.on_attach()
let g:completion_enable_auto_popup      = 1
let g:completion_enable_snippet         = "Neosnippet"
let g:completion_confirm_key            = "\<CR>"
let g:completion_enable_auto_hover      = 1
let g:completion_enable_auto_signatrue  = 1
let g:completion_enable_auto_paren      = 0
let g:completion_trigger_keyword_length = 1
let g:completion_trigger_on_delete      = 1
let g:completion_timer_cycle            = 80
let g:completion_matching_strategy_list = [ 'exact', 'substring', 'fuzzy', 'all' ]
let g:completion_auto_change_source     = 1

imap  <c-j> <Plug>(completion_next_source)
imap  <c-k> <Plug>(completion_prev_source)
imap <tab> <Plug>(completion_smart_tab)
imap <s-tab> <Plug>(completion_smart_s_tab)
imap <expr> <cr>  pumvisible() ? complete_info()["selected"] != "-1" ?
\ "\<Plug>(completion_confirm_completion)"  :
\ "\<c-e>\<CR>" : "\<Plug>delimitMateCR"

let g:completion_chain_complete_list = {
  \ 'default' : [
  \    {'complete_items' : [ 'lsp' ]},
  \    {'mode' : '<c-n>'},
  \    {'mode' : '<c-p>'},
  \    {'mode' : 'file'},
  \    {'mode' : 'path'},
  \    {'complete_items' : [ 'snippet' ]}
  \ ],
\ }

neosnippet setting

  let g:neosnippet#enable_completed_snippet = 1
  let g:neosnippet#enable_complete_done = 1
  imap <C-l> <Plug>(neosnippet_expand_or_jump)

error info

Error executing vim.schedule lua callback: vim/shared.lua:490: s: expected string, got number
stack traceback:
    vim/shared.lua:490: in function 'startswith'
    ...n_nvim/.cache/init.lua/.dein/lua/completion/matching.lua:42: in function <...n_nvim/.cache/init.lua/.dein/lua/completion/matching.lua:40>
    ...n_nvim/.cache/init.lua/.dein/lua/completion/matching.lua:64: in function 'matching'
    .../.cache/init.lua/.dein/lua/completion/source/snippet.lua:53: in function 'getNeosnippetItems'
    .../.cache/init.lua/.dein/lua/completion/source/snippet.lua:125: in function 'func'
    ...n_nvim/.cache/init.lua/.dein/lua/completion/complete.lua:27: in function 'getCompletionItems'
    ...n_nvim/.cache/init.lua/.dein/lua/completion/complete.lua:85: in function 'cb'
    vim.lua:284: in function <vim.lua:284>
Shougo commented 2 years ago

It is completion-nvim's error. https://github.com/nvim-lua/completion-nvim/blob/8bca7aca91c947031a8f14b038459e35e1755d90/lua/completion/source/snippet.lua#L32

Yes. neocomplete changes the API implementation and completion-nvim does not support the change.

Shougo commented 2 years ago

completion-nvim is not maintained well. I don't recommend for you to use it.

https://github.com/nvim-lua/completion-nvim/pull/404

ctrl2wei commented 2 years ago

Thank you for your advice.