GithubHelp home page GithubHelp logo

Comments (11)

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Hi!

Sadly, I wouldn't say "so far so good" when you get the "The tags file is already being updated, please try again later" message on startup. This usually means the .lock file has been left over from last time the tags file was generated... so most probably a bug, although it may happen also in extreme cases of Vim and its sub-processes being killed, I guess... but yeah, not a first good sign :)

FYI, when the .lock file is getting in the way, you can run :GutentagsUnlock to delete that file, and then :GutentagsUpdate! to regenerate the whole tags file for the current "project"...

You did get some log that mentions running ctags at some point though so I guess it did get past that problem... but the log file is incomplete. What you got should be followed by "Replacing tags file (notice how it generates a tags.temp file... it needs to then move it to just tags), Unlocking tags file (deleting the .lock file) and Done (see the update_tags.cmd script for more details). So most likely the ctags process isn't exiting, or there's a problem and the whole script aborts... can you check that Vim has ctags in its PATH? Can you check that running that command from the log file actually works? Can you also check that you don't have zombie ctags processes?

Thanks!

from vim-gutentags.

gummesson avatar gummesson commented on August 19, 2024

The ctags executable is in Vim's path. Running :GutentagsUnlock and then :GutentagsUpdate! produces the same result, i.e. no tags file.

However, after some experimentation I think I've managed to find the culprit: it's the double quotes around the executable. When I run this:

ctags -R -f "d:\Git\<project>\tags.temp"  --exclude=".git" --exclude=".sass-cache" --exclude="tmp" --exclude=".bundle" --exclude="*.min.*" --exclude="tags" --exclude="node_modules" --exclude="bower_components" --exclude="vendor" --exclude="*.jpg" --exclude="*.png" --exclude="*.svg" --exclude="*.ico" --exclude="*.pdf" --exclude="*.epub" d:\Git\<project>

Or even:

ctags.exe -R -f "d:\Git\<project>\tags.temp"  --exclude=".git" --exclude=".sass-cache" --exclude="tmp" --exclude=".bundle" --exclude="*.min.*" --exclude="tags" --exclude="node_modules" --exclude="bower_components" --exclude="vendor" --exclude="*.jpg" --exclude="*.png" --exclude="*.svg" --exclude="*.ico" --exclude="*.pdf" --exclude="*.epub" d:\Git\<project>

It generates the tags.temp file as expected.

Is it possible to remove the double quotes around the executable in the update_tags.cmd file?

from vim-gutentags.

gummesson avatar gummesson commented on August 19, 2024

After doing some more experimentations (removing the double quotes) I noticed that the script seems to exit after the tags.temp file gets generated, which leaves it and the tags.lockfile behind too.

from vim-gutentags.

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Thanks for troubleshooting this!
So that's quite weird... you're saying running "ctags" (with quotes) doesn't work, but ctags (no quotes) works? On my Windows7 x64 it works in both cases, I the the default help/no files specified message. We could of course remove the quotes, but we would have to add them in case a user doesn't have ctags in its PATH and points directly to, say, C:\Program Files (or something else with spaces). It gets a bit tricky at that point, which is why I figured I'd just put the quotes all the time since it seemed to work... at least on my machine :) I'm curious why it doesn't work on yours?
Also, after you run the ctags command manually, can you do an echo %ERRORLEVEL% to check the return code? AFAIK the only way for the script to exit before renaming the tags.temp file and cleaning up the lock file is for it to be aborted/killed somehow. Instead of running the ctags command manually, you could run the script command manually (I believe the command shows up in Vim's messages) and see what's going on.
Thanks!

from vim-gutentags.

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Oh that's interesting... if I do something stupid like setting g:gutentags_executable to blah (instead of ctags), then the way Vim runs the script will exit right after it fails to run blah. If I run the script manually in a command window, it won't exit and, instead, say that it can't find program blah, and keep executing the script... mmmh, this requires more investigation... but basically I'm thinking that your problem is that somehow the ctags command fails, and early exits when run from Vim.

from vim-gutentags.

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Ok, I just pushed an update that should make things a bit easier to troubleshoot. First, I'm using call now to run Ctags, so it doesn't exit right away without unlocking the tags file if something wrong happened... and in general it will try to unlock things after an error instead of aborting the whole script.
Second, the script is logging more stuff to the log file, so if you use GutentagsToggleTrace again and look at the log file, you will hopefully see what's wrong.

from vim-gutentags.

gummesson avatar gummesson commented on August 19, 2024

The update_tags script doesn't exit anymore when something fails and the tags.lock file gets removed. 👍 Unfortunately the log file confirms that the executable can't be found.

I tried all of the scenarios below:

  • Running ctags manually in the command prompt (works)
  • Running ctags manually in Vim (works)
  • Running the update_tags script manually in the command prompt (fails)
  • Running the update_tags script manually inside Vim (fails)

I then modified the update_tags script by removing the double quotes (") around all occurences of %TAGS_FILE%.temp and %TAGS_FILE% in the ctags, move and del command portions. I then tried the following scenarios:

  • Running the modified update_tags script manually in the command prompt (works)
  • Running the modified update_tags script manually inside Vim (works)
  • Launching and using Vim with Gutentags and the modified update_tags script (works)

I honestly have no idea why my computer seems to despise double quotes...

from vim-gutentags.

gummesson avatar gummesson commented on August 19, 2024

I've finally found the problem!

It dawned on me that I've installed ctags through Chocolatey, which instead of directly placing the exe on the PATH creates a ctags (shell) and a ctags.bat script in a dedicated bin directory.

I uninstalled ctags from Chocolatey, downloaded it manually, placed it in my PATH and launched Vim in a couple of projects (just to be sure) without running into any problems.

Thank you for being patient! 👍

from vim-gutentags.

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Good find! :) I never used Chocolatey before, but it's growing in popularity so I'd better make sure Gutentags plays nice with it. I just removed my own Ctags binaries, and instead installed it through Chocolatey. It seems to be working fine for me. I noticed that I don't have any ctags.bat script anywhere. If I run where ctags, it shows me C:\ProgramData\chocolatey\bin\ctags.exe, which is also where Vim and the update script will run it from... did maybe Chocolatey change the way they install stuff recently?

from vim-gutentags.

gummesson avatar gummesson commented on August 19, 2024

Yeah, Chocolatey recently re-did a lot of stuff, they no longer shim executables with shand bat scripts I believe. Since ctags haven't had an update in a long time I've never updated it, hence the use of the old shims...

Thanks again!

from vim-gutentags.

ludovicchabant avatar ludovicchabant commented on August 19, 2024

Ok got it! Thanks.

from vim-gutentags.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.