Request: Update ctags incrementally #18
Comments
I'm not sure which parameter is for incremental update in ctags. According to ctags help message,
BUT I don't see any difference on my side, when I run both command for Linux Kernel. # jiasui @ ul80vt in ~/repos/linux-stable on git:master o [8:54:41]
$ time ctags -R
ctags -R 71.40s user 5.56s system 100% cpu 1:16.37 total
# jiasui @ ul80vt in ~/repos/linux-stable on git:master o [8:56:03]
$ time ctags -Ra
ctags -Ra 76.37s user 6.58s system 100% cpu 1:22.50 total |
The time similarity in both commands is likely due to all tags still being generated for the According to ctags docs: To incrementally generate based on the current file being edited, is it possible to specify the current file for automatic generation? Such as: This would yield better incremental change times:
|
Hmm, which means |
Yea, it is one possibility. Looks like the issue with Got curious about how vim-gutentags handles this. Their docs describe this workflow:
|
I read the source code of |
A dirty hack for #18 There is a new global variable `g:gen_tags#ctags_prune` which is 0 by default. If `g:gen_tags#ctags_prune` is 1 `gen_tags.vim` will prune the old tags from tagfile first. Then regenerate tags for the saving file. The prune action will impact the performance when the tagfile is very big.
@lorainekv The prune action will impact the performance when tagfile is big. (like linux kernel, >500MB) Can you have a try? Thanks |
Nice, thanks for updating this. The subtractive and additive updates to tag files seem to be working now. :) I am running into some surprising behavior though - I seem to now have tag files in both a project root (for a github repo) and in the ~/.cache/... path. This doesn't seem intended, since it's duplicate tag files. So when I attempt to find a function definition it asks me to choose from in ~/project_folder/file and also in ./project_folder/file. When I run a |
What do you mean about 'git repo tag file'?
|
My bad, regarding the repo tag file, I had forgotten to uninstall another plugin I was testing out yesterday. Thanks for the increment update! |
You're welcome, thanks for the report and clarify 😄 |
* Incremental update for ctags A dirty hack for #18 There is a new global variable `g:gen_tags#ctags_prune` which is 0 by default. If `g:gen_tags#ctags_prune` is 1 `gen_tags.vim` will prune the old tags from tagfile first. Then regenerate tags for the saving file. The prune action will impact the performance when the tagfile is very big. * Update document. * DO NOT sort tags to improve performance. Test on linux kernel ctags -R 38.07s user 4.22s system 94% cpu 44.605 total ctags -u -R 32.89s user 2.67s system 96% cpu 37.038 total ctags -f tags -a drivers/char/ipmi/ipmi_devintf.c 6.56s user 1.58s system 85% cpu 9.572 total ctags -f tags -u -a drivers/char/ipmi/ipmi_devintf.c 0.71s user 0.15s system 98% cpu 0.877 total According to the result, only add -u for incremental update.
I merged |
I like the idea and I would like to use this prune+increment feature, but there a few problems currently that don't make it very usable. @jsfaint Would it be possible to make the "hack" in Also, if I have
|
@jeromedalbert Sorry for the late reply. Yeah, I know sed is very efficient, but it only works on *nix platform. So I need to find a way which do same thing with sed on windows, or rewrite this part in Python. |
Due to the the exuberant ctags is not maintained anymore, the successor recommendation There is feature request in universal-ctags/ctags#1421 Let's see what will be happened. 😄 |
Hi there, mahalo for putting this project together. Only tested with ctags with autogen on since I'm not using any languages currently supported by gtags.
While making quick edits in vim, I noticed that my project's tags file would get stuck in an partially-written state (for example, a complete tags file of 50K lines would only have 3K lines after a quick edit to a project file)
Looks like every time
:w
is used, the plugin seems to regenerate ctags for the project from scratch while vim is open. If I quit vim before this process is complete, then I'm left with a partially-generated tags file.Incremental ctag updates could have the following benefits:
The text was updated successfully, but these errors were encountered: