Re: [Ctags] Running Ctags incrementally
Brought to you by:
dhiebert
From: Darren H. <Darren@DarrenHiebert.com> - 2010-05-25 20:49:41
|
Shlomy, Rather than running ctags multiple times, why don't you run it with the -V option (and possibly the -L option) and capture output using something like popen() (or Windows equivalent), you can monitor progress based upon the file names as they are printed to standard output. If you are set on invoking ctags multiple times, then be sure that you disable sorting of the tag file for each invocation but the last (i.e. --sort=no or -u). Otherwise, every time you run ctags, the entire tag file must be re-sorted, sorting a larger and larger tag file file each time, leading to an arithmetic increase in sort time. It turns out that when generating large tag files from a source tree, the sorting time for the tag file is a large fraction of the time the total time, sometimes even the majority. Darren On May 25, 2010, at 1:07 PM, Shlomy Reinstein wrote: > Hi, > > A while ago, I wrote a plugin for my text editor, jEdit, which uses > Ctags to get tag information from the source code, in order to provide > tag-jumping capabilities, class hierarchy information, and more. > The plugin initially runs Ctags on an entire project. Once done, it > keeps the tag information updated whenever files in the project are > saved in the editor. > The plugin launches Ctags as a separate process each time. Of course, > there is some overhead in launching a process. For the initial project > tagging, it currently launches a single Ctags process for tagging the > entire project; therefore, the plugin is unable to report progress > during the tagging. > I'd like to change this to run Ctags separately on each source file, > but I want to avoid the overhead in launching a process for each file. > Does Ctags have a mode where it can be interactively used to tag > files, so I can keep the process open all the time and just inject > instructions to it (e.g. via standard input)? > > Thanks, > Shlomy |