-
Notifications
You must be signed in to change notification settings - Fork 628
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
Proposal: A possible way of incrementally updating tags file #2697
Comments
This includes multiple sub issues. I think about the initial goal.
For achieving the goal, we have to do: |
I found I implemented TAG_EXTRA_DESCRIPTION and TAG_FIELD_DESCRIPTION ago.
I cannot remember when I implemented them. Anyway, I should turn on the ptags by default. |
I saw this in the wiki
Using hash is obviously another way to do the detection. Do we want one of them or both? |
Attaching timestamps to 'F' kind tags is worked:
Should I change the print format? |
I think it's good as long as ctags itself could compare between timestamps. But if we assume that client tools may want to use it in some way, I suggest adding the time zone so we could convert it with the Unix time. The Btw, is there any reason to create these tags for files, rather than using pseudo tags? |
I found the output of stat command includes such a timestamp.
This format may be good enough.
As I wrote in the Wikipage, there are three ways to store timestamps to a tags file. In the prototyping, I chose F/file because F/file kind is already there.
weaknesses of F/file are
If a user gives the list of input files for updating, F/file is enough. I cannot do much at once. I would like to explore what we can do more with F/file kind. |
I have studied the way to update a file from sed -i.
|
Very cool. In which way this would help us? I mean ctags already has the |
I would like to withdraw the goal "Adding -C action to readtags". |
Like the timestamp field, linking libreadtags to ctags is another step for the incremental updating. ctags already infrastructure of (0). If you are interested in this idea, search "symtab" in our source tree. Tonight I have prototyped the multipass parsing (1). Again, this is also an important step for incremental updating.
For recoding I would like to show the diff of python.c:-)
|
Oh, I got it immediately! The example you gave is:
I just thought of this: #2727 (comment)
This is kind of a "reversed" example. But then I found that, |
I actually read a bit about "cork symbol table" in some PRs (but I can't say I'm familiar with the cork thing for now). I guess the approach is to use
Is this because the cork queue is freed after parsing a file?
So, does this mean we don't use |
If we can load a tags file into the cork symtab, it is the best. But we cannot because the information in a tags file is not enough to reproduce the table.
Yes. I'm thinking about extending the current implementation to keep cork queues/tables generated for each input file
It doesn't mean as you wrote. What I did is nothing to do with -a. |
We had some discussion before, see #2475 (comment). @masatake suggested the following scheme:
2 and 3 can be done by the
-a
option.I want to suggest a way to do 1 in this proposal. My thought is we use a group of pseudo tags to record the last modified time for each source file. It may look like this:
Then we offer an option like
--increment
to do incremental update. With this option, we compare this pseudo tag with the actual timestamp, and find files that are and are not updated (new files are counted as updated ones). This option should do nothing when generating a tags file for the first time.For writing the temporary tags file, maybe we could use readtags like this:
$ readtags -t tags -Q '(not (#/(updated-file1)\|(updated-file2)\|.../ $input))' -Ene > temp_tags
Another problem is to ensure that the command line options are the same. A possible way we've discussed is to also put them in the pseudo tags, and @masatake said this is related to "multipass parsing". I'm not familiar with that idea, but for the scope of incremental tags file update, I think if people are doing this, then the command line is probably generated by a script/makefile/client tool/ctags configuration file, so it wouldn't become a problem if we ask for same options between multiple runs, rather than letting ctags ensure it.
The text was updated successfully, but these errors were encountered: