使用通用ctags支持编译GNU Global

使用通用ctags支持编译GNU Global,tags,ctags,universal-ctags,Tags,Ctags,Universal Ctags,我试图用通用ctags支持构建GNU Global,但没有成功。是否有我遗漏的东西,或者我使用的是GNU Global和univeral CTAG的不兼容版本?我在Ubuntu18.04.2LTS上做这个(也在Ubuntu16.04上测试过) 官方安装说明 其他有关资料 简而言之,我执行以下命令 git clone https://github.com/universal-ctags/ctags.git cd ctags cat docs/autotools.rst # inst

我试图用通用ctags支持构建GNU Global,但没有成功。是否有我遗漏的东西,或者我使用的是GNU Global和univeral CTAG的不兼容版本?我在Ubuntu18.04.2LTS上做这个(也在Ubuntu16.04上测试过)

官方安装说明

其他有关资料

简而言之,我执行以下命令

git clone https://github.com/universal-ctags/ctags.git
cd ctags
cat docs/autotools.rst  # installation instructions

./autogen
./configure
make
make install

which ctags
# /usr/local/bin/ctags

ctags --version
# Universal Ctags 0.0.0(6365358b), Copyright (C) 2015 Universal Ctags Team
# Universal Ctags is derived from Exuberant Ctags.
# Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
#   Compiled: Mar  8 2019, 12:48:27
#   URL: https://ctags.io/
#   Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +packcc
这似乎工作正常,
ctags
可执行文件按预期构建标记文件。接下来,我尝试使用GNUglobal手册(上面的链接)第4.2节中的说明安装GNUglobal


我不知道这是为什么,但这也发生在我身上。通过从gtags.conf文件中删除这些行(在
universal-ctags设置中使用universal-ctags插件解析器
part),我找到了一个无法解释的解决方法(用户错误?bug?):

我的猜测是,这个特定版本的GNUglobal使用的语言比这个特定版本的UniversalCTAGS当前支持的语言更多,或者不同

我使用的版本是根据昨天下载的代码构建的,我看到的版本是:

$ ctags --version
Universal Ctags 0.0.0(6ad4e95), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Aug 20 2019, 18:04:40
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +packcc
$ gtags --version
gtags (GNU GLOBAL) 6.6.3
Powered by Berkeley DB 1.85.
Copyright (c) 1996-2018 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ctags--版本
环球Ctags 0.0.0(6ad4e95),版权所有(C)2015环球Ctags团队
通用CTAG源于丰富的CTAG。
繁茂的Ctags 5.8,版权所有(C)1996-2009 Darren Hiebert
编译时间:2019年8月20日18:04:40
网址:https://ctags.io/
可选编译功能:+通配符、+regex、+iconv、+option目录、+packcc
$gtags—版本
gtags(GNU全球)6.6.3
由伯克利DB1.85提供动力。
版权所有(c)1996-2018塔马通信公司
许可证GPLv3+:GNU GPL版本3或更高版本
这是自由软件;您可以自由更改和重新分发它。
在法律允许的范围内,不存在任何担保。

我也有类似的问题。问题在于我的通用标签(CTAG)版本。构建时,构建过程无法找到libxml2-0(*.pc和/或头文件,如libxml/xpath.h)。因此,一些与XML相关的解析器在构建中被禁用。这些解析器在source.mak中定义:

XML_SRCS = \
    parsers/maven2.c        \
    parsers/dbusintrospect.c    \
    parsers/glade.c         \
    parsers/svg.c           \
    parsers/plist.c         \
    parsers/relaxng.c       \
    parsers/xml.c           \
    parsers/xslt.c          \
现在,当GNUGlobal为CTAG生成命令行时,它就好像所有的解析器都可用一样。当然,CTAG不理解其中的一些,并且抱怨

如果可能的话,尝试在启用XML解析器的情况下获取/构建新版本的universal标记,然后将其与GNU global一起使用。如果不可能,您需要从命令行中删除您的ctags版本不理解的解析器——基本上就是bgoodr在其回答中建议的解析器。

太棒了——它可以工作!半年后,我仍然需要一个答案。你先生或夫人是个真正的黑客,我无法想象你是怎么知道的。
$ ctags --version
Universal Ctags 0.0.0(6ad4e95), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Aug 20 2019, 18:04:40
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +packcc
$ gtags --version
gtags (GNU GLOBAL) 6.6.3
Powered by Berkeley DB 1.85.
Copyright (c) 1996-2018 Tama Communications Corporation
License GPLv3+: GNU GPL version 3 or later <http://www.gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
XML_SRCS = \
    parsers/maven2.c        \
    parsers/dbusintrospect.c    \
    parsers/glade.c         \
    parsers/svg.c           \
    parsers/plist.c         \
    parsers/relaxng.c       \
    parsers/xml.c           \
    parsers/xslt.c          \