Closed hisnawi closed 6 years ago
I'm not familiar with universal-ctags, but will try to explain some facts.
When you specify like this,
default:\
:tc=new-ctags:tc=pygments:
Files that can be processed by universal-ctags are processed by new-ctags plugin, then rest is processed by pygments plugin.
Every file is processed by exactly one plugin.
You can run gtags --explain
to show which file is handled by which plugin.
As far as I know, universal-ctags can generate reference tags. (cf. http://docs.ctags.io/en/latest/news.html#reference-tags) So if you want to generate references, you will not need pygments plugin.
Thank you very much. That is why I am confused why universal-ctags is not generating the references.
I followed the link that you sent me, and added these lines:
--extras=+r
--fields=+r
to .ctags file. It still does not generate references. Not sure how this gets debugged.
As I wrote in https://github.com/universal-ctags/ctags/issues/1453, the ability of generating reference tags of u-ctags is very limited. u-ctags has infrastructures for gathering reference tags but only a few parsers utilize the subset of infrastructures.
@masatake So it is not possible for me to have universal-ctags do the regular parsing and have pygments/gtags do the referencing part?
I mean, I am still not sure how come gtags on its own includes correct (global style) references and gtags --gtagslabel=new-ctags (universal-ctags) can't
@masatake So it is not possible for me to have universal-ctags do the regular parsing and have pygments/gtags do the referencing part?
I'm sorry but I don't know how to combine them.
I checked universal-ctags and figured out how to use it.
So it is not possible for me to have universal-ctags do the regular parsing and have pygments/gtags do the referencing part?
@hisnawi If you want to do this, you need to configure like this.
default:\
:tc=pygments:
With this config, pygments plugin will automatically invoke universal-ctags to collect definitions. It will also collect references, then combine both results.
If this doesn't work, please make sure pygments plugin is configured with correct path for universal ctags binary:
$ grep ^EXUBERANT_CTAGS /usr/local/share/gtags/script/pygments_parser.py
EXUBERANT_CTAGS = "/usr/local/bin/ctags"
(Path may vary.) In this case, please check if /usr/local/bin/ctags
is the correct path for your universal ctags installation.
That worked. Thanks.
Hi, I have this in my gtags.conf under my projects root directory:
Unfortunately, I am not able to generate references.
But if I change:
to:
Then I can generate references no problem.
How can I combine universal-ctags and pygments(for generating references)?