forked from qt-creator/qt-creator
C++: Fix "reference" file in symbol finder
Througout the initial review the singleton was transformed into an ordinary class, but a error was introduced: The "reference" file was incorrectly assumed to be the editors file, which is wrong, since it should be the declaration file. Change-Id: Iad3e25a690fa8bd07a18184b24b10f8dea965332 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -274,8 +274,7 @@ static Document::Ptr findDefinition(Function *functionDeclaration, int *line)
|
||||
{
|
||||
if (CppModelManagerInterface *cppModelManager = CppModelManagerInterface::instance()) {
|
||||
const Snapshot snapshot = cppModelManager->snapshot();
|
||||
CppTools::SymbolFinder symbolFinder(functionDeclaration->fileName(),
|
||||
functionDeclaration->fileNameLength());
|
||||
CppTools::SymbolFinder symbolFinder;
|
||||
if (Symbol *def = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
|
||||
if (line)
|
||||
*line = def->line();
|
||||
|
||||
Reference in New Issue
Block a user