If my code uses smart pointers, navigation and completion don't work with SourceInsight. For example with this simple example code:
class test {
public:
void fun(){}
};
int main() {
boost::scoped_ptr<test> a;
a->fun();
return 0;
}
When I click fun()
in main
, SourceInsight tells me "symbol not found".
Is there something I should do to fix that, or does SourceInsight have limitations?
So I've given this a try. Downloaded, virus-scanned, signed up for free trial, installed wine, run!
Now, I can make SourceInsight import the symbols from the Boost directories:
I then enter the path to my Boost directory: Z:\home\sehe\custom\boost\
Processing takes a minute or two:
Seems ok:
Now if you import these symbols in your project:
You will find you can navigate to boost::scoped_ptr<>
just fine (I double-clicked on the a
in the declaration of a
):
But it will not find references to fun
:
Finds only the declaration:
Of course you can use simple string search, but that wasn't the point.
Here's the HTML export: https://s3.amazonaws.com/stackoverflow-sehe/f14b4ee2-9b4d-49cd-893d-cf69372dd586/HTML/test.cpp.html
Conclusion
It seems this is a limitation of SourceInsight, not due to misconfiguration.
来源:https://stackoverflow.com/questions/47204688/how-can-i-make-sourceinsight-understand-smart-pointers