0

I use vim + ctag + cscope when I browse C++ source code. When I want to look up a definition of any function cscope and/or ctag produce a list of cadidates which seem to be the one.

But when I try this for a function which is defined in a class declaration in a header file, none of those two produce the list of cadidates. When ctag and/or cscope fail like this I now know that the function definition should be in a header file. So I open the header file and find the function definition in it.

But I wonder if this is inevitable behavior of ctag and cscope. Aren't there any way to make them(ctag and cscope) clever for this kind of cases so that I can find the definition of every function even though they are defined in a header file?

Thank you very much.

Journeyer J. Joh

Jumogehn
  • 1,102
  • 3
  • 11
  • 29

1 Answers1

1

I generated tag file like the one below.

ctags --langmap=C++:.inc --c++-kinds=+p --fields=+iaS --extra=+fq --sort=foldcase -R .

But it has to be corrected the way below.

ctags --langmap=C++:+.inc --c++-kinds=+p --fields=+iaS --extra=+fq --sort=foldcase -R .

from

--langmap=C++:.inc

to

--langmap=C++:+.inc

man ctags has instruction for this:

[...] to specify that only files with extensions of .c and .x are to be treated as C language files, use "--langmap=c:.c.x"; to also add files with extensions of .j as Java language files, specify "--langmap=c:.c.x,java:+.j".

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
Jumogehn
  • 1,102
  • 3
  • 11
  • 29