ludovicchabant / vim-gutentags

A Vim plugin that manages your tag files
https://bolt80.com/gutentags/
MIT License
2.28k stars 175 forks source link

gtags-cscope job failed on Neovim #233

Open xaljer opened 5 years ago

xaljer commented 5 years ago

Describe the bug Open a c file with neovim, got this error:

Snipaste_2019-03-09_13-44-56

Steps to reproduce

  1. Open a file under root marker (gutentags_project_root)
  2. view error messages, show above

Share your setup

Post the logs

Additional context Add any other context about the problem here.

ludovicchabant commented 5 years ago

Hi! I can't reproduce the bug so far... and I'm wondering why you have all those garbage characters in the job output. Could you try running gtags by hand in the same way Gutentags does? (and see if it outputs anything similar)

If you check those messages you'll see it runs gtags --incremental "C:\Users\ryan\.cache\tags\D--cJSON-" from the D:\cJSON directory.

xaljer commented 5 years ago

I'm not sure what's the "same way Gutentags does"? Run gtags and global in shell is OK. It works well on gvim with same configs. so, i think it's relative to Neovim.

ludovicchabant commented 5 years ago

The "same way Gutentags does" was about manually running that command line I took from your screenshot: gtags --incremental "C:\Users\ryan\.cache\tags\D--cJSON-"

It looks like when you run it from Neovim, gtags is somehow running into invalid input -- you can see that amidst all the weird garbage characters it's also raising UnexpectedToken errors and such... as such, the gtags process exits with an error code, and Gutentags reports it to you. I have no idea why it would be different in Neovim... if running the above command line by hand doesn't reproduce the errors, then maybe there's some other issue, like maybe Neovim runs with a different environment that makes Gutentags run an unexpected version of gtags, or using an unexpected encoding, or something...

SurpassAll commented 5 years ago

Can u prinr ur configuration? I should konw how it is.

ilovin commented 5 years ago

manual run the cmd gen the G* files in ~/.config/tags successfully. however in neovim it gens files with 0kb.

    8 " change focus to quickfix window after search (optional).                                                                                                                                            
    7 let g:gutentags_plus_switch = 1                                                                                                                                                                       
    6 let g:gutentags_define_advanced_commands = 1                                                                                                                                                          
    5                                                                                                                                                                                                       
    4 let g:gutentags_exclude_filetypes = ['l']                                                                                                                                                             
    3 let $GTAGSLABEL = 'native-pygments'                                                                                                                                                                   
    2 "let $GTAGSLABEL = 'pygments'                                                                                                                                                                         
    1 "let $GTAGSLABEL = 'native'                                                                                                                                                                           
  172 let $GTAGSCONF = '/usr/local/share/gtags/gtags.conf'                                                                                                                                                  
    1                                                                                                                        
    2 let g:gutentags_project_root = ['.root', '.svn', '.git', '.hg', '.project']                                                                                                                           
    3                                                                                                                                                                                                       
    4                                                                                                                                                                                                       
    5                                                                                                                                                                         
    6 let g:gutentags_ctags_tagfile = '.tags'                                                                                                                                                               
    7                                                                                                                                                                                                       
    8                                                                                                                                                                       
    9 let g:gutentags_modules = ['gtags_cscope']                                                                                                                                                            
   10 "let g:gutentags_modules = []                                                                                                                                                                         
   11 "if executable('ctags')                                                                                                                                                                               
   12 "¦  let g:gutentags_modules += ['ctags']                                                                                                                                                              
   13 "endif                                                                                                                                                                                                
   14 "if executable('gtags-cscope') && executable('gtags')                                                                                                                                                 
   15 "¦  let g:gutentags_modules += ['gtags_cscope']                                                                                                                                                       
   16 "endif                                                                                                                                                                                                
   17                                                                                                                                                                                                       
   18                                                                                                                
   19 let g:gutentags_cache_dir = expand('~/.cache/tags')                                                                                                                                                   
   20