Skip to content
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

the tags file is updated for the whole project, not just the saved file #31

Closed
cvlmtg opened this issue Jun 8, 2015 · 6 comments
Closed

Comments

@cvlmtg
Copy link

cvlmtg commented Jun 8, 2015

I have a project, I have generated a tags file manually with this command:

ctags --exclude='app/public/components/*' app/

now, even if the readme says:

it will partially re-generate the tag file. Every time you save, it will silently, in the background, update the tags for that file.

every time I save a file, the tags file is updated to include every file in the project. since this plugin is supposed to work out of the box I'm not sure what I've done wrong...

@ludovicchabant
Copy link
Owner

Hi, sorry for the late reply.
The generated tag file is always for the whole project. What I meant in the README is that if you save one file, it will only parse that one file and update the tag file, instead of parsing the whole project (which most Vim plugins do).
So if you have a project with 3000 files in it, the initial cost of creating the tag file will be the cost of running ctags on 3000 files. But then if you edit app/public/foo.js and add a new function bar(), the tag file will contain all the symbols from the 3000 files, plus the new bar(), and it did this at the cost of only re-parsing app/public/foo.js.
Does that make sense?

I don't see why you would want to end up with a file that only contains the tags of the one file you just saved, actually.

@cvlmtg
Copy link
Author

cvlmtg commented Jul 16, 2015

yes, it makes sense, but the problem is that the plugin doesn't act that way. i'll try to rephrase my problem:

I have a project with 3000 files.
I generate a tag file with 1000 files (since the other 2000 are excluded)
I edit foo.js and add bar()
now the tag file includes 3000 files plus bar()

the 2000 files which were excluded are added even if they are not supposed to...

@ludovicchabant
Copy link
Owner

Ah ok.
How did you generate the project the first time? Did you run ctags yourself? If so, did you use some command line arguments to exclude the 2000 files, or used a custom options file? If so, Gutentags needs to know about it, so it can run ctags the same way you did, and excludes the files correctly. With the very latest version of the plugin, place a .gutctags options file at the root of your project and write the exclude rules in it (see the ctags documentation for more details about options files). Gutentags will use this options file when generating tags.
If however you had your rules defined globally with the user options file (I believe it's the ~/.ctags file?), it should be picked up automatically.

@cvlmtg
Copy link
Author

cvlmtg commented Jul 17, 2015

i generated the tag manually as explained in the first message. the command was:

ctags --exclude='app/public/components/*' app/

I have a .ctags file but it doesn't define the excluded file, I'll try the .gutctags file, thanks

@ludovicchabant
Copy link
Owner

Oh wow, sorry, I must have been drunk when I read your first message! (which is no small feat since I don't drink alcohol).
So yeah, add that exclude clause to the .gutctags file and it should work. Reopen this bug if it doesn't!

@cvlmtg
Copy link
Author

cvlmtg commented Jul 17, 2015

thanks :) i'll do some tests as soon as I've some time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants