liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.88k stars 89 forks source link

Pass --extras parameter to c or cpp #420

Open SunJun8 opened 2 years ago

SunJun8 commented 2 years ago

Environment:

OS: x86_64 Linux 5.10.93.2-microsoft-standard-WSL2 Neovim version:NVIM v0.6.1 This plugin version: https://github.com/liuchengxu/vista.vim/commit/a0469c645dcbe4033b857da27d35491f39e2f776 I'm using nvim-lsp:

plugin config

 nmap <silent> <F2> :Vista finder nvim_lsp<CR>
 let g:vista_default_executive = 'nvim_lsp'
 let g:vista_executive_for = {
   \ 'c': 'nvim_lsp',
   \ 'cpp': 'nvim_lsp',
   \ 'php': 'nvim_lsp',
   \ 'python': 'nvim_lsp',
   \ }
 let g:vista_fzf_preview = ['right:50%']
 let g:vista#renderer#enable_icon = 1

https://github.com/liuchengxu/vista.vim/blob/a0469c645dcbe4033b857da27d35491f39e2f776/autoload/vista/executive/ctags.vim#L41

https://github.com/liuchengxu/vista.vim/blob/a0469c645dcbe4033b857da27d35491f39e2f776/autoload/vista/executive/ctags.vim#L46

我对vim语法不是很了解,对我来说这里实际情况是目标文件为.c时,仍然传递了--extras=+F参数。删除--extras=+F即可正常工作,但这貌似并不是个通用方案

[vista.vim] Fail to run ctags: ctags --format=2 --excmd=pattern --fields=+nksSaf --extras=+F --sort=no --append=no --language-force=c --c-kinds=pfsdevghtmu -f- /home/jokeo/.cache/nvim/vista/1b81cc248f7dd7679e3566
3224593fdc67b61d9b0260ef3e825a8fc18626eafc.c
Error detected while processing function vista#[36]..<SNR>105_HandleArguments[28]..vista#finder#Dispatch[10]..vista#finder#fzf#Run[8]..vista#finder#GetSymbols[38]..<SNR>108_TryAlternatives[16]..vista#executive#ct
ags#Run[1]..<SNR>114_Dispatch[11]..<SNR>114_Run:
line    8:
E121: Undefined variable: s:data
Error detected while processing function vista#[36]..<SNR>105_HandleArguments[28]..vista#finder#Dispatch[10]..vista#finder#fzf#Run:
line    8:
E714: List required
Press ENTER or type command to continue