-
Notifications
You must be signed in to change notification settings - Fork 622
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
Request: pseudo tags to record command line arguments #3085
Comments
I found I can actually introduce "private ptag" to a tags file: $ readtags -t tags -D
!_CITRE_PRIVATE_PTAG value /comment/
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_OUTPUT_EXCMD mixed /number, pattern, mixed, or combineV2/
... I'll explore the concept of "command line arguments ptags" in Citre first. Also, this means we can inject private ptags to tags file generated by other tools (kind of like the edittags program concept). As long as we use readtags to read it, they can be used. |
I think I'd use a CITRE_TAGS_CMD ptag like:
In this way we can store the whole command line into one ptag. This is just a preliminary thought. |
I'm thinking about the same topic. Instead of recording whole the command line as a string, I thought splitting it to parts semantically.
|
I'll try it later. I understand why you want to use multiple ptags for command line args (to be able to compare them). But there are some advantages of using a single ptag in other ways:
I don't know if this is realistic, but how about using a single ptag, and when comparing 2 sets of command line args, calculate the information you need first (those *_DESCRIPTION info), then compare? |
I tried #2741. I think I know the idea of multi-pass parsing. I also re-read the example you gave before: #2697 (comment) However, I haven't understand why multi-pass parsing needs ptags. From what I've seen, in the C example you gave in #2741, delete these lines:
doesn't stop the macro expansion. But I have other good news. I thought about a complete set of ptags for incremental updating. I'll show you how I built it step-by-step. Step 1: re-generate a tags fileFor this one, we need:
When we re-generate the tags file, we This is only for saving some typing when re-generate a tags file. The user could edit Step 2: Incremental updatingWe've talked about this a lot in #2697. The key is to ensure "reproducible on unchanged files". This means we need to find a way to use ctags so that it produces the same result on unchanged files (i.e., assuming the files are in the same state when this tags file was generated), then we use ctags in the same way for updated and newly added files. To ensure reproducibility, we need to make sure:
are the same. For 0, we let ctags For 1, we could use 2 ptags:
When the user edit For 2, we introduce
When the set of option files used this time is not the same as recorded by these ptags, or the timestamp has changed, we do full updating. For 3, we already have When all the above equality tests are passed, we can do incremental updating confidently. Step 3:
|
For now, most ctags client tools create tags file using a fixed command line. Users can't customize the command line for different projects.
If the command line arguments are recorded in the tags file itself, we could recreate it without knowing more information (though TAG_PROC_CWD is needed). In this way, a client tool only needs to focus on the "first time it creates the tags file", so it could offer interactive tools for the user to assemble a customized command line.
This is also a step towards incremental updating: #2697
The text was updated successfully, but these errors were encountered: