我已经在我的苹果电脑上安装了最新版本的universal-ctags。我想索引yml文件,但是运行ctags --list-languages时没有将yml列为受支持的语言之一。然而,他们的documentation表示使用LibYaml和AnsiblePlaybook libyaml支持ymls,并且这两个解析器是新添加的。
我该如何解决这个问题呢?我在互联网上搜索了很多,但很明显,还没有人遇到这个问题。
发布于 2021-09-14 05:45:09
很遗憾,Homebrew ctag不支持开箱即用的yaml
使用自制的ctag:
ctags --list-features
#NAME DESCRIPTION
case-insensitive-filenames TO BE WRITTEN
iconv can convert input/output encodings
option-directory TO BE WRITTEN
packcc has peg based parser(s)
regex can use regular expression based pattern matching
wildcards can use glob matching
xpath linked with library for parsing xml input所以我只是简单地卸载了自制的ctag:
brew uninstall universal-ctags,然后运行ctag安装manually。
$ git clone https://github.com/universal-ctags/ctags.git
$ cd ctags
$ ./autogen.sh
$ ./configure --prefix=/where/you/want # defaults to /usr/local
$ make
$ make install # may require extra privileges depending on where to install然后,利润:
ctags --list-features
#NAME DESCRIPTION
case-insensitive-filenames TO BE WRITTEN
gnulib_fnmatch linked with the Gnulib fnmatch library
gnulib_regex linked with the Gnulib regular expression library
iconv can convert input/output encodings
interactive accepts source code from stdin
json supports json format output
option-directory TO BE WRITTEN
optscript can use the interpreter
packcc has peg based parser(s)
regex can use regular expression based pattern matching
wildcards can use glob matching
xpath linked with library for parsing xml input
yaml linked with library for parsing yaml input发布于 2020-05-17 05:48:44
-- list -languages可能会将解析器列为"Yaml“。如果没有列出,则您的ctag不会链接到libyaml。./ctags --list-features的输出也很有用。如果libyaml正确链接到ctag,--list-features可能会列出"yaml“。
https://stackoverflow.com/questions/59591177
复制相似问题