forked from qt-creator/qt-creator
Clang: Use built-in follow symbol for virtual methods
ClangCodeModel currently does not provide a list of overrides. Therefore it makes sense to use ClangCodeModel result for virtual method only if built-in code model does not find anything. Task-number: QTCREATORBUG-20584 Change-Id: I5b4fac7974f990e741d3438ab61827670a8ce8d8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -152,14 +152,15 @@ FollowSymbolResult FollowSymbol::followSymbol(CXTranslationUnit tu,
|
||||
if (!cursor.isDeclaration()) {
|
||||
// This is the symbol usage
|
||||
// We want to return definition
|
||||
FollowSymbolResult result;
|
||||
cursor = cursor.referenced();
|
||||
if (cursor.isNull())
|
||||
return SourceRangeContainer();
|
||||
if (!cursor.isDefinition()) {
|
||||
// We can't find definition in this TU
|
||||
result.isPureDeclarationForUsage = true;
|
||||
}
|
||||
|
||||
FollowSymbolResult result;
|
||||
// We can't find definition in this TU or it's a virtual method call
|
||||
if (!cursor.isDefinition() || cursor.isVirtualMethod())
|
||||
result.isResultOnlyForFallBack = true;
|
||||
|
||||
result.range = extractMatchingTokenRange(cursor, tokenSpelling);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user