[Geany-Devel] Proposal: move tag type ctags->geany mapping out of individual parsers

Jiří Techet techet at xxxxx
Fri Nov 7 16:38:12 UTC 2014


Hi,

while adding the ctags parser for go here

https://github.com/geany/geany/pull/373

I noticed that it's necessary to change the tag types (the GoKinds[]
array in the case of go) to match the supported types in the tag
manager and Geany. This has to be done for every parser because the
tag types aren't standardized in any way in ctags and can be more or
less arbitrary.

In my opinion, doing this in the parser itself is a bit unfortunate -
when updating a parser from the ctags repository, these have to be
changed. Worse, if ever something like ctags shared library happens
and all the parser support is moved there, these will have to be
always changed in every parser after updating to new ctags version.

I think it would be better to keep the tag types inside the individual
parsers as they are and have a separate table in the tag manager which
will map the ctags type to the type used by Geany.

The only disadvantage of this approach I can think of is that the type
names might change in ctags and we could easily miss this change and
not update the mapping. For this reason it would be good to add some
"integrity check" function which goes through all the kinds in ctags
for every language and checks whether they are mapped to Geany's tag
types and vice versa. But I think this can be done quite easily so it
isn't a real problem.

What do you think?

Cheers,

Jiri


More information about the Devel mailing list