Commit affc652b authored by Ivan Donchevskii's avatar Ivan Donchevskii

Clang: Rename HighlightingMark to TokenInfo

Before adding additional members into that class it
makes sense to rename it to better represent its content.

Other classes serving the same purpose are also renamed
to keep the names consistent.

Change-Id: I3c8517e42aae29779d71ec9c85b713cff581a473
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent b1bb6d96
......@@ -41,7 +41,6 @@ SOURCES += \
$$PWD/filepath.cpp \
$$PWD/fixitcontainer.cpp \
$$PWD/followsymbolmessage.cpp \
$$PWD/highlightingmarkcontainer.cpp \
$$PWD/ipcclientinterface.cpp \
$$PWD/ipcinterface.cpp \
$$PWD/ipcserverinterface.cpp \
......@@ -82,6 +81,7 @@ SOURCES += \
$$PWD/sourcerangescontainer.cpp \
$$PWD/sourcerangesforquerymessage.cpp \
$$PWD/sourcerangewithtextcontainer.cpp \
$$PWD/tokeninfocontainer.cpp \
$$PWD/unregisterunsavedfilesforeditormessage.cpp \
$$PWD/updatepchprojectpartsmessage.cpp \
$$PWD/updatetranslationunitsforeditormessage.cpp \
......@@ -131,7 +131,6 @@ HEADERS += \
$$PWD/filecontainerv2.h \
$$PWD/fixitcontainer.h \
$$PWD/followsymbolmessage.h \
$$PWD/highlightingmarkcontainer.h \
$$PWD/idpaths.h \
$$PWD/ipcclientinterface.h \
$$PWD/ipcinterface.h \
......@@ -176,6 +175,7 @@ HEADERS += \
$$PWD/sourcerangesforquerymessage.h \
$$PWD/sourcerangewithtextcontainer.h \
$$PWD/stringcache.h \
$$PWD/tokeninfocontainer.h \
$$PWD/unregisterunsavedfilesforeditormessage.h \
$$PWD/updatepchprojectpartsmessage.h \
$$PWD/updatetranslationunitsforeditormessage.h \
......
......@@ -38,7 +38,7 @@ QDebug operator<<(QDebug debug, const DocumentAnnotationsChangedMessage &message
<< message.fileContainer()
<< ", " << message.diagnostics().size()
<< ", " << !message.firstHeaderErrorDiagnostic().text().isEmpty()
<< ", " << message.highlightingMarks().size()
<< ", " << message.tokenInfos().size()
<< ", " << message.skippedPreprocessorRanges().size()
<< ")";
......@@ -51,7 +51,7 @@ std::ostream &operator<<(std::ostream &os, const DocumentAnnotationsChangedMessa
<< message.fileContainer()
<< "," << message.diagnostics().size()
<< "," << !message.firstHeaderErrorDiagnostic().text().isEmpty()
<< "," << message.highlightingMarks().size()
<< "," << message.tokenInfos().size()
<< "," << message.skippedPreprocessorRanges().size()
<< ")";
......
......@@ -28,7 +28,7 @@
#include "clangsupport_global.h"
#include "diagnosticcontainer.h"
#include "filecontainer.h"
#include "highlightingmarkcontainer.h"
#include "tokeninfocontainer.h"
#include "sourcerangecontainer.h"
#include <QVector>
......@@ -42,12 +42,12 @@ public:
DocumentAnnotationsChangedMessage(const FileContainer &fileContainer,
const QVector<DiagnosticContainer> &diagnostics,
const DiagnosticContainer &firstHeaderErrorDiagnostic,
const QVector<HighlightingMarkContainer> &highlightingMarks,
const QVector<TokenInfoContainer> &tokenInfos,
const QVector<SourceRangeContainer> &skippedPreprocessorRanges)
: m_fileContainer(fileContainer),
m_diagnostics(diagnostics),
m_firstHeaderErrorDiagnostic(firstHeaderErrorDiagnostic),
m_highlightingMarks(highlightingMarks),
m_tokenInfos(tokenInfos),
m_skippedPreprocessorRanges(skippedPreprocessorRanges)
{
}
......@@ -67,9 +67,9 @@ public:
return m_firstHeaderErrorDiagnostic;
}
const QVector<HighlightingMarkContainer> &highlightingMarks() const
const QVector<TokenInfoContainer> &tokenInfos() const
{
return m_highlightingMarks;
return m_tokenInfos;
}
const QVector<SourceRangeContainer> &skippedPreprocessorRanges() const
......@@ -82,7 +82,7 @@ public:
out << message.m_fileContainer;
out << message.m_diagnostics;
out << message.m_firstHeaderErrorDiagnostic;
out << message.m_highlightingMarks;
out << message.m_tokenInfos;
out << message.m_skippedPreprocessorRanges;
return out;
......@@ -93,7 +93,7 @@ public:
in >> message.m_fileContainer;
in >> message.m_diagnostics;
in >> message.m_firstHeaderErrorDiagnostic;
in >> message.m_highlightingMarks;
in >> message.m_tokenInfos;
in >> message.m_skippedPreprocessorRanges;
return in;
......@@ -105,7 +105,7 @@ public:
return first.m_fileContainer == second.m_fileContainer
&& first.m_diagnostics == second.m_diagnostics
&& first.m_firstHeaderErrorDiagnostic == second.m_firstHeaderErrorDiagnostic
&& first.m_highlightingMarks == second.m_highlightingMarks
&& first.m_tokenInfos == second.m_tokenInfos
&& first.m_skippedPreprocessorRanges == second.m_skippedPreprocessorRanges;
}
......@@ -113,7 +113,7 @@ private:
FileContainer m_fileContainer;
QVector<DiagnosticContainer> m_diagnostics;
DiagnosticContainer m_firstHeaderErrorDiagnostic;
QVector<HighlightingMarkContainer> m_highlightingMarks;
QVector<TokenInfoContainer> m_tokenInfos;
QVector<SourceRangeContainer> m_skippedPreprocessorRanges;
};
......
......@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "highlightingmarkcontainer.h"
#include "tokeninfocontainer.h"
#include <QDebug>
......@@ -59,9 +59,9 @@ static const char *highlightingTypeToCStringLiteral(HighlightingType type)
}
#undef RETURN_TEXT_FOR_CASE
QDebug operator<<(QDebug debug, const HighlightingMarkContainer &container)
QDebug operator<<(QDebug debug, const TokenInfoContainer &container)
{
debug.nospace() << "HighlightingMarkContainer("
debug.nospace() << "TokenInfosContainer("
<< container.line() << ", "
<< container.column() << ", "
<< container.length() << ", "
......@@ -91,7 +91,7 @@ std::ostream &operator<<(std::ostream &os, HighlightingTypes types)
return os;
}
std::ostream &operator<<(std::ostream &os, const HighlightingMarkContainer &container)
std::ostream &operator<<(std::ostream &os, const TokenInfoContainer &container)
{
os << "("
<< container.line() << ", "
......
......@@ -40,11 +40,11 @@ inline QDataStream &operator>>(QDataStream &in, HighlightingTypes &highlightingT
inline bool operator==(const MixinHighlightingTypes &first, const MixinHighlightingTypes &second);
inline bool operator==(const HighlightingTypes &first, const HighlightingTypes &second);
class HighlightingMarkContainer
class TokenInfoContainer
{
public:
HighlightingMarkContainer() = default;
HighlightingMarkContainer(uint line, uint column, uint length, HighlightingTypes types,
TokenInfoContainer() = default;
TokenInfoContainer(uint line, uint column, uint length, HighlightingTypes types,
bool isIdentifier = false, bool isIncludeDirectivePath = false)
: line_(line),
column_(column),
......@@ -55,7 +55,7 @@ public:
{
}
HighlightingMarkContainer(uint line, uint column, uint length, HighlightingType type)
TokenInfoContainer(uint line, uint column, uint length, HighlightingType type)
: line_(line),
column_(column),
length_(length)
......@@ -98,7 +98,7 @@ public:
return isIncludeDirectivePath_;
}
friend QDataStream &operator<<(QDataStream &out, const HighlightingMarkContainer &container)
friend QDataStream &operator<<(QDataStream &out, const TokenInfoContainer &container)
{
out << container.line_;
out << container.column_;
......@@ -110,7 +110,7 @@ public:
return out;
}
friend QDataStream &operator>>(QDataStream &in, HighlightingMarkContainer &container)
friend QDataStream &operator>>(QDataStream &in, TokenInfoContainer &container)
{
in >> container.line_;
in >> container.column_;
......@@ -122,7 +122,7 @@ public:
return in;
}
friend bool operator==(const HighlightingMarkContainer &first, const HighlightingMarkContainer &second)
friend bool operator==(const TokenInfoContainer &first, const TokenInfoContainer &second)
{
return first.line_ == second.line_
&& first.column_ == second.column_
......@@ -200,9 +200,9 @@ inline bool operator==(const HighlightingTypes &first, const HighlightingTypes &
&& first.mixinHighlightingTypes == second.mixinHighlightingTypes;
}
CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const HighlightingMarkContainer &container);
CLANGSUPPORT_EXPORT QDebug operator<<(QDebug debug, const TokenInfoContainer &container);
CLANGSUPPORT_EXPORT std::ostream &operator<<(std::ostream &os, HighlightingType highlightingType);
CLANGSUPPORT_EXPORT std::ostream &operator<<(std::ostream &os, HighlightingTypes types);
std::ostream &operator<<(std::ostream &os, const HighlightingMarkContainer &container);
std::ostream &operator<<(std::ostream &os, const TokenInfoContainer &container);
} // namespace ClangBackEnd
......@@ -181,7 +181,7 @@ void BackendReceiver::documentAnnotationsChanged(const DocumentAnnotationsChange
{
qCDebug(log) << "<<< DocumentAnnotationsChangedMessage with"
<< message.diagnostics().size() << "diagnostics"
<< message.highlightingMarks().size() << "highlighting marks"
<< message.tokenInfos().size() << "highlighting marks"
<< message.skippedPreprocessorRanges().size() << "skipped preprocessor ranges";
auto processor = ClangEditorDocumentProcessor::get(message.fileContainer().filePath());
......@@ -195,7 +195,7 @@ void BackendReceiver::documentAnnotationsChanged(const DocumentAnnotationsChange
processor->updateCodeWarnings(message.diagnostics(),
message.firstHeaderErrorDiagnostic(),
documentRevision);
processor->updateHighlighting(message.highlightingMarks(),
processor->updateHighlighting(message.tokenInfos(),
message.skippedPreprocessorRanges(),
documentRevision);
}
......
......@@ -30,7 +30,7 @@ SOURCES += \
clangfixitoperationsextractor.cpp \
clangfollowsymbol.cpp \
clangfunctionhintmodel.cpp \
clanghighlightingmarksreporter.cpp \
clangtokeninfosreporter.cpp \
clangmodelmanagersupport.cpp \
clangpreprocessorassistproposalitem.cpp \
clangprojectsettings.cpp \
......@@ -66,7 +66,6 @@ HEADERS += \
clangfixitoperationsextractor.h \
clangfollowsymbol.h \
clangfunctionhintmodel.h \
clanghighlightingmarksreporter.h \
clangisdiagnosticrelatedtolocation.h \
clangmodelmanagersupport.h \
clangpreprocessorassistproposalitem.h \
......@@ -75,7 +74,8 @@ HEADERS += \
clangrefactoringengine.h \
clangtextmark.h \
clanguiheaderondiskmanager.h \
clangutils.h
clangutils.h \
clangtokeninfosreporter.h
FORMS += clangprojectsettingswidget.ui
......
......@@ -80,8 +80,8 @@ QtcPlugin {
"clangfollowsymbol.h",
"clangfunctionhintmodel.cpp",
"clangfunctionhintmodel.h",
"clanghighlightingmarksreporter.cpp",
"clanghighlightingmarksreporter.h",
"clangtokeninfosreporter.cpp",
"clangtokeninfosreporter.h",
"clangisdiagnosticrelatedtolocation.h",
"clangmodelmanagersupport.cpp",
"clangmodelmanagersupport.h",
......
......@@ -7,7 +7,7 @@ SOURCES += \
$$PWD/clangcompletioncontextanalyzer.cpp \
$$PWD/clangdiagnosticfilter.cpp \
$$PWD/clangfixitoperation.cpp \
$$PWD/clanghighlightingmarksreporter.cpp
$$PWD/clangtokeninfosreporter.cpp
HEADERS += \
$$PWD/clangactivationsequencecontextprocessor.h \
......@@ -16,5 +16,5 @@ HEADERS += \
$$PWD/clangcompletioncontextanalyzer.h \
$$PWD/clangdiagnosticfilter.h \
$$PWD/clangfixitoperation.h \
$$PWD/clanghighlightingmarksreporter.h \
$$PWD/clangtokeninfosreporter.h \
$$PWD/clangisdiagnosticrelatedtolocation.h
......@@ -29,7 +29,7 @@
#include "clangdiagnostictooltipwidget.h"
#include "clangfixitoperation.h"
#include "clangfixitoperationsextractor.h"
#include "clanghighlightingmarksreporter.h"
#include "clangtokeninfosreporter.h"
#include "clangprojectsettings.h"
#include "clangutils.h"
......@@ -225,14 +225,14 @@ toTextEditorBlocks(QTextDocument *textDocument,
}
}
const QVector<ClangBackEnd::HighlightingMarkContainer>
&ClangEditorDocumentProcessor::highlightingMarks() const
const QVector<ClangBackEnd::TokenInfoContainer>
&ClangEditorDocumentProcessor::tokenInfos() const
{
return m_highlightingMarks;
return m_tokenInfos;
}
void ClangEditorDocumentProcessor::updateHighlighting(
const QVector<ClangBackEnd::HighlightingMarkContainer> &highlightingMarks,
const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos,
const QVector<ClangBackEnd::SourceRangeContainer> &skippedPreprocessorRanges,
uint documentRevision)
{
......@@ -240,10 +240,10 @@ void ClangEditorDocumentProcessor::updateHighlighting(
const auto skippedPreprocessorBlocks = toTextEditorBlocks(textDocument(), skippedPreprocessorRanges);
emit ifdefedOutBlocksUpdated(documentRevision, skippedPreprocessorBlocks);
m_highlightingMarks = highlightingMarks;
m_tokenInfos = tokenInfos;
m_semanticHighlighter.setHighlightingRunner(
[highlightingMarks]() {
auto *reporter = new HighlightingMarksReporter(highlightingMarks);
[tokenInfos]() {
auto *reporter = new TokenInfosReporter(tokenInfos);
return reporter->start();
});
m_semanticHighlighter.run();
......
......@@ -36,7 +36,7 @@
namespace ClangBackEnd {
class DiagnosticContainer;
class HighlightingMarkContainer;
class TokenInfoContainer;
class FileContainer;
}
......@@ -70,7 +70,7 @@ public:
void updateCodeWarnings(const QVector<ClangBackEnd::DiagnosticContainer> &diagnostics,
const ClangBackEnd::DiagnosticContainer &firstHeaderErrorDiagnostic,
uint documentRevision);
void updateHighlighting(const QVector<ClangBackEnd::HighlightingMarkContainer> &highlightingMarks,
void updateHighlighting(const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos,
const QVector<ClangBackEnd::SourceRangeContainer> &skippedPreprocessorRanges,
uint documentRevision);
......@@ -93,7 +93,7 @@ public:
void clearDiagnosticsWithFixIts();
const QVector<ClangBackEnd::HighlightingMarkContainer> &highlightingMarks() const;
const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos() const;
public:
static ClangEditorDocumentProcessor *get(const QString &filePath);
......@@ -123,7 +123,7 @@ private:
QTimer m_updateTranslationUnitTimer;
unsigned m_parserRevision;
QVector<ClangBackEnd::HighlightingMarkContainer> m_highlightingMarks;
QVector<ClangBackEnd::TokenInfoContainer> m_tokenInfos;
CppTools::SemanticHighlighter m_semanticHighlighter;
CppTools::BuiltinEditorDocumentProcessor m_builtinProcessor;
};
......
......@@ -28,7 +28,7 @@
#include <texteditor/texteditor.h>
#include <clangsupport/highlightingmarkcontainer.h>
#include <clangsupport/tokeninfocontainer.h>
#include <utils/textutils.h>
#include <utils/algorithm.h>
......@@ -37,13 +37,13 @@ namespace ClangCodeModel {
namespace Internal {
// Returns invalid Mark if it is not found at (line, column)
static bool findMark(const QVector<ClangBackEnd::HighlightingMarkContainer> &marks,
static bool findMark(const QVector<ClangBackEnd::TokenInfoContainer> &marks,
uint line,
uint column,
ClangBackEnd::HighlightingMarkContainer &mark)
ClangBackEnd::TokenInfoContainer &mark)
{
mark = Utils::findOrDefault(marks,
[line, column](const ClangBackEnd::HighlightingMarkContainer &curMark) {
[line, column](const ClangBackEnd::TokenInfoContainer &curMark) {
if (curMark.line() != line)
return false;
if (curMark.column() == column)
......@@ -57,7 +57,7 @@ static bool findMark(const QVector<ClangBackEnd::HighlightingMarkContainer> &mar
return true;
}
static int getMarkPos(QTextCursor cursor, const ClangBackEnd::HighlightingMarkContainer &mark)
static int getMarkPos(QTextCursor cursor, const ClangBackEnd::TokenInfoContainer &mark)
{
cursor.setPosition(0);
cursor.movePosition(QTextCursor::NextBlock, QTextCursor::MoveAnchor, mark.line() - 1);
......@@ -70,9 +70,9 @@ static Utils::Link linkAtCursor(QTextCursor cursor, const QString &filePath, uin
{
using Link = Utils::Link;
const QVector<ClangBackEnd::HighlightingMarkContainer> &marks
= processor->highlightingMarks();
ClangBackEnd::HighlightingMarkContainer mark;
const QVector<ClangBackEnd::TokenInfoContainer> &marks
= processor->tokenInfos();
ClangBackEnd::TokenInfoContainer mark;
if (!findMark(marks, line, column, mark))
return Link();
......
......@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "clanghighlightingmarksreporter.h"
#include "clangtokeninfosreporter.h"
#include <texteditor/textstyles.h>
#include <utils/qtcassert.h>
......@@ -97,13 +97,13 @@ TextEditor::TextStyles toTextStyles(ClangBackEnd::HighlightingTypes types)
}
TextEditor::HighlightingResult toHighlightingResult(
const ClangBackEnd::HighlightingMarkContainer &highlightingMark)
const ClangBackEnd::TokenInfoContainer &tokenInfo)
{
const auto textStyles = toTextStyles(highlightingMark.types());
const auto textStyles = toTextStyles(tokenInfo.types());
return TextEditor::HighlightingResult(highlightingMark.line(),
highlightingMark.column(),
highlightingMark.length(),
return TextEditor::HighlightingResult(tokenInfo.line(),
tokenInfo.column(),
tokenInfo.length(),
textStyles);
}
......@@ -111,14 +111,14 @@ TextEditor::HighlightingResult toHighlightingResult(
namespace ClangCodeModel {
HighlightingMarksReporter::HighlightingMarksReporter(
const QVector<ClangBackEnd::HighlightingMarkContainer> &highlightingMarks)
: m_highlightingMarks(highlightingMarks)
TokenInfosReporter::TokenInfosReporter(
const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos)
: m_tokenInfos(tokenInfos)
{
m_chunksToReport.reserve(m_chunkSize + 1);
}
void HighlightingMarksReporter::reportChunkWise(
void TokenInfosReporter::reportChunkWise(
const TextEditor::HighlightingResult &highlightingResult)
{
if (m_chunksToReport.size() >= m_chunkSize) {
......@@ -133,7 +133,7 @@ void HighlightingMarksReporter::reportChunkWise(
m_chunksToReport.append(highlightingResult);
}
void HighlightingMarksReporter::reportAndClearCurrentChunks()
void TokenInfosReporter::reportAndClearCurrentChunks()
{
m_flushRequested = false;
m_flushLine = 0;
......@@ -144,30 +144,30 @@ void HighlightingMarksReporter::reportAndClearCurrentChunks()
}
}
void HighlightingMarksReporter::setChunkSize(int chunkSize)
void TokenInfosReporter::setChunkSize(int chunkSize)
{
m_chunkSize = chunkSize;
}
void HighlightingMarksReporter::run()
void TokenInfosReporter::run()
{
run_internal();
reportFinished();
}
void HighlightingMarksReporter::run_internal()
void TokenInfosReporter::run_internal()
{
if (isCanceled())
return;
using ClangBackEnd::HighlightingType;
for (const auto &highlightingMark : m_highlightingMarks) {
const HighlightingType mainType = highlightingMark.types().mainHighlightingType;
for (const auto &tokenInfo : m_tokenInfos) {
const HighlightingType mainType = tokenInfo.types().mainHighlightingType;
if (mainType == HighlightingType::StringLiteral)
continue;
reportChunkWise(toHighlightingResult(highlightingMark));
reportChunkWise(toHighlightingResult(tokenInfo));
}
if (isCanceled())
......@@ -176,7 +176,7 @@ void HighlightingMarksReporter::run_internal()
reportAndClearCurrentChunks();
}
QFuture<TextEditor::HighlightingResult> HighlightingMarksReporter::start()
QFuture<TextEditor::HighlightingResult> TokenInfosReporter::start()
{
this->setRunnable(this);
this->reportStarted();
......
......@@ -32,11 +32,11 @@
#include <texteditor/semantichighlighter.h>
#include <clangsupport/highlightingmarkcontainer.h>
#include <clangsupport/tokeninfocontainer.h>
namespace ClangCodeModel {
class HighlightingMarksReporter:
class TokenInfosReporter:
public QObject,
public QRunnable,
public QFutureInterface<TextEditor::HighlightingResult>
......@@ -44,7 +44,7 @@ class HighlightingMarksReporter:
Q_OBJECT
public:
HighlightingMarksReporter(const QVector<ClangBackEnd::HighlightingMarkContainer> &highlightingMarks);
TokenInfosReporter(const QVector<ClangBackEnd::TokenInfoContainer> &tokenInfos);
void setChunkSize(int chunkSize);
......@@ -58,7 +58,7 @@ private:
void reportAndClearCurrentChunks();
private:
QVector<ClangBackEnd::HighlightingMarkContainer> m_highlightingMarks;
QVector<ClangBackEnd::TokenInfoContainer> m_tokenInfos;
QVector<TextEditor::HighlightingResult> m_chunksToReport;
int m_chunkSize = 100;
......
......@@ -48,14 +48,14 @@ HEADERS += \
$$PWD/diagnosticset.h \
$$PWD/diagnosticsetiterator.h \
$$PWD/fixit.h \
$$PWD/highlightingmark.h \
$$PWD/highlightingmarks.h \
$$PWD/highlightingmarksiterator.h \
$$PWD/projectpart.h \
$$PWD/projects.h \
$$PWD/skippedsourceranges.h \
$$PWD/sourcelocation.h \
$$PWD/sourcerange.h \
$$PWD/tokeninfo.h \
$$PWD/tokeninfos.h \
$$PWD/tokeninfositerator.h \
$$PWD/unsavedfile.h \
$$PWD/unsavedfiles.h \
$$PWD/utf8positionfromlinecolumn.h
......@@ -102,13 +102,13 @@ SOURCES += \
$$PWD/diagnostic.cpp \
$$PWD/diagnosticset.cpp \
$$PWD/fixit.cpp \
$$PWD/highlightingmark.cpp \
$$PWD/highlightingmarks.cpp \
$$PWD/projectpart.cpp \
$$PWD/projects.cpp \
$$PWD/skippedsourceranges.cpp \
$$PWD/sourcelocation.cpp \
$$PWD/sourcerange.cpp \
$$PWD/tokeninfo.cpp \
$$PWD/tokeninfos.cpp \
$$PWD/unsavedfile.cpp \
$$PWD/unsavedfiles.cpp \
$$PWD/utf8positionfromlinecolumn.cpp
......@@ -31,7 +31,7 @@
#include "clangtranslationunits.h"
#include "codecompleter.h"
#include "diagnosticset.h"
#include "highlightingmarks.h"
#include "tokeninfos.h"
#include "clangexceptions.h"
#include "skippedsourceranges.h"
......
......@@ -26,7 +26,7 @@
#include "clangdocuments.h"
#include <diagnosticset.h>
#include <highlightingmarks.h>
#include <tokeninfos.h>
#include <clangexceptions.h>
#include <projects.h>
#include <skippedsourceranges.h>
......
......@@ -47,7 +47,7 @@ IAsyncJob::AsyncPrepareResult RequestDocumentAnnotationsJob::prepareAsyncRun()
RequestDocumentAnnotationsJob::AsyncResult asyncResult;
translationUnit.extractDocumentAnnotations(asyncResult.firstHeaderErrorDiagnostic,
asyncResult.diagnostics,
asyncResult.highlightingMarks,
asyncResult.tokenInfos,
asyncResult.skippedSourceRanges);
return asyncResult;
});
......@@ -63,7 +63,7 @@ void RequestDocumentAnnotationsJob::finalizeAsyncRun()
DocumentAnnotationsChangedMessage(m_pinnedFileContainer,
result.diagnostics,
result.firstHeaderErrorDiagnostic,
result.highlightingMarks,
result.tokenInfos,
result.skippedSourceRanges));
}
}
......
......@@ -28,7 +28,7 @@
#include "clangdocumentjob.h"
#include <clangsupport/diagnosticcontainer.h>
#include <clangsupport/highlightingmarkcontainer.h>
#include <clangsupport/tokeninfocontainer.h>
#include <clangsupport/sourcerangecontainer.h>
namespace ClangBackEnd {
......@@ -37,7 +37,7 @@ struct RequestDocumentAnnotationsJobResult
{
ClangBackEnd::DiagnosticContainer firstHeaderErrorDiagnostic;
QVector<ClangBackEnd::DiagnosticContainer> diagnostics;
QVector<HighlightingMarkContainer> highlightingMarks;
QVector<TokenInfoContainer> tokenInfos;
QVector<SourceRangeContainer> skippedSourceRanges;
};
......
......@@ -35,8 +35,8 @@
#include <cursor.h>
#include <diagnosticcontainer.h>
#include <diagnosticset.h>
#include <highlightingmark.h>
#include <highlightingmarks.h>
#include <tokeninfo.h>
#include <tokeninfos.h>
#include <skippedsourceranges.h>
#include <sourcelocation.h>
#include <sourcerange.h>
......@@ -131,11 +131,11 @@ TranslationUnit::CodeCompletionResult TranslationUnit::complete(
void TranslationUnit::extractDocumentAnnotations(
DiagnosticContainer &firstHeaderErrorDiagnostic,
QVector<DiagnosticContainer> &mainFileDiagnostics,
QVector<HighlightingMarkContainer> &highlightingMarks,
QVector<TokenInfoContainer> &tokenInfos,
QVector<SourceRangeContainer> &skippedSourceRanges) const
{
extractDiagnostics(firstHeaderErrorDiagnostic, mainFileDiagnostics);
highlightingMarks = this->highlightingMarks().toHighlightingMarksContainers();
tokenInfos = this->tokenInfos().toTokenInfoContainers();
skippedSourceRanges = this->skippedSourceRanges().toSourceRangeContainers();
}
......@@ -187,19 +187,19 @@ Cursor TranslationUnit::cursor() const
return clang_getTranslationUnitCursor(m_cxTranslationUnit);
}
HighlightingMarks TranslationUnit::highlightingMarks() const
TokenInfos TranslationUnit::tokenInfos() const
{
return highlightingMarksInRange(cursor().sourceRange());
return tokenInfosInRange(cursor().sourceRange());
}
HighlightingMarks TranslationUnit::highlightingMarksInRange(const SourceRange &range) const
TokenInfos TranslationUnit::tokenInfosInRange(const SourceRange &range) const
{
CXToken *cxTokens = 0;
uint cxTokensCount = 0;
clang_tokenize(m_cxTranslationUnit, range, &cxTokens, &cxTokensCount);
return HighlightingMarks(m_cxTranslationUnit, cxTokens, cxTokensCount);
return TokenInfos(m_cxTranslationUnit, cxTokens, cxTokensCount);
}
SkippedSourceRanges TranslationUnit::skippedSourceRanges() const
......
......@@ -34,8 +34,8 @@ namespace ClangBackEnd {
class Cursor;
class DiagnosticContainer;
class DiagnosticSet;
class HighlightingMarkContainer;
class HighlightingMarks;
class TokenInfoContainer;
class TokenInfos;