forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user