Sublime Forum

C++ goto symbol with templates

#1

Hello everyone; first post, though I have used Sublime Text for quite a while now.

I have a question about some awkward behavior when using Goto Symbol with C++. I’m editing a pre-generated stack.cpp for my CS class and it uses templates in the form of

template<class T> void Stack<T>::push(T const & newItem) { // my code }
For some reason that I have yet to fully comprehend, this means that they #include “stack.cpp” at the bottom of the stack.h file rather than the including the .h file at the top of the .cpp.

Anyways, in Sublime, if I press Command-R, or even Command-P and then type stack.cpp@, I get this:

Cycling through those T tags does get me to each function, but it renders Goto Symbol useless. Can anyone recommend a workaround (maybe even a plugin) to get the symbols to display properly without modifying the code? I can confirm that Goto Symbol works fine in Java and Python on my machine.

0 Likes