Exuberant ctags ignores python-kinds option

1.1k views Asked by At

I'm trying to generate a ctags file for the Python standard library, so that I can add it to my Python projects to get correct tagging/highlighting for standard library functions. I don't want to generate tags for variables, since that would make the tags file huge and I really only care about function and class names. However, Exuberant Ctags seems to be ignoring all my requests to disable variable tagging, and still produces a tags file containing lots of entries of kind:v.

This is how I run Exuberant Ctags:

cd /usr/lib/python3.5
sudo chmod o+w .
ctags --languages=python --python-kinds=-vi --tag-relative=yes -f ./tags --recurse --fields=+iaSszt --extra=+q .

(Note that I temporarily make /usr/lib/python3.5 world-writeable so that ctags can create the tags file in the current directory; I'm using --tag-relative because I want to use this tags file with the Vim plugin TagHighlight).

And here are some sample lines from the tags file it produces, showing that it ignored my options and indexed variables anyway:

Array1Glob      test/pystone.py /^Array1Glob = [0]*51$/;"       kind:v
Array2Glob      test/pystone.py /^Array2Glob = [x[:] for x in [Array1Glob]*51]$/;"      kind:v
ArrayProxy      multiprocessing/managers.py     /^ArrayProxy = MakeProxyType('ArrayProxy', ($/;"        kind:v
ArticleInfo     nntplib.py      /^ArticleInfo = collections.namedtuple('ArticleInfo',$/;"       kind:v
...
Attribute       inspect.py      /^Attribute = namedtuple('Attribute', 'name kind defining_class object')$/;"    kind:v
AttributeList   xml/dom/minidom.py      /^AttributeList = NamedNodeMap$/;"      kind:v
AttributesImpl  xml/sax/expatreader.py  /^AttributesImpl = xmlreader.AttributesImpl$/;" kind:v
AttributesImpl  xml/sax/xmlreader.py    /^class AttributesImpl:$/;"     kind:c  inherits:
AttributesNSImpl        xml/sax/expatreader.py  /^AttributesNSImpl = xmlreader.AttributesNSImpl$/;"     kind:v

As a test, I also tried creating a ~/.ctags file containing "--python-kinds=-vi" instead of passing it on the command line, but this made no difference.

What's going on? Why is python-kinds=-vi being ignored?

1

There are 1 answers

1
haolee On BEST ANSWER

This is a bug of Exuberant Ctag and you can use universal-ctags instead.

This bug has already been fixed in universal-ctags.