Hi, What are some good tricks to getting autocomplete and GoToDefinition working across files within the same project?
Sorry this is a newbie question, I just started evaluating sublime and I assume it is meant to allow cross-file operations.
Problem 1: Autocomplete in a *.cc file does not know about symbols in an included header file.
Problem 2: /Goto/GotoDefinition works OK if the symbol is in the same file but not elsewhere in the project.
Some guesses - tell me if these are good directions to troubleshoot:
Maybe sublime does not follow the include path for #include, but I also tried using just #include “foo.h” without any directory.
Maybe the code is too complex to parse because it uses C++ templates and stl. The color coding is odd, it seems to use green for functions but with templates only the destructors and some random members in the intializer list are green.
Below shows the general type of problem I have, but this simple example seems to work ok making me think there is something about my files or configuration.
Example:
//foo.h:
class Foo {
Foo::Foo();
int mSomeVariable;
};
void Bar() {
// Here sublime has autocomplete for mSomeVariable even though it is out of scope.
}
// foo.cc:
#include "foo.h"
Foo::Foo()
: mSomeVariable(0) // Here sublime autocomplete has no knowledge of mSomeVariable
{ }
Sublime Text : build 3083, no packages
OS: Linux Mint
My project uses cmake.