Home > Net >  Vim Error "An error occurred while processing function ~AND" "E716: Key not present i
Vim Error "An error occurred while processing function ~AND" "E716: Key not present i

Time:09-30

■Error Description.

Error detected while processing function <SNR>35_debounceTimeTimerCallback[1]..
<SNR>35_tapSourceCallback[4]..<SNR>35_tapSourceCallback[1]..<lambda>30[1]..<SNR
>55_set_signs[10]..<SNR>55_place_signs:
line    5:
E716: Key not present in Dictionary: linecount   1

■Cause of error content output I have set up an environment for Go development using the Vim editor on VirtusalBox.

■Contents of .vimrc

call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
call plug#end()

I am unsure of the solution, can you please let me know?

CodePudding user response:

It could be a bug of vim-lsp.

This pull request was merged to master 3 days ago. Removing the following lines from ~/.vim/plugged/vim-lsp/autoload/lsp/internal/diagnostics/signs.vim worked for me.

" Some language servers report an unexpected EOF one line past the end
if l:line == getbufinfo(a:bufnr)[0].linecount   1
    let l:line = l:line - 1
endif

CodePudding user response:

You can see a list of the files that have been sourced by Vim with :help :scriptnames:

:scr

The XX in all the <SNR>XXs in the stack trace refers to script number XX in the output of the command above.

For example, this is the output of :scr in $ vim --clean on my machine:

  1: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/defaults.vim
  2: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
  3: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
  4: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
  5: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
  6: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
  7: ~/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim

If I get a stack trace mentioning <SNR>4, I know the problem is in the ~/Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim file that comes with Vim. In this fictitious case, I would probably debug it a little bit further and open an issue on Vim's issue tracker.

In your case, the problem is very likely to happen in one of your plugins. Once you have identified it, you should head off to its issue tracker.

  • Related