Commit 14b27183 authored by Nikolai Kosjar's avatar Nikolai Kosjar

Clang: Rename TranslationUnit(s) to Document(s)

The "TranslationUnit parts" moved already to TranslationUnitCore.

Change-Id: I2bea7847e2b3e84fbfacc3d2dc43f180873349ac
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 6a2e1194
......@@ -10,7 +10,7 @@ HEADERS += $$PWD/clangcodemodelserver.h \
$$PWD/unsavedfile.h \
$$PWD/unsavedfiles.h \
$$PWD/projects.h \
$$PWD/translationunits.h \
$$PWD/clangdocuments.h \
$$PWD/translationunitparseerrorexception.h \
$$PWD/translationunitreparseerrorexception.h \
$$PWD/projectpart.h \
......@@ -29,7 +29,7 @@ HEADERS += $$PWD/clangcodemodelserver.h \
$$PWD/commandlinearguments.h \
$$PWD/cursor.h \
$$PWD/skippedsourceranges.h \
$$PWD/clangtranslationunit.h \
$$PWD/clangdocument.h \
$$PWD/clangtranslationunitupdater.h \
$$PWD/clangtype.h \
$$PWD/highlightingmark.h \
......@@ -60,7 +60,7 @@ SOURCES += $$PWD/clangcodemodelserver.cpp \
$$PWD/unsavedfile.cpp \
$$PWD/unsavedfiles.cpp \
$$PWD/projects.cpp \
$$PWD/translationunits.cpp \
$$PWD/clangdocuments.cpp \
$$PWD/translationunitparseerrorexception.cpp \
$$PWD/translationunitreparseerrorexception.cpp \
$$PWD/projectpart.cpp \
......@@ -78,7 +78,7 @@ SOURCES += $$PWD/clangcodemodelserver.cpp \
$$PWD/commandlinearguments.cpp \
$$PWD/cursor.cpp \
$$PWD/skippedsourceranges.cpp \
$$PWD/clangtranslationunit.cpp \
$$PWD/clangdocument.cpp \
$$PWD/clangtranslationunitupdater.cpp \
$$PWD/clangtype.cpp \
$$PWD/highlightingmark.cpp \
......
......@@ -29,8 +29,8 @@
#include "projectpart.h"
#include "projects.h"
#include "clangtranslationunit.h"
#include "translationunits.h"
#include "clangdocument.h"
#include "clangdocuments.h"
#include "unsavedfiles.h"
#include "clangjobs.h"
......@@ -59,7 +59,7 @@ public:
void requestDocumentAnnotations(const RequestDocumentAnnotationsMessage &message) override;
public /*for tests*/:
const TranslationUnits &translationUnitsForTestOnly() const;
const Documents &documentsForTestOnly() const;
const Jobs &jobsForTestOnly();
bool isTimerRunningForTestOnly() const;
void setUpdateDocumentAnnotationsTimeOutInMsForTestsOnly(int value);
......@@ -70,15 +70,14 @@ private:
void startDocumentAnnotationsTimerIfFileIsNotATranslationUnit(const Utf8String &filePath);
void addJobRequestsForDirtyAndVisibleDocuments();
void processJobsForDirtyAndVisibleDocuments();
void processInitialJobsForDocuments(const std::vector<TranslationUnit> &translationUnits);
void processInitialJobsForDocuments(const std::vector<Document> &documents);
JobRequest createJobRequest(const TranslationUnit &translationUnit,
JobRequest::Type type) const;
JobRequest createJobRequest(const Document &document, JobRequest::Type type) const;
private:
ProjectParts projects;
UnsavedFiles unsavedFiles;
TranslationUnits translationUnits;
Documents documents;
QScopedPointer<Jobs> jobs_;
QTimer updateDocumentAnnotationsTimer;
......
......@@ -61,9 +61,9 @@ bool CompleteCodeJob::prepareAsyncRun()
QTC_ASSERT(jobRequest.type == JobRequest::Type::CompleteCode, return false);
try {
m_pinnedTranslationUnit = context().translationUnitForJobRequest();
m_pinnedDocument = context().documentForJobRequest();
const TranslationUnitCore translationUnitCore = m_pinnedTranslationUnit.translationUnitCore();
const TranslationUnitCore translationUnitCore = m_pinnedDocument.translationUnitCore();
const UnsavedFiles unsavedFiles = *context().unsavedFiles;
const quint32 line = jobRequest.line;
const quint32 column = jobRequest.column;
......
......@@ -26,7 +26,7 @@
#pragma once
#include "clangasyncjob.h"
#include "clangtranslationunit.h"
#include "clangdocument.h"
#include <clangbackendipc/codecompletion.h>
......@@ -47,7 +47,7 @@ public:
void finalizeAsyncRun() override;
private:
TranslationUnit m_pinnedTranslationUnit;
Document m_pinnedDocument;
};
} // namespace ClangBackEnd
......@@ -49,11 +49,11 @@ bool CreateInitialDocumentPreambleJob::prepareAsyncRun()
QTC_ASSERT(jobRequest.type == JobRequest::Type::CreateInitialDocumentPreamble, return false);
try {
m_pinnedTranslationUnit = context().translationUnitForJobRequest();
m_pinnedFileContainer = m_pinnedTranslationUnit.fileContainer();
m_pinnedDocument = context().documentForJobRequest();
m_pinnedFileContainer = m_pinnedDocument.fileContainer();
const TranslationUnitCore translationUnitCore = m_pinnedTranslationUnit.translationUnitCore();
const TranslationUnitUpdateInput updateInput = m_pinnedTranslationUnit.createUpdateInput();
const TranslationUnitCore translationUnitCore = m_pinnedDocument.translationUnitCore();
const TranslationUnitUpdateInput updateInput = m_pinnedDocument.createUpdateInput();
setRunner([translationUnitCore, updateInput]() {
return runAsyncHelper(translationUnitCore, updateInput);
});
......
......@@ -26,7 +26,7 @@
#pragma once
#include "clangasyncjob.h"
#include "clangtranslationunit.h"
#include "clangdocument.h"
namespace ClangBackEnd {
......@@ -37,7 +37,7 @@ public:
void finalizeAsyncRun() override;
private:
TranslationUnit m_pinnedTranslationUnit;
Document m_pinnedDocument;
FileContainer m_pinnedFileContainer;
};
......
......@@ -44,15 +44,15 @@ class Utf8String;
namespace ClangBackEnd {
class TranslationUnitCore;
class TranslationUnitData;
class DocumentData;
class TranslationUnitUpdateResult;
class ProjectPart;
class FileContainer;
class TranslationUnits;
class Documents;
using time_point = std::chrono::steady_clock::time_point;
class TranslationUnit
class Document
{
public:
enum FileExistsCheck {
......@@ -60,19 +60,19 @@ public:
DoNotCheckIfFileExists
};
TranslationUnit() = default;
TranslationUnit(const Utf8String &filePath,
const ProjectPart &projectPart,
const Utf8StringVector &fileArguments,
TranslationUnits &translationUnits,
FileExistsCheck fileExistsCheck = CheckIfFileExists);
~TranslationUnit();
Document() = default;
Document(const Utf8String &filePath,
const ProjectPart &projectPart,
const Utf8StringVector &fileArguments,
Documents &documents,
FileExistsCheck fileExistsCheck = CheckIfFileExists);
~Document();
TranslationUnit(const TranslationUnit &cxTranslationUnit);
TranslationUnit &operator=(const TranslationUnit &cxTranslationUnit);
Document(const Document &cxTranslationUnit);
Document &operator=(const Document &cxTranslationUnit);
TranslationUnit(TranslationUnit &&cxTranslationUnit);
TranslationUnit &operator=(TranslationUnit &&cxTranslationUnit);
Document(Document &&cxTranslationUnit);
Document &operator=(Document &&cxTranslationUnit);
void reset();
......@@ -124,9 +124,9 @@ private:
bool isMainFileAndExistsOrIsOtherFile(const Utf8String &filePath) const;
private:
mutable std::shared_ptr<TranslationUnitData> d;
mutable std::shared_ptr<DocumentData> d;
};
bool operator==(const TranslationUnit &first, const TranslationUnit &second);
void PrintTo(const TranslationUnit &translationUnit, ::std::ostream *os);
bool operator==(const Document &first, const Document &second);
void PrintTo(const Document &document, ::std::ostream *os);
} // namespace ClangBackEnd
......@@ -25,8 +25,8 @@
#pragma once
#include "clangdocument.h"
#include "clangfilesystemwatcher.h"
#include "clangtranslationunit.h"
#include <filecontainer.h>
......@@ -39,54 +39,54 @@ namespace ClangBackEnd {
class ProjectParts;
class UnsavedFiles;
class TranslationUnits
class Documents
{
public:
TranslationUnits(ProjectParts &projectParts, UnsavedFiles &unsavedFiles);
Documents(ProjectParts &projectParts, UnsavedFiles &unsavedFiles);
std::vector<TranslationUnit> create(const QVector<FileContainer> &fileContainers);
std::vector<Document> create(const QVector<FileContainer> &fileContainers);
void update(const QVector<FileContainer> &fileContainers);
void remove(const QVector<FileContainer> &fileContainers);
void setUsedByCurrentEditor(const Utf8String &filePath);
void setVisibleInEditors(const Utf8StringVector &filePaths);
const TranslationUnit &translationUnit(const Utf8String &filePath, const Utf8String &projectPartId) const;
const TranslationUnit &translationUnit(const FileContainer &fileContainer) const;
bool hasTranslationUnit(const Utf8String &filePath, const Utf8String &projectPartId) const;
bool hasTranslationUnitWithFilePath(const Utf8String &filePath) const;
const Document &document(const Utf8String &filePath, const Utf8String &projectPartId) const;
const Document &document(const FileContainer &fileContainer) const;
bool hasDocument(const Utf8String &filePath, const Utf8String &projectPartId) const;
bool hasDocumentWithFilePath(const Utf8String &filePath) const;
const std::vector<TranslationUnit> &translationUnits() const;
const std::vector<Document> &documents() const;
UnsavedFiles unsavedFiles() const;
void addWatchedFiles(QSet<Utf8String> &filePaths);
void updateTranslationUnitsWithChangedDependency(const Utf8String &filePath);
void updateTranslationUnitsWithChangedDependencies(const QVector<FileContainer> &fileContainers);
void setTranslationUnitsDirtyIfProjectPartChanged();
void updateDocumentsWithChangedDependency(const Utf8String &filePath);
void updateDocumentsWithChangedDependencies(const QVector<FileContainer> &fileContainers);
void setDocumentsDirtyIfProjectPartChanged();
QVector<FileContainer> newerFileContainers(const QVector<FileContainer> &fileContainers) const;
const ClangFileSystemWatcher *clangFileSystemWatcher() const;
private:
TranslationUnit createTranslationUnit(const FileContainer &fileContainer);
void updateTranslationUnit(const FileContainer &fileContainer);
std::vector<TranslationUnit>::iterator findTranslationUnit(const FileContainer &fileContainer);
std::vector<TranslationUnit> findAllTranslationUnitWithFilePath(const Utf8String &filePath);
std::vector<TranslationUnit>::const_iterator findTranslationUnit(const Utf8String &filePath, const Utf8String &projectPartId) const;
bool hasTranslationUnit(const FileContainer &fileContainer) const;
Document createDocument(const FileContainer &fileContainer);
void updateDocument(const FileContainer &fileContainer);
std::vector<Document>::iterator findDocument(const FileContainer &fileContainer);
std::vector<Document> findAllDocumentsWithFilePath(const Utf8String &filePath);
std::vector<Document>::const_iterator findDocument(const Utf8String &filePath, const Utf8String &projectPartId) const;
bool hasDocument(const FileContainer &fileContainer) const;
void checkIfProjectPartExists(const Utf8String &projectFileName) const;
void checkIfProjectPartsExists(const QVector<FileContainer> &fileContainers) const;
void checkIfTranslationUnitsDoesNotExists(const QVector<FileContainer> &fileContainers) const;
void checkIfTranslationUnitsForFilePathsDoesExists(const QVector<FileContainer> &fileContainers) const;
void checkIfDocumentsDoNotExist(const QVector<FileContainer> &fileContainers) const;
void checkIfDocumentsForFilePathsExist(const QVector<FileContainer> &fileContainers) const;
void removeTranslationUnits(const QVector<FileContainer> &fileContainers);
void removeDocuments(const QVector<FileContainer> &fileContainers);
private:
ClangFileSystemWatcher fileSystemWatcher;
std::vector<TranslationUnit> translationUnits_;
std::vector<Document> documents_;
ProjectParts &projectParts;
UnsavedFiles &unsavedFiles_;
};
......
......@@ -25,7 +25,7 @@
#include "clangfilesystemwatcher.h"
#include "translationunits.h"
#include "clangdocuments.h"
#include <utf8stringvector.h>
......@@ -64,8 +64,8 @@ QStringList filterExistingFiles(QStringList &&filePaths)
}
}
ClangFileSystemWatcher::ClangFileSystemWatcher(TranslationUnits &translationUnits)
: translationUnits(translationUnits)
ClangFileSystemWatcher::ClangFileSystemWatcher(Documents &documents)
: documents(documents)
{
connect(&watcher,
&QFileSystemWatcher::fileChanged,
......@@ -83,7 +83,7 @@ void ClangFileSystemWatcher::addFiles(const QSet<Utf8String> &filePaths)
void ClangFileSystemWatcher::updateTranslationUnitsWithChangedDependencies(const QString &filePath)
{
translationUnits.updateTranslationUnitsWithChangedDependency(filePath);
documents.updateDocumentsWithChangedDependency(filePath);
emit fileChanged(filePath);
}
......
......@@ -32,14 +32,14 @@ class Utf8String;
namespace ClangBackEnd {
class TranslationUnits;
class Documents;
class ClangFileSystemWatcher : public QObject
{
Q_OBJECT
public:
ClangFileSystemWatcher(TranslationUnits &translationUnits);
ClangFileSystemWatcher(Documents &documents);
void addFiles(const QSet<Utf8String> &filePaths);
......@@ -51,7 +51,7 @@ private:
private:
QFileSystemWatcher watcher;
TranslationUnits &translationUnits;
Documents &documents;
};
} // namespace ClangBackEnd
......@@ -25,24 +25,24 @@
#include "clangiasyncjob.h"
#include "translationunits.h"
#include "clangdocuments.h"
namespace ClangBackEnd {
JobContext::JobContext(const JobRequest &jobRequest,
TranslationUnits *translationUnits,
Documents *documents,
UnsavedFiles *unsavedFiles,
ClangCodeModelClientInterface *clientInterface)
: jobRequest(jobRequest)
, translationUnits(translationUnits)
, documents(documents)
, unsavedFiles(unsavedFiles)
, client(clientInterface)
{
}
TranslationUnit JobContext::translationUnitForJobRequest() const
Document JobContext::documentForJobRequest() const
{
return translationUnits->translationUnit(jobRequest.filePath, jobRequest.projectPartId);
return documents->document(jobRequest.filePath, jobRequest.projectPartId);
}
bool JobContext::isOutdated() const
......@@ -53,7 +53,7 @@ bool JobContext::isOutdated() const
bool JobContext::isDocumentOpen() const
{
const bool hasTranslationUnit
= translationUnits->hasTranslationUnit(jobRequest.filePath, jobRequest.projectPartId);
= documents->hasDocument(jobRequest.filePath, jobRequest.projectPartId);
if (!hasTranslationUnit)
qCDebug(jobsLog) << "Document already closed for results of" << jobRequest;
......@@ -63,9 +63,8 @@ bool JobContext::isDocumentOpen() const
bool JobContext::documentRevisionChanged() const
{
const TranslationUnit &translationUnit
= translationUnits->translationUnit(jobRequest.filePath, jobRequest.projectPartId);
const bool revisionChanged = translationUnit.documentRevision() != jobRequest.documentRevision;
const Document &document = documents->document(jobRequest.filePath, jobRequest.projectPartId);
const bool revisionChanged = document.documentRevision() != jobRequest.documentRevision;
if (revisionChanged)
qCDebug(jobsLog) << "Document revision changed for results of" << jobRequest;
......
......@@ -30,8 +30,8 @@
namespace ClangBackEnd {
class ClangCodeModelClientInterface;
class TranslationUnit;
class TranslationUnits;
class Document;
class Documents;
class UnsavedFiles;
class JobContext
......@@ -39,11 +39,11 @@ class JobContext
public:
JobContext() = default;
JobContext(const JobRequest &jobRequest,
TranslationUnits *translationUnits,
Documents *documents,
UnsavedFiles *unsavedFiles,
ClangCodeModelClientInterface *client);
TranslationUnit translationUnitForJobRequest() const;
Document documentForJobRequest() const;
bool isOutdated() const;
bool isDocumentOpen() const;
......@@ -51,7 +51,7 @@ public:
public:
JobRequest jobRequest;
TranslationUnits *translationUnits = nullptr;
Documents *documents = nullptr;
UnsavedFiles *unsavedFiles = nullptr;
ClangCodeModelClientInterface *client = nullptr;
};
......
......@@ -25,8 +25,8 @@
#include "clangiasyncjob.h"
#include "clangjobqueue.h"
#include "clangtranslationunit.h"
#include "translationunits.h"
#include "clangdocument.h"
#include "clangdocuments.h"
#include "projects.h"
#include "unsavedfiles.h"
......@@ -34,8 +34,8 @@
namespace ClangBackEnd {
JobQueue::JobQueue(TranslationUnits &translationUnits, ProjectParts &projectParts)
: m_translationUnits(translationUnits)
JobQueue::JobQueue(Documents &documents, ProjectParts &projectParts)
: m_documents(documents)
, m_projectParts(projectParts)
{
}
......@@ -81,7 +81,7 @@ void JobQueue::removeOutDatedRequests()
bool JobQueue::isJobRequestOutDated(const JobRequest &jobRequest) const
{
const JobRequest::Requirements requirements = jobRequest.requirements;
const UnsavedFiles unsavedFiles = m_translationUnits.unsavedFiles();
const UnsavedFiles unsavedFiles = m_documents.unsavedFiles();
if (requirements.testFlag(JobRequest::CurrentUnsavedFiles)) {
if (jobRequest.unsavedFilesChangeTimePoint != unsavedFiles.lastChangeTimePoint()) {
......@@ -93,7 +93,7 @@ bool JobQueue::isJobRequestOutDated(const JobRequest &jobRequest) const
bool projectCheckedAndItExists = false;
if (requirements.testFlag(JobRequest::DocumentValid)) {
if (!m_translationUnits.hasTranslationUnit(jobRequest.filePath, jobRequest.projectPartId)) {
if (!m_documents.hasDocument(jobRequest.filePath, jobRequest.projectPartId)) {
qCDebug(jobsLog) << "Removing due to already closed document:" << jobRequest;
return true;
}
......@@ -104,15 +104,15 @@ bool JobQueue::isJobRequestOutDated(const JobRequest &jobRequest) const
}
projectCheckedAndItExists = true;
const TranslationUnit translationUnit
= m_translationUnits.translationUnit(jobRequest.filePath, jobRequest.projectPartId);
if (!translationUnit.isIntact()) {
const Document document
= m_documents.document(jobRequest.filePath, jobRequest.projectPartId);
if (!document.isIntact()) {
qCDebug(jobsLog) << "Removing due to not intact translation unit:" << jobRequest;
return true;
}
if (requirements.testFlag(JobRequest::CurrentDocumentRevision)) {
if (translationUnit.documentRevision() != jobRequest.documentRevision) {
if (document.documentRevision() != jobRequest.documentRevision) {
qCDebug(jobsLog) << "Removing due to changed document revision:" << jobRequest;
return true;
}
......@@ -135,14 +135,14 @@ bool JobQueue::isJobRequestOutDated(const JobRequest &jobRequest) const
return false;
}
static int priority(const TranslationUnit &translationUnit)
static int priority(const Document &document)
{
int thePriority = 0;
if (translationUnit.isUsedByCurrentEditor())
if (document.isUsedByCurrentEditor())
thePriority += 1000;
if (translationUnit.isVisibleInEditor())
if (document.isVisibleInEditor())
thePriority += 100;
return thePriority;
......@@ -152,8 +152,8 @@ void JobQueue::prioritizeRequests()
{
const auto lessThan = [this] (const JobRequest &r1, const JobRequest &r2) {
// TODO: Getting the TU is O(n) currently, so this might become expensive for large n.
const TranslationUnit &t1 = m_translationUnits.translationUnit(r1.filePath, r1.projectPartId);
const TranslationUnit &t2 = m_translationUnits.translationUnit(r2.filePath, r2.projectPartId);
const Document &t1 = m_documents.document(r1.filePath, r1.projectPartId);
const Document &t2 = m_documents.document(r2.filePath, r2.projectPartId);
return priority(t1) > priority(t2);
};
......@@ -171,12 +171,12 @@ JobRequests JobQueue::takeJobRequestsToRunNow()
const JobRequest &jobRequest = i.next();
try {
const TranslationUnit &translationUnit
= m_translationUnits.translationUnit(jobRequest.filePath,
const Document &document
= m_documents.document(jobRequest.filePath,
jobRequest.projectPartId);
const DocumentId documentId = DocumentId(jobRequest.filePath, jobRequest.projectPartId);
if (!translationUnit.isUsedByCurrentEditor() && !translationUnit.isVisibleInEditor())
if (!document.isUsedByCurrentEditor() && !document.isVisibleInEditor())
continue;
if (documentsScheduledForThisRun.contains(documentId))
......
......@@ -32,12 +32,12 @@
namespace ClangBackEnd {
class ProjectParts;
class TranslationUnits;
class Documents;
class JobQueue
{
public:
JobQueue(TranslationUnits &translationUnits, ProjectParts &projects);
JobQueue(Documents &documents, ProjectParts &projects);
void add(const JobRequest &job);
......@@ -59,7 +59,7 @@ private:
bool isJobRequestOutDated(const JobRequest &jobRequest) const;
private:
TranslationUnits &m_translationUnits;
Documents &m_documents;
ProjectParts &m_projectParts;
IsJobRunningHandler m_isJobRunningHandler;
......
......@@ -36,15 +36,15 @@
namespace ClangBackEnd {
Jobs::Jobs(TranslationUnits &translationUnits,
Jobs::Jobs(Documents &documents,
UnsavedFiles &unsavedFiles,
ProjectParts &projectParts,
ClangCodeModelClientInterface &client)
: m_translationUnits(translationUnits)
: m_documents(documents)
, m_unsavedFiles(unsavedFiles)
, m_projectParts(projectParts)
, m_client(client)
, m_queue(translationUnits, projectParts)
, m_queue(documents, projectParts)
{
m_queue.setIsJobRunningHandler([this](const Utf8String &filePath,
const Utf8String &projectPartId) {
......@@ -89,7 +89,7 @@ JobRequests Jobs::runJobs(const JobRequests &jobsRequests)
bool Jobs::runJob(const JobRequest &jobRequest)
{
if (IAsyncJob *asyncJob = IAsyncJob::create(jobRequest.type)) {
JobContext context(jobRequest, &m_translationUnits, &m_unsavedFiles, &m_client);
JobContext context(jobRequest, &m_documents, &m_unsavedFiles, &m_client);
asyncJob->setContext(context);
if (asyncJob->prepareAsyncRun()) {
......
......@@ -34,9 +34,9 @@
namespace ClangBackEnd {
class ClangCodeModelClientInterface;
class Documents;
class IAsyncJob;
class ProjectParts;
class TranslationUnits;
class UnsavedFiles;
class Jobs
......@@ -49,7 +49,7 @@ public:
using RunningJobs = QHash<IAsyncJob *, RunningJob>;
public:
Jobs(TranslationUnits &translationUnits,
Jobs(Documents &documents,
UnsavedFiles &unsavedFiles,
ProjectParts &projects,
ClangCodeModelClientInterface &client);
......@@ -70,7 +70,7 @@ private:
void onJobFinished(IAsyncJob *asyncJob);
private:
TranslationUnits &m_translationUnits;
Documents &m_documents;
UnsavedFiles &m_unsavedFiles;
ProjectParts &m_projectParts;
ClangCodeModelClientInterface &m_client;
......
......@@ -57,10 +57,10 @@ bool RequestDocumentAnnotationsJob::prepareAsyncRun()
QTC_ASSERT(jobRequest.type == JobRequest::Type::RequestDocumentAnnotations, return false);
try {
m_pinnedTranslationUnit = context().translationUnitForJobRequest();
m_pinnedFileContainer = m_pinnedTranslationUnit.fileContainer();
m_pinnedDocument = context().documentForJobRequest();
m_pinnedFileContainer = m_pinnedDocument.fileContainer();
const TranslationUnitCore translationUnitCore = m_pinnedTranslationUnit.translationUnitCore();
const TranslationUnitCore translationUnitCore = m_pinnedDocument.translationUnitCore();
setRunner([translationUnitCore]() {
return runAsyncHelper(translationUnitCore);
});
......
......@@ -26,7 +26,7 @@
#pragma once
#include "clangasyncjob.h"
#include "clangtranslationunit.h"
#include "clangdocument.h"
#include <clangbackendipc/diagnosticcontainer.h>
#include <clangbackendipc/highlightingmarkcontainer.h>
......@@ -53,7 +53,7 @@ private:
void sendAnnotations(const AsyncResult &result);
private:
TranslationUnit m_pinnedTranslationUnit;
Document m_pinnedDocument;
FileContainer m_pinnedFileContainer;
};
......
......@@ -63,11 +63,11 @@ bool UpdateDocumentAnnotationsJob::prepareAsyncRun()
QTC_ASSERT(jobRequest.type == JobRequest::Type::UpdateDocumentAnnotations, return false);
try {
m_pinnedTranslationUnit = context().translationUnitForJobRequest();
m_pinnedFileContainer = m_pinnedTranslationUnit.fileContainer();
m_pinnedDocument = context().documentForJobRequest();
m_pinnedFileContainer = m_pinnedDocument.fileContainer();
const TranslationUnitCore translationUnitCore = m_pinnedTranslationUnit.translationUnitCore();
const TranslationUnitUpdateInput updateInput = m_pinnedTranslationUnit.createUpdateInput();
const TranslationUnitCore translationUnitCore = m_pinnedDocument.translationUnitCore();
const TranslationUnitUpdateInput updateInput = m_pinnedDocument.createUpdateInput();
setRunner([translationUnitCore, updateInput]() {
return runAsyncHelper(translationUnitCore, updateInput);