ctags and Fortran's interfaces

匆匆过客 提交于 2019-12-06 08:22:07

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/3497538/ctags-and-fortrans-interfaces

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!