Use the readtags library to parse ctags files
commit3a0230e0285fe65d00c758b0f2747ac29f269b6b
authorJiří Techet <techet@gmail.com>
Tue, 7 Dec 2021 23:39:09 +0000 (8 00:39 +0100)
committerJiří Techet <techet@gmail.com>
Mon, 16 Oct 2023 23:08:30 +0000 (17 01:08 +0200)
tree69a898e6caab08884663aa8cebc8433e099411c1
parentd364c30e7973ceaf387f8c64211d3980a462f90b
Use the readtags library to parse ctags files

Use the official 'readtags' library from ctags to parser files in the
ctags file format. This allows us not to worry about parsing itself
and just extract the information from ctags files we need.

In addition, this patch also reads some extra ctags fields we are interested
in. It also detects scope key based on the kind used by the given language
(not the hard-coded values that are valid for C/C++ only).

Finally, this patch also detects the "language" field that specifies
for which language the given tag is in the case that the tags file
contains tags from multiple languages.

When loading language this way, we have to postpone the update of
scope ('s' ctags field) until we get the language field because its key
is a kind name that is specific to the used language.

Note that even after this change tags files still have to be named so
that they contain the language in the file's extension because this is
needed for other tag file formats supported by Geany. It will, however,
be overridden by the "language" field.

Co-authored-by: Colomban Wendling <lists.ban@herbesfolles.org>
doc/geany.txt
src/tagmanager/Makefile.am
src/tagmanager/tm_source_file.c