C++: Make 'follow symbol' work with forward declared classes.

If it encounters a forward declaration, it tries to find the class
declaration globally now.

Task-number: QTCREATORBUG-20
This commit is contained in:
Christian Kamm
2010-06-16 15:35:34 +02:00
parent 2deae8c84a
commit e1a0f5abef
4 changed files with 30 additions and 1 deletions

View File

@@ -1315,6 +1315,10 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
def = 0; // jump to declaration then.
}
if (symbol->isForwardClassDeclaration()) {
def = snapshot.findMatchingClassDeclaration(symbol);
}
link = linkToSymbol(def ? def : symbol);
link.begin = beginOfToken;
link.end = endOfToken;