我正在尝试使用自定义语言扩展 ctags ( Exuberant Ctags 5.8 MacOSX ),但是自定义语言的标签文件始终为空。为了追查问题。我使用了文档中的示例。
我在〜中有以下.ctags:
--langdef=swine
--langmap=swine:.swn
--regex-swine=/^def[ \t]*([a-zA-Z0-9_]+)/\1/d,definition/
当我运行ctags --list-kinds我看到:
...
swine
d definition
我有一个文件test.swn:
def hehll
当我运行ctags -L test.swn 时,我看到:
ctags: Warning: cannot open source file "def hehll" : No such file or directory
生成的标签文件如下所示:
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
对于其他语言,标签文件按预期填充。只有使用此自定义扩展,它才为空。
我不确定我还需要做什么才能使 ctags 为自定义语言生成标签。