Comments (11)
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.
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.
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.lock
file behind too.
from vim-gutentags.
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.
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.
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.
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.
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.
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.
Yeah, Chocolatey recently re-did a lot of stuff, they no longer shim executables with sh
and 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.
Ok got it! Thanks.
from vim-gutentags.
Related Issues (20)
- ERROR: Invalid value for argument cmd and update_gtags.sh is not executable HOT 4
- E117: Unknown function: gutentags#on_vim_leave
- Tags stop working for specific file (path disappears from tags option) after manually setting tags once in that file
- Cannot generate the GTAGS at windows platform HOT 5
- Does it support different ctags file chosen dynamically? HOT 2
- Error code 122 & 139 HOT 7
- please support the usage of `vim -t symbol` HOT 9
- use gtags failed HOT 2
- update_gtags.sh lost execution permission
- How do I use different tag files for different directories of a same workspace HOT 1
- Is there a way to force gutentags to generate only one tag file?
- Keep tags values when opening the quickfix
- nvim 0.9 remove cscope how to HOT 1
- Guttentags does not support any file? HOT 1
- Option to generate tags for open windows or buffers only? HOT 3
- the use of .guttags file HOT 1
- Whitelisting instead of blacklisting HOT 2
- Bug in update_scopedb.cmd file prevents creation of cscope.out.files correctly HOT 1
- Very large tags file generated ( > 10GB) HOT 2
- Plugin don't work if full filename contains open "[" _and_ close "]" square brackets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-gutentags.