2017-09-13 54 views
1

我正在嘗試爲Python標準庫生成一個ctags文件,以便我可以將它添加到我的Python項目中,以便爲標準庫函數獲得正確的標記/突出顯示。我不想爲變量生成標籤,因爲這會使標籤文件變大,我真的只關心函數和類名。然而,Exuberant Ctags似乎忽略了我禁止變量標記的所有請求,並且仍然生成包含大量條目kind:v的標記文件。Exuberant ctags忽略python-kinds選項

我這是怎麼運行旺盛C標籤:

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 . 

(請注意,我暫時使/usr/lib/python3.5世界可寫,這樣的ctags可以創建在當前目錄下的標籤文件;我'm正在使用--tag-relative,因爲我想用Vim插件TagHighlight來使用這個標籤文件)。

這裏是從標籤的一些示例文件行它產生,表明它忽略了我的選擇和索引變量反正:我也嘗試創建包含〜/ .ctags文件

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 

作爲測試「--python-kinds = -vi」而不是在命令行上傳遞它,但這沒有什麼區別。

發生了什麼事?爲什麼python-kinds=-vi被忽略?

回答

0

這是Exuberant Ctag的a bug,您可以改爲使用universal-ctags

這個bug在universal-ctags中已經是fixed

+0

嗯,令人失望的是exuberant-ctags剛剛壞掉,但是多謝告訴我這是一個已知的bug。 – Edward