ctags-client-tools - Man Page
Hints for developing a tool using ctags command and tags output
Synopsis
ctags [options] [file(s)] etags [options] [file(s)]
Description
Client tool means a tool running the ctags command and/or reading a tags file generated by ctags command. This man page gathers hints for people who develop client tools.
Pseudo-Tags
Pseudo-tags, stored in a tag file, indicate how ctags generated the tags file: whether the tags file is sorted or not, which version of tags file format is used, the name of tags generator, and so on. The opposite term for pseudo-tags is regular-tags. A regular-tag is for a language object in an input file. A pseudo-tag is for the tags file itself. Client tools may use pseudo-tags as reference for processing regular-tags.
A pseudo-tag is stored in a tags file in the same format as regular-tags as described in tags(5), except that pseudo-tag names are prefixed with "!_". For the general information about pseudo-tags, see "TAG FILE INFORMATION" in tags(5).
An example of a pseudo tag:
!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/
The value, "Universal Ctags", associated with the pseudo tag TAG_PROGRAM_NAME, is used in the field for input file. The description, "Derived from Exuberant Ctags", is used in the field for pattern.
Universal Ctags extends the naming scheme of the classical pseudo-tags available in Exuberant Ctags for emitting language specific information as pseudo tags:
!_{pseudo-tag-name}!{language-name} {associated-value} /{description}/
The language-name is appended to the pseudo-tag name with a separator, "!".
An example of pseudo tag with a language suffix:
!_TAG_KIND_DESCRIPTION!C f,function /function definitions/
This pseudo-tag says "the function kind of C language is enabled when generating this tags file." --pseudo-tags is the option for enabling/disabling individual pseudo-tags. When enabling/disabling a pseudo tag with the option, specify the tag name only TAG_KIND_DESCRIPTION, without the prefix ("!_") or the suffix ("!C").
Redundant-Kinds
TBW
Multiple-Languages for an Input File
Universal ctags can run multiple parsers. That means a parser, which supports multiple parsers, may output tags for different languages. language/l field can be used to show the language for each tag.
$ cat /tmp/foo.html <html> <script>var x = 1</script> <h1>title</h1> </html> $ ./ctags -o - --extras=+g /tmp/foo.html title /tmp/foo.html /^ <h1>title<\/h1>$/;" h x /tmp/foo.html /var x = 1/;" v $ ./ctags -o - --extras=+g --fields=+l /tmp/foo.html title /tmp/foo.html /^ <h1>title<\/h1>$/;" h language:HTML x /tmp/foo.html /var x = 1/;" v language:JavaScript
JSON Output
See ctags-json-output(5).
Changes
Version 6.0
- ctags enables TAG_KIND_DESCRIPTION, TAG_ROLE_DESCRIPTION, TAG_FIELD_DESCRIPTION, and TAG_EXTRA_DESCRIPTION pseudo tags by default.
- TAG_PARSER_VERSION is introduced.
See Also
ctags(1), ctags-lang-python(7), ctags-incompatibilities(7), tags(5), ctags-json-output(5), readtags(1), 7.2 Libtool’s versioning system <https://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning>
Referenced By
ctags(1), ctags-json-output(5), ctags-lang-elm(7), ctags-lang-inko(7), ctags-lang-iPythonCell(7), ctags-lang-javascript(7), ctags-lang-julia(7), ctags-lang-python(7), ctags-lang-rmarkdown(7), ctags-lang-sql(7), ctags-lang-verilog(7), readtags(1), tags(5).