■错误描述。
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
■错误内容输出的原因我已经使用VirtusalBox上的Vim编辑器为Go开发设置了一个环境。
■.vmrc 的内容
call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
call plug#end()
我不确定解决方案,你能告诉我吗?
您可以看到Vim使用:help :scriptnames
:来源的文件列表
:scr
堆栈跟踪中所有<SNR>XX
中的XX
是指上面命令输出中的脚本编号XX
。
例如,这是我的机器上$ vim --clean
中:scr
的输出:
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
如果我得到一个提到<SNR>4
的堆栈跟踪,我知道问题出在Vim附带的~/Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
文件中。在这个虚构的案例中,我可能会进一步调试它,并在Vim的问题跟踪器上打开一个问题。
在您的情况下,问题很可能发生在您的某个插件中。一旦你确定了它,你应该前往它的问题跟踪器。
这可能是vim-lsp的一个错误。
此拉取请求已在3天前合并到master。从~/.vim/pludged/vim-lsp/autoload/lsp/internal/diagnostics/signs.vim中删除以下行对我有效。
" 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