Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctags and Fortran's interfaces

Tags:

vim

ctags

fortran

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?

like image 341
AdamR Avatar asked Feb 27 '23 11:02

AdamR


1 Answers

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.

like image 143
AdamR Avatar answered Mar 06 '23 20:03

AdamR