vim-gutentags icon indicating copy to clipboard operation
vim-gutentags copied to clipboard

gtags-cscope job failed on Neovim

Open xaljer opened this issue 6 years ago • 5 comments

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

  • What OS and version of Vim are you using? Windows10, Neovim 0.4-434
  • What version of ctags, gtags, or whatever do you have installed? gtags: 6.6.3; ctags: universal ctags 6fd7f3e9
  • Are you using g:gutentags_cache_dir? let g:gutentags_cache_dir = expand('./.tags')

Post the logs

  • Run :let g:gutentags_trace = 1.
  • Reproduce the bug.
  • Run :messages and show the messages that Gutentags posted.
  • Look for the tags.log file that Gutentags' script left behind, and post its contents. I can not find the tags.log.

Additional context Add any other context about the problem here.

xaljer avatar Mar 23 '19 13:03 xaljer

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.

ludovicchabant avatar Apr 09 '19 06:04 ludovicchabant

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.

xaljer avatar Apr 13 '19 05:04 xaljer

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...

ludovicchabant avatar May 06 '19 04:05 ludovicchabant

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

SurpassAll avatar May 30 '19 07:05 SurpassAll

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                                                       

ilovin avatar Jul 02 '19 09:07 ilovin