ctags 无法识别 Ruby 模块文件中的常量

发布于 2024-12-21 22:57:10 字数 244 浏览 1 评论 0原文

我正在使用 ctags 生成 ruby​​ 的标记文件。看起来它无法识别模块中定义的常量。

例如:

module Foo
     MAX_LEN = 15
end

看起来 MAX_LEN 不会被索引。我在 VIM 中的 MAX_LEN 处按 Ctrl-],它显示 未找到标记:MAX_LEN

I'm using ctags to generate the tag file for ruby. Looks like it can't recognize the constants defined in a module.

For example:

module Foo
     MAX_LEN = 15
end

Looks like the MAX_LEN will not be indexed. I hit Ctrl-] at MAX_LEN in VIM, it says tag not found: MAX_LEN.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看春风乍起 2024-12-28 22:57:10

最新的通用 Ctags (https://ctags.io/) 可以提取常量。

$ cat /tmp/foo.rb 
module Foo
     MAX_LEN = 15
end
$ u-ctags -o - /tmp/foo.rb 
Foo /tmp/foo.rb /^module Foo$/;"    m
MAX_LEN /tmp/foo.rb /^     MAX_LEN = 15$/;" C   module:Foo

The lattest Universal Ctags (https://ctags.io/) can extract constants.

$ cat /tmp/foo.rb 
module Foo
     MAX_LEN = 15
end
$ u-ctags -o - /tmp/foo.rb 
Foo /tmp/foo.rb /^module Foo$/;"    m
MAX_LEN /tmp/foo.rb /^     MAX_LEN = 15$/;" C   module:Foo
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文