Clang: Use follow symbol result from clang when global fails

When built-in code model fails to follow symbol under cursor
fall back to the clang result even if it only follows
to the decalration.

Change-Id: I22d8c5fee6ab7594b1d1b7ce8104414db28383c7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-06-01 10:46:20 +02:00
parent 52bd5173fb
commit 4e4bd4909a
14 changed files with 122 additions and 37 deletions

View File

@@ -255,7 +255,7 @@ static
CppTools::SymbolInfo toSymbolInfo(const FollowSymbolMessage &message)
{
CppTools::SymbolInfo result;
const SourceRangeContainer &range = message.sourceRange;
const SourceRangeContainer &range = message.result.range;
const SourceLocationContainer &start = range.start;
const SourceLocationContainer &end = range.end;
@@ -265,6 +265,8 @@ CppTools::SymbolInfo toSymbolInfo(const FollowSymbolMessage &message)
result.endColumn = static_cast<int>(end.column);
result.fileName = start.filePath;
result.isPureDeclarationForUsage = message.result.isPureDeclarationForUsage;
return result;
}
@@ -354,7 +356,7 @@ void BackendReceiver::tooltip(const ToolTipMessage &message)
void BackendReceiver::followSymbol(const ClangBackEnd::FollowSymbolMessage &message)
{
qCDebugIpc() << "FollowSymbolMessage with"
<< message.sourceRange << "range";
<< message.result;
const quint64 ticket = message.ticketNumber;
QFutureInterface<CppTools::SymbolInfo> futureInterface = m_followTable.take(ticket);