-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quitting in the middle of gtags generating raises an error #319
Comments
In theory, Neovim is supposed to kill child processes on exit, and the child process' script has a Incidentally, I was testing some stuff on Windows and because |
Okay, thank you.
I have no idea how to fix it in Neovim. Could you please adapt it to Neovim? When we exit Neovim before the finish of gtags generation, delete the gtags files before exit so that they will be regenerated next time. Another idea is to expose two APIs. One is to output the gtags folder of the project. The other is to output whether gtags generation is finished or not. Then we can use autocmd to delete the folder if the generation is not finished. Any thoughts? Thank you very much @ludovicchabant |
In my case, I installed https://github.com/universal-ctags/homebrew-universal-ctags at my mac. |
I've discovered the problem and submitted a PR(#359), maybe it helps you @rockyzhang24 . |
@iLeeWell this is indeed the issue (for me, with vim-9.1.418 and gtags-6.6.12). Your fix does stifle the error message (thanks), but @rockyzhang24 is right that it means we have to start all over again next time we start. There is not much choice but to let the generation run until completion, or else the database will never be generated. For a large source tree this can take a long time. I'm not sure if it's possible, but there should be some way to have partial results saved so it could be closer and closer each time the editor was started, and eventually finish. The error also serves as a warning for when there is some problem generating the files, for example I'm here because my gtags was hanging in a certain directory and would never finish, turns out to be a Pygments issue. I had to disable Pygments as a GNU global method. If the GTAGS, GRTAGS, GPATH files got deleted every time, there would have been no way to know a problem existed and the db would never have been generated. So I think maybe the delete should occur as in the patch, with the following caveats:
@ludovicchabant no |
Describe the bug
In a very large repo like https://github.com/torvalds/linux, when I open a file, gtags will be generating automatically but it takes a while. In the middle of the gtags generating process, I run
:q
to quit Neovim. Then I open this file again, it showsgutentags: gtags-cscope job failed, returned: 1
at the bottom. When I try to run:GutentagsUpdate!
to re-generate the gtags, this error shows again.To make it work, I need go to the directory storing the tags and delete the folder for gtags of this repo. Then I open a file of the repo, gtags will be generated again without that error.
This means that, in a very large repo, I cannot quit and have to stay there until the gtags generating process finishes.
Steps to reproduce
See above.
Share your setup
macOS 12.2
nvim 0.6
ctags
,gtags
, or whatever do you have installed?Universal Ctags 5.9.0,
gtags (Global) 6.6.8
g:gutentags_cache_dir
?Yes. I set it to
~/.cache/tags/
. However, if I don't set it, this issue still exists.Post the logs
Additional context
Nothing.
Thank you very much.
The text was updated successfully, but these errors were encountered: