ctags 和 Fortran 接口
我想知道如何让 ctags 使用 Fortran 中的接口,例如:
INTERFACE SOME_ROUTINE
MODULE SOME_ROUTINE_A
MODULE SOME_ROUTINE_B
END SOME_ROUTINE
以便根据传递给子例程的参数调用 SOME_ROUTINE_A 或 SOME_ROUTINE_B 。
如果我将光标放在 Vim 中对 SOME_ROUTINE 的调用上,然后按 C-],我会收到“未找到标签:SOME_ROUTINE”错误,并且如果我检查我的 ctags 文件,它们并不在那里。
奇怪的是,我还使用了 Vim taglist 插件,源文件中的接口将显示在 taglist 窗口中。我能找到的关于它如何工作的唯一线索是 taglist 插件代码中的这一行:
let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' .
\ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' .
\ 'n:namelist;t:derived;v:variable;f:function;s:subroutine'
我已经检查了 ctags 手册,但找不到任何关于它如何工作的线索,有人知道发生了什么事吗?
I'm wondering how to get ctags working with interfaces in Fortran, eg:
INTERFACE SOME_ROUTINE
MODULE SOME_ROUTINE_A
MODULE SOME_ROUTINE_B
END SOME_ROUTINE
So that either SOME_ROUTINE_A or SOME_ROUTINE_B is called depending on the parameters passed to the subroutine.
If I've got my cursor over a call to SOME_ROUTINE in Vim, and hit C-], I get a "tag not found: SOME_ROUTINE" error, and if I check my ctags file they're not in there.
The weird thing is that I'm also using the Vim taglist plugin, and the interfaces in a source file will show up in the taglist window. The only clue I could find to how this is working is this line in the taglist plugin code:
let s:tlist_def_fortran_settings = 'fortran;p:program;b:block data;' .
\ 'c:common;e:entry;i:interface;k:type;l:label;m:module;' .
\ 'n:namelist;t:derived;v:variable;f:function;s:subroutine'
I've checked the manual for ctags and can't find any clue to how this is working, anyone know what's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我当然在问这个问题后立即找到了答案。我只需要将“--fortran-kinds=+i”添加到我的 ctags 命令中。
运行“ctags --list-kinds”列出可以为不同语言输出的信息种类。
Ok so of course I find the answer right after asking this question. I just needed to add "--fortran-kinds=+i" to my ctags command.
Running "ctags --list-kinds" lists the kinds of information that can be output for different languages.