-
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
main: revise ptags for client tools #2459
main: revise ptags for client tools #2459
Conversation
These are should be explaiend in ctags-for-client-developers(5) man page. We must extend readtags API to support these new ptags. |
Codecov Report
@@ Coverage Diff @@
## master #2459 +/- ##
==========================================
+ Coverage 86.7% 86.74% +0.03%
==========================================
Files 177 177
Lines 36500 36572 +72
==========================================
+ Hits 31646 31723 +77
+ Misses 4854 4849 -5
Continue to review full report at Codecov.
|
fb287dd
to
fd1d0ee
Compare
I have written the initial version of ctags-client-tools(7) man page. See e61022a.
I'm also working on readtags side. With both side changes (ctags and readtags), you can write a linker, a tool merging more than two tags file into one. It is really needed to apply ctags and tags files to large codebases. The changes in pseudo tags related code are needed to make ctags support multi-pass parsing. |
558cde2
to
41c505b
Compare
I will add TAG_PARAM_DESCRIPTION after releasing 6.0.0.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks really good @masatake-san. Thank you for your hard work on universal-ctags! I have tried to make small suggestions to improve the flow in English. Please review them.
docs/man/ctags-client-tools.7.rst
Outdated
**Client tool** here is a tool running ctags command | ||
and/or reading tags file generated by ctags command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Client tool** here is a tool running ctags command | |
and/or reading tags file generated by ctags command. | |
**Client tool** means a tool running the ctags command | |
and/or reading a tags file generated by ctags. |
docs/man/ctags-client-tools.7.rst
Outdated
put to the field for input file. The description, "Derived from | ||
Exuberant Ctags", is put to the field for pattern. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put to the field for input file. The description, "Derived from | |
Exuberant Ctags", is put to the field for pattern. | |
used in the field for input file. The description, "Derived from | |
Exuberant Ctags", is used in the field for pattern. |
docs/man/ctags-client-tools.7.rst
Outdated
Exuberant Ctags", is put to the field for pattern. | ||
|
||
Universal-ctags extends the naming scheme of the classical pseudo-tags | ||
available in Exuberant-ctags for emitting a language specific |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
available in Exuberant-ctags for emitting a language specific | |
available in Exuberant-ctags for emitting language specific |
docs/man/ctags-client-tools.7.rst
Outdated
pseudo tag with the option, don't include neither the prefix ("!_") | ||
nor the suffix ("!C"). Specify the body of the name, here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pseudo tag with the option, don't include neither the prefix ("!_") | |
nor the suffix ("!C"). Specify the body of the name, here | |
pseudo tag with the option, don't include the prefix ("!_") | |
or the suffix ("!C"). Specify the body of the name, here |
docs/man/ctags-client-tools.7.rst
Outdated
ctags emits pseudo-tags by default when writing tags | ||
to a regular fie (like "tags' file.) However, when specifying ``-o -`` | ||
or ``-f -`` for writing tags to standard output, | ||
ctags doesn't emits pseudo-tags. ``--extras=+p`` or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctags doesn't emits pseudo-tags. ``--extras=+p`` or | |
ctags doesn't emit pseudo-tags. ``--extras=+p`` or |
docs/man/ctags-client-tools.7.rst
Outdated
``--pseudo-tags=...`` option for enabling them. | ||
|
||
``--pseudo-tags=[+|-]names|*`` | ||
Specifies a list of kinds of pseudo-tag to include in the output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifies a list of kinds of pseudo-tag to include in the output. | |
A list of kinds of pseudo-tags to include in the output. |
docs/man/ctags-client-tools.7.rst
Outdated
The parameter names is a set of names listed with | ||
``--list-pseudo-tags``. Surround each name of the set by braces | ||
like "{TAG_PROGRAM_AUTHOR}". "!_", the prefix representing | ||
pseudo-tags is for emitting. You don't have to include the prefix | ||
when specifying a name in the option argument for ``--pseudo-tags=`` | ||
option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter names is a set of names listed with | |
``--list-pseudo-tags``. Surround each name of the set by braces | |
like "{TAG_PROGRAM_AUTHOR}". "!_", the prefix representing | |
pseudo-tags is for emitting. You don't have to include the prefix | |
when specifying a name in the option argument for ``--pseudo-tags=`` | |
option. | |
The parameters are a set of pseudo tag names. Valid pseudo tag names | |
can be listed with ``--list-pseudo-tags``. Surround each name in the set | |
with braces, like "{TAG_PROGRAM_AUTHOR}". You don't have to include the "!_" | |
pseudo tag prefix when specifying a name in the option argument for ``--pseudo-tags=`` | |
option. |
docs/man/ctags-client-tools.7.rst
Outdated
... | ||
|
||
A client tool can know "{anonymous}", "{fileScope}", "{pseudo}", | ||
and "{subparser}" extars are enabled from the output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and "{subparser}" extars are enabled from the output. | |
and "{subparser}" extras are enabled from the output. |
docs/man/ctags-client-tools.7.rst
Outdated
If your tool relies on some fields , refer to the pseudo-tags of | ||
this kind. A tool can reject the tags file that doesn't include |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If your tool relies on some fields , refer to the pseudo-tags of | |
this kind. A tool can reject the tags file that doesn't include | |
If your tool relies on some fields, refer to the pseudo-tags of | |
this kind. A tool can reject a tags file that doesn't include |
docs/man/ctags-client-tools.7.rst
Outdated
TBW | ||
|
||
``TAG_PROC_CWD`` (new in Universal-ctags) | ||
Indicates the working directory of ctags was at. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indicates the working directory of ctags was at. | |
Indicates the working directory of ctags during processing. |
Another review. emptyflask@2f3f88afed69929f88ea31a393b706f76c6ba531from @emptyflask. I have never imaged I could get more than two reviewers. An issue here; it is hard for me to decide which comments I should choose. I will try to do cherry-pick. |
My question after reading the added manpage is: Is it safe to say that tags start with |
We already handled your concerns:-) ctags can handle "!_" appeared in input well. input.html
I cannot remember where this behaviour, escaping the first For users directly use readtags, the un-escaping feature of readtags is good enough. However, people writing a tool for manipulating tags files may want the way to access raw-escaped data in tags file from the tool. I am the one of the such people. I'm working on this topic in #2468. |
I added commits reflecting the reviewing done by @jwhitley and @emptyflask. |
Though I use "squash!" prefix in the commit logs, I will not squash to allow me to re-read what kind of changes were needed. |
64b8fe3
to
93073dc
Compare
…bled kinds Signed-off-by: Masatake YAMATO <yamato@redhat.com>
… explictily Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…in ctags writer The makers are parts of tags output. So ctags writer should insert them when emitting ptags. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
...instead of allocating it as function static variable. This change is for suppressing "still reachable leak" reported by valgrind. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This records the current working directory of ctags process. This may help client tools solve the file path for input source which is recorded in tags file in relative path. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Consider a fragment of html file: <h1>!_TAG_PROGRAM_VERSION</h1> our HTML parser captures it well with escaping as: \21_TAG_PROGRAM_VERSION ... So readtags is not confused; readtags understands it is not a pseudo tag. However, once the tag is stored to tagEntry data struct of readtags, the client code cannot distinguish it with a pseudo tag because the name of the tag is escaped when readtags stores it to the data structure. This change attaches "extras:pseudo" to pseudo tags. This helps hits whether a tag is a pseudo tag or not when a tag is stored to the data structure; if "extras:pseudo" is not attached, the tag is not a pseudo tag. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Reflect the result of reviewing done by @jwhitley.
Use "pseudo tag types" instead of "pseudo tag kinds" to avoid confusion with kinds in "kinds in language objects".
Reflect the result of reviewing done by @emptyflask.
93073dc
to
5842bcc
Compare
We should not add TAG_PARAM_DESCRIPTION. If it is needed, individual parsers should emit their own ptags. TAG_ROLE_DESCRIPTION, this one is needed when we add an option for enabling/disabling roles. |
@jwhitley and @emptyflask, thank you very much. |
I would be glad to help! |
TAG_PARAM_DESCRIPTION still reamains in "not-impelemented".
However, the changes in this pull request may be enough for 6.0.