2017-09-25 15:10:48 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
|
**
|
|
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "clangbackendreceiver.h"
|
|
|
|
|
|
|
|
|
|
#include "clangbackendlogging.h"
|
|
|
|
|
|
|
|
|
|
#include "clangcompletionassistprocessor.h"
|
|
|
|
|
#include "clangeditordocumentprocessor.h"
|
|
|
|
|
|
|
|
|
|
#include <cpptools/cpptoolsbridge.h>
|
|
|
|
|
|
|
|
|
|
#include <clangsupport/clangcodemodelclientmessages.h>
|
|
|
|
|
|
|
|
|
|
#include <QLoggingCategory>
|
|
|
|
|
#include <QTextBlock>
|
|
|
|
|
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
|
2017-12-13 17:52:02 +01:00
|
|
|
#define qCDebugIpc() qCDebug(ipcLog) << "<===="
|
|
|
|
|
|
2017-09-25 15:10:48 +02:00
|
|
|
using namespace ClangBackEnd;
|
|
|
|
|
|
|
|
|
|
namespace ClangCodeModel {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
static bool printAliveMessageHelper()
|
|
|
|
|
{
|
|
|
|
|
const bool print = qEnvironmentVariableIntValue("QTC_CLANG_FORCE_VERBOSE_ALIVE");
|
|
|
|
|
if (!print) {
|
2017-12-13 17:41:44 +01:00
|
|
|
qCDebug(ipcLog) << "Hint: AliveMessage will not be printed. "
|
|
|
|
|
"Force it by setting QTC_CLANG_FORCE_VERBOSE_ALIVE=1.";
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return print;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool printAliveMessage()
|
|
|
|
|
{
|
2017-12-13 17:41:44 +01:00
|
|
|
static bool print = ipcLog().isDebugEnabled() ? printAliveMessageHelper() : false;
|
2017-09-25 15:10:48 +02:00
|
|
|
return print;
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-04 21:44:21 +01:00
|
|
|
BackendReceiver::BackendReceiver() = default;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
|
|
|
|
BackendReceiver::~BackendReceiver()
|
|
|
|
|
{
|
|
|
|
|
reset();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::setAliveHandler(const BackendReceiver::AliveHandler &handler)
|
|
|
|
|
{
|
|
|
|
|
m_aliveHandler = handler;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-31 15:21:53 +02:00
|
|
|
void BackendReceiver::addExpectedCompletionsMessage(
|
2017-09-25 15:10:48 +02:00
|
|
|
quint64 ticket,
|
|
|
|
|
ClangCompletionAssistProcessor *processor)
|
|
|
|
|
{
|
|
|
|
|
QTC_ASSERT(processor, return);
|
|
|
|
|
QTC_CHECK(!m_assistProcessorsTable.contains(ticket));
|
|
|
|
|
m_assistProcessorsTable.insert(ticket, processor);
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-19 07:44:46 +02:00
|
|
|
void BackendReceiver::cancelProcessor(TextEditor::IAssistProcessor *processor)
|
|
|
|
|
{
|
|
|
|
|
for (auto it = m_assistProcessorsTable.cbegin(), end = m_assistProcessorsTable.cend();
|
|
|
|
|
it != end; ++it)
|
|
|
|
|
{
|
|
|
|
|
if (it.value() == processor) {
|
|
|
|
|
m_assistProcessorsTable.erase(it);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-25 15:10:48 +02:00
|
|
|
void BackendReceiver::deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget)
|
|
|
|
|
{
|
2019-07-24 13:43:54 +02:00
|
|
|
QList<quint64> toRemove;
|
|
|
|
|
for (auto it = m_assistProcessorsTable.cbegin(), end = m_assistProcessorsTable.cend();
|
|
|
|
|
it != end; ++it)
|
|
|
|
|
{
|
2017-09-25 15:10:48 +02:00
|
|
|
ClangCompletionAssistProcessor *assistProcessor = it.value();
|
|
|
|
|
if (assistProcessor->textEditorWidget() == textEditorWidget) {
|
|
|
|
|
delete assistProcessor;
|
2019-07-24 13:43:54 +02:00
|
|
|
toRemove.append(it.key());
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
}
|
2019-07-24 13:43:54 +02:00
|
|
|
for (quint64 item : toRemove)
|
|
|
|
|
m_assistProcessorsTable.remove(item);
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFuture<CppTools::CursorInfo> BackendReceiver::addExpectedReferencesMessage(
|
|
|
|
|
quint64 ticket,
|
|
|
|
|
const CppTools::SemanticInfo::LocalUseMap &localUses)
|
|
|
|
|
{
|
|
|
|
|
QTC_CHECK(!m_referencesTable.contains(ticket));
|
|
|
|
|
|
|
|
|
|
QFutureInterface<CppTools::CursorInfo> futureInterface;
|
|
|
|
|
futureInterface.reportStarted();
|
|
|
|
|
|
2017-11-29 16:08:06 +01:00
|
|
|
const ReferencesEntry entry{futureInterface, localUses};
|
2017-09-25 15:10:48 +02:00
|
|
|
m_referencesTable.insert(ticket, entry);
|
|
|
|
|
|
|
|
|
|
return futureInterface.future();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QFuture<CppTools::SymbolInfo> BackendReceiver::addExpectedRequestFollowSymbolMessage(quint64 ticket)
|
|
|
|
|
{
|
|
|
|
|
QTC_CHECK(!m_followTable.contains(ticket));
|
|
|
|
|
|
|
|
|
|
QFutureInterface<CppTools::SymbolInfo> futureInterface;
|
|
|
|
|
futureInterface.reportStarted();
|
|
|
|
|
|
|
|
|
|
m_followTable.insert(ticket, futureInterface);
|
|
|
|
|
|
|
|
|
|
return futureInterface.future();
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-12 12:29:43 +01:00
|
|
|
QFuture<CppTools::ToolTipInfo> BackendReceiver::addExpectedToolTipMessage(quint64 ticket)
|
|
|
|
|
{
|
|
|
|
|
QTC_CHECK(!m_toolTipsTable.contains(ticket));
|
|
|
|
|
|
|
|
|
|
QFutureInterface<CppTools::ToolTipInfo> futureInterface;
|
|
|
|
|
futureInterface.reportStarted();
|
|
|
|
|
|
|
|
|
|
m_toolTipsTable.insert(ticket, futureInterface);
|
|
|
|
|
|
|
|
|
|
return futureInterface.future();
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-31 15:21:53 +02:00
|
|
|
bool BackendReceiver::isExpectingCompletionsMessage() const
|
2017-09-25 15:10:48 +02:00
|
|
|
{
|
|
|
|
|
return !m_assistProcessorsTable.isEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::reset()
|
|
|
|
|
{
|
|
|
|
|
// Clean up waiting assist processors
|
2020-03-25 09:49:23 +01:00
|
|
|
for (ClangCompletionAssistProcessor *processor : m_assistProcessorsTable) {
|
|
|
|
|
processor->setAsyncProposalAvailable(nullptr);
|
|
|
|
|
delete processor;
|
|
|
|
|
}
|
2017-09-25 15:10:48 +02:00
|
|
|
m_assistProcessorsTable.clear();
|
|
|
|
|
|
2018-01-18 12:16:43 +01:00
|
|
|
// Clean up futures for references; TODO: Remove duplication
|
2017-11-27 12:42:47 +01:00
|
|
|
for (ReferencesEntry &entry : m_referencesTable) {
|
2017-09-25 15:10:48 +02:00
|
|
|
entry.futureInterface.cancel();
|
2017-11-27 12:42:47 +01:00
|
|
|
entry.futureInterface.reportFinished();
|
|
|
|
|
}
|
2017-09-25 15:10:48 +02:00
|
|
|
m_referencesTable.clear();
|
2017-11-27 12:42:47 +01:00
|
|
|
for (QFutureInterface<CppTools::SymbolInfo> &futureInterface : m_followTable) {
|
2017-09-25 15:10:48 +02:00
|
|
|
futureInterface.cancel();
|
2017-11-27 12:42:47 +01:00
|
|
|
futureInterface.reportFinished();
|
|
|
|
|
}
|
2017-09-25 15:10:48 +02:00
|
|
|
m_followTable.clear();
|
2018-01-18 12:16:43 +01:00
|
|
|
for (QFutureInterface<CppTools::ToolTipInfo> &futureInterface : m_toolTipsTable) {
|
|
|
|
|
futureInterface.cancel();
|
|
|
|
|
futureInterface.reportFinished();
|
|
|
|
|
}
|
|
|
|
|
m_toolTipsTable.clear();
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::alive()
|
|
|
|
|
{
|
|
|
|
|
if (printAliveMessage())
|
2017-12-13 17:52:02 +01:00
|
|
|
qCDebugIpc() << "AliveMessage";
|
2017-09-25 15:10:48 +02:00
|
|
|
QTC_ASSERT(m_aliveHandler, return);
|
|
|
|
|
m_aliveHandler();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::echo(const EchoMessage &message)
|
|
|
|
|
{
|
2017-12-13 17:52:02 +01:00
|
|
|
qCDebugIpc() << message;
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-31 15:21:53 +02:00
|
|
|
void BackendReceiver::completions(const CompletionsMessage &message)
|
2017-09-25 15:10:48 +02:00
|
|
|
{
|
2018-05-31 15:21:53 +02:00
|
|
|
qCDebugIpc() << "CompletionsMessage with" << message.codeCompletions.size()
|
2017-12-13 17:52:02 +01:00
|
|
|
<< "items";
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const quint64 ticket = message.ticketNumber;
|
2020-03-26 09:21:57 +01:00
|
|
|
if (ClangCompletionAssistProcessor *processor = m_assistProcessorsTable.take(ticket))
|
2018-06-15 14:35:58 +02:00
|
|
|
processor->handleAvailableCompletions(message.codeCompletions);
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-31 15:21:53 +02:00
|
|
|
void BackendReceiver::annotations(const AnnotationsMessage &message)
|
2017-09-25 15:10:48 +02:00
|
|
|
{
|
2018-10-10 15:48:55 +02:00
|
|
|
qCDebugIpc() << "AnnotationsMessage"
|
|
|
|
|
<< "for" << QFileInfo(message.fileContainer.filePath).fileName() << "with"
|
|
|
|
|
<< message.diagnostics.size() << "diagnostics" << message.tokenInfos.size()
|
|
|
|
|
<< "token infos" << message.skippedPreprocessorRanges.size()
|
|
|
|
|
<< "skipped preprocessor ranges";
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
auto processor = ClangEditorDocumentProcessor::get(message.fileContainer.filePath);
|
2018-01-19 09:18:57 +01:00
|
|
|
if (!processor)
|
|
|
|
|
return;
|
|
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const quint32 documentRevision = message.fileContainer.documentRevision;
|
|
|
|
|
if (message.onlyTokenInfos) {
|
|
|
|
|
processor->updateTokenInfos(message.tokenInfos, documentRevision);
|
2018-01-19 09:18:57 +01:00
|
|
|
return;
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
2018-04-04 18:25:23 +02:00
|
|
|
processor->updateCodeWarnings(message.diagnostics,
|
|
|
|
|
message.firstHeaderErrorDiagnostic,
|
2018-01-19 09:18:57 +01:00
|
|
|
documentRevision);
|
2018-04-04 18:25:23 +02:00
|
|
|
processor->updateHighlighting(message.tokenInfos,
|
|
|
|
|
message.skippedPreprocessorRanges,
|
2018-01-19 09:18:57 +01:00
|
|
|
documentRevision);
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
2017-11-29 16:08:06 +01:00
|
|
|
CppTools::CursorInfo::Range toCursorInfoRange(const SourceRangeContainer &sourceRange)
|
2017-09-25 15:10:48 +02:00
|
|
|
{
|
2018-04-04 18:25:23 +02:00
|
|
|
const SourceLocationContainer &start = sourceRange.start;
|
|
|
|
|
const SourceLocationContainer &end = sourceRange.end;
|
2019-07-24 18:40:10 +02:00
|
|
|
const int length = end.column - start.column;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2019-02-07 12:44:25 +01:00
|
|
|
return {start.line, start.column, length};
|
2017-09-25 15:10:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
2017-11-29 16:08:06 +01:00
|
|
|
CppTools::CursorInfo toCursorInfo(const CppTools::SemanticInfo::LocalUseMap &localUses,
|
2017-09-25 15:10:48 +02:00
|
|
|
const ReferencesMessage &message)
|
|
|
|
|
{
|
|
|
|
|
CppTools::CursorInfo result;
|
2018-04-04 18:25:23 +02:00
|
|
|
const QVector<SourceRangeContainer> &references = message.references;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
result.areUseRangesForLocalVariable = message.isLocalVariable;
|
2017-09-25 15:10:48 +02:00
|
|
|
for (const SourceRangeContainer &reference : references)
|
2017-11-29 16:08:06 +01:00
|
|
|
result.useRanges.append(toCursorInfoRange(reference));
|
2017-09-25 15:10:48 +02:00
|
|
|
|
|
|
|
|
result.useRanges.reserve(references.size());
|
|
|
|
|
result.localUses = localUses;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
CppTools::SymbolInfo toSymbolInfo(const FollowSymbolMessage &message)
|
|
|
|
|
{
|
|
|
|
|
CppTools::SymbolInfo result;
|
2018-06-01 10:46:20 +02:00
|
|
|
const SourceRangeContainer &range = message.result.range;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const SourceLocationContainer &start = range.start;
|
|
|
|
|
const SourceLocationContainer &end = range.end;
|
2019-07-24 18:40:10 +02:00
|
|
|
result.startLine = start.line;
|
|
|
|
|
result.startColumn = start.column;
|
|
|
|
|
result.endLine = end.line;
|
|
|
|
|
result.endColumn = end.column;
|
2018-04-04 18:25:23 +02:00
|
|
|
result.fileName = start.filePath;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-06-07 14:23:07 +02:00
|
|
|
result.isResultOnlyForFallBack = message.result.isResultOnlyForFallBack;
|
2018-06-01 10:46:20 +02:00
|
|
|
|
2017-09-25 15:10:48 +02:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::references(const ReferencesMessage &message)
|
|
|
|
|
{
|
2017-12-13 17:52:02 +01:00
|
|
|
qCDebugIpc() << "ReferencesMessage with"
|
2018-04-04 18:25:23 +02:00
|
|
|
<< message.references.size() << "references";
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const quint64 ticket = message.ticketNumber;
|
2017-09-25 15:10:48 +02:00
|
|
|
const ReferencesEntry entry = m_referencesTable.take(ticket);
|
|
|
|
|
QFutureInterface<CppTools::CursorInfo> futureInterface = entry.futureInterface;
|
|
|
|
|
QTC_CHECK(futureInterface != QFutureInterface<CppTools::CursorInfo>());
|
|
|
|
|
|
|
|
|
|
if (futureInterface.isCanceled())
|
|
|
|
|
return; // Editor document closed or a new request was issued making this result outdated.
|
|
|
|
|
|
2017-11-29 16:08:06 +01:00
|
|
|
futureInterface.reportResult(toCursorInfo(entry.localUses, message));
|
2017-09-25 15:10:48 +02:00
|
|
|
futureInterface.reportFinished();
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-24 11:30:58 +01:00
|
|
|
static Core::HelpItem::Category toHelpItemCategory(ToolTipInfo::QdocCategory category)
|
2018-01-12 12:29:43 +01:00
|
|
|
{
|
|
|
|
|
switch (category) {
|
|
|
|
|
case ToolTipInfo::Unknown:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Unknown;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::ClassOrNamespace:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::ClassOrNamespace;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::Enum:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Enum;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::Typedef:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Typedef;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::Macro:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Macro;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::Brief:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Brief;
|
2018-01-12 12:29:43 +01:00
|
|
|
case ToolTipInfo::Function:
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Function;
|
2018-01-12 12:29:43 +01:00
|
|
|
}
|
|
|
|
|
|
2019-01-24 11:30:58 +01:00
|
|
|
return Core::HelpItem::Unknown;
|
2018-01-12 12:29:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static QStringList toStringList(const Utf8StringVector &utf8StringVector)
|
|
|
|
|
{
|
|
|
|
|
QStringList list;
|
|
|
|
|
list.reserve(utf8StringVector.size());
|
|
|
|
|
|
|
|
|
|
for (const Utf8String &utf8String : utf8StringVector)
|
|
|
|
|
list << utf8String.toString();
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static CppTools::ToolTipInfo toToolTipInfo(const ToolTipMessage &message)
|
|
|
|
|
{
|
|
|
|
|
CppTools::ToolTipInfo info;
|
|
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const ToolTipInfo &backendInfo = message.toolTipInfo;
|
2018-01-12 12:29:43 +01:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
info.text = backendInfo.text;
|
|
|
|
|
info.briefComment = backendInfo.briefComment;
|
2018-01-12 12:29:43 +01:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
info.qDocIdCandidates = toStringList(backendInfo.qdocIdCandidates);
|
|
|
|
|
info.qDocMark = backendInfo.qdocMark;
|
|
|
|
|
info.qDocCategory = toHelpItemCategory(backendInfo.qdocCategory);
|
2018-01-12 12:29:43 +01:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
info.sizeInBytes = backendInfo.sizeInBytes;
|
2018-01-12 12:29:43 +01:00
|
|
|
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void BackendReceiver::tooltip(const ToolTipMessage &message)
|
|
|
|
|
{
|
2018-04-04 18:25:23 +02:00
|
|
|
qCDebugIpc() << "ToolTipMessage" << message.toolTipInfo.text;
|
2018-01-12 12:29:43 +01:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const quint64 ticket = message.ticketNumber;
|
2018-01-12 12:29:43 +01:00
|
|
|
QFutureInterface<CppTools::ToolTipInfo> futureInterface = m_toolTipsTable.take(ticket);
|
|
|
|
|
QTC_CHECK(futureInterface != QFutureInterface<CppTools::ToolTipInfo>());
|
|
|
|
|
|
|
|
|
|
if (futureInterface.isCanceled())
|
|
|
|
|
return; // A new request was issued making this one outdated.
|
|
|
|
|
|
|
|
|
|
futureInterface.reportResult(toToolTipInfo(message));
|
|
|
|
|
futureInterface.reportFinished();
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-25 15:10:48 +02:00
|
|
|
void BackendReceiver::followSymbol(const ClangBackEnd::FollowSymbolMessage &message)
|
|
|
|
|
{
|
2017-12-13 17:52:02 +01:00
|
|
|
qCDebugIpc() << "FollowSymbolMessage with"
|
2018-06-01 10:46:20 +02:00
|
|
|
<< message.result;
|
2017-09-25 15:10:48 +02:00
|
|
|
|
2018-04-04 18:25:23 +02:00
|
|
|
const quint64 ticket = message.ticketNumber;
|
2017-09-25 15:10:48 +02:00
|
|
|
QFutureInterface<CppTools::SymbolInfo> futureInterface = m_followTable.take(ticket);
|
|
|
|
|
QTC_CHECK(futureInterface != QFutureInterface<CppTools::SymbolInfo>());
|
|
|
|
|
|
|
|
|
|
if (futureInterface.isCanceled())
|
|
|
|
|
return; // Editor document closed or a new request was issued making this result outdated.
|
|
|
|
|
|
|
|
|
|
futureInterface.reportResult(toSymbolInfo(message));
|
|
|
|
|
futureInterface.reportFinished();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClangCodeModel
|