Linux — использование ctags для поиска переменных, объявленных с помощью конструктора в Stack Overflow

С помощью этой команды

ctags -R --c++-kinds=l -x test.cpp

ctags может найти только переменную c2, а не varibale c3

фрагмент кода:

int main()
{
int c2 = 5;
int c3(3);
return 0;
}

1

Решение

Универсальный-Ctags (https://ctags.io/) может захватить с3.

[jet@localhost ctags]$ cat /tmp/foo.cpp
int main()
{
int c2 = 5;
int c3(3);
return 0;
}
[jet@localhost ctags]$ ./ctags --kinds-C++=+l -o - /tmp/foo.cpp
c2  /tmp/foo.cpp    /^  int c2 = 5;$/;" l   function:main   typeref:typename:int    file:
c3  /tmp/foo.cpp    /^  int c3(3);$/;"  l   function:main   typeref:typename:int    file:
main    /tmp/foo.cpp    /^int main()$/;"    f   typeref:typename:int
2

Другие решения

Других решений пока нет …