summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri1
-rw-r--r--src/tools/clangbackend/ipcsource/clangcompletecodejob.h8
-rw-r--r--src/tools/clangbackend/ipcsource/clangcreateinitialdocumentpreamblejob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangdocumentjob.h43
-rw-r--r--src/tools/clangbackend/ipcsource/clangfollowsymboljob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangparsesupportivetranslationunitjob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangreparsesupportivetranslationunitjob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangrequestdocumentannotationsjob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangrequestreferencesjob.h11
-rw-r--r--src/tools/clangbackend/ipcsource/clangsuspenddocumentjob.h9
-rw-r--r--src/tools/clangbackend/ipcsource/clangupdatedocumentannotationsjob.h12
11 files changed, 62 insertions, 67 deletions
diff --git a/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri b/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri
index c12ba23254..6919db6839 100644
--- a/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri
+++ b/src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri
@@ -9,6 +9,7 @@ HEADERS += \
$$PWD/clangcompletecodejob.h \
$$PWD/clangcreateinitialdocumentpreamblejob.h \
$$PWD/clangdocument.h \
+ $$PWD/clangdocumentjob.h \
$$PWD/clangdocumentprocessor.h \
$$PWD/clangdocumentprocessors.h \
$$PWD/clangdocuments.h \
diff --git a/src/tools/clangbackend/ipcsource/clangcompletecodejob.h b/src/tools/clangbackend/ipcsource/clangcompletecodejob.h
index 54b0ae5ec3..4e9c274faf 100644
--- a/src/tools/clangbackend/ipcsource/clangcompletecodejob.h
+++ b/src/tools/clangbackend/ipcsource/clangcompletecodejob.h
@@ -25,8 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
#include <clangsupport/codecompletion.h>
@@ -38,16 +37,13 @@ struct CompleteCodeJobResult
CompletionCorrection correction = CompletionCorrection::NoCorrection;
};
-class CompleteCodeJob : public AsyncJob<CompleteCodeJobResult>
+class CompleteCodeJob : public DocumentJob<CompleteCodeJobResult>
{
public:
using AsyncResult = CompleteCodeJobResult;
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangcreateinitialdocumentpreamblejob.h b/src/tools/clangbackend/ipcsource/clangcreateinitialdocumentpreamblejob.h
index 570b746460..f8b790ea36 100644
--- a/src/tools/clangbackend/ipcsource/clangcreateinitialdocumentpreamblejob.h
+++ b/src/tools/clangbackend/ipcsource/clangcreateinitialdocumentpreamblejob.h
@@ -25,20 +25,15 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
namespace ClangBackEnd {
-class CreateInitialDocumentPreambleJob : public AsyncJob<void>
+class CreateInitialDocumentPreambleJob : public DocumentJob<void>
{
public:
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangdocumentjob.h b/src/tools/clangbackend/ipcsource/clangdocumentjob.h
new file mode 100644
index 0000000000..caa2eb6f0f
--- /dev/null
+++ b/src/tools/clangbackend/ipcsource/clangdocumentjob.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** 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.
+**
+****************************************************************************/
+
+#pragma once
+
+#include "clangasyncjob.h"
+#include "clangdocument.h"
+
+#include <clangsupport/filecontainer.h>
+
+namespace ClangBackEnd {
+
+template<class Result>
+class DocumentJob : public AsyncJob<Result>
+{
+protected:
+ Document m_pinnedDocument;
+ FileContainer m_pinnedFileContainer;
+};
+
+} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangfollowsymboljob.h b/src/tools/clangbackend/ipcsource/clangfollowsymboljob.h
index ce2ca4e06c..7c8391fb9b 100644
--- a/src/tools/clangbackend/ipcsource/clangfollowsymboljob.h
+++ b/src/tools/clangbackend/ipcsource/clangfollowsymboljob.h
@@ -25,8 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
#include <clangsupport/sourcerangecontainer.h>
@@ -51,16 +50,12 @@ public:
bool failedToFollow = false;
};
-class FollowSymbolJob : public AsyncJob<FollowSymbolResult>
+class FollowSymbolJob : public DocumentJob<FollowSymbolResult>
{
public:
using AsyncResult = FollowSymbolResult;
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangparsesupportivetranslationunitjob.h b/src/tools/clangbackend/ipcsource/clangparsesupportivetranslationunitjob.h
index 6d4d01131e..b733dc72b7 100644
--- a/src/tools/clangbackend/ipcsource/clangparsesupportivetranslationunitjob.h
+++ b/src/tools/clangbackend/ipcsource/clangparsesupportivetranslationunitjob.h
@@ -25,8 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
namespace ClangBackEnd {
@@ -35,17 +34,13 @@ struct ParseSupportiveTranslationUnitJobResult
TranslationUnitUpdateResult updateResult;
};
-class ParseSupportiveTranslationUnitJob : public AsyncJob<ParseSupportiveTranslationUnitJobResult>
+class ParseSupportiveTranslationUnitJob : public DocumentJob<ParseSupportiveTranslationUnitJobResult>
{
public:
using AsyncResult = ParseSupportiveTranslationUnitJobResult;
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangreparsesupportivetranslationunitjob.h b/src/tools/clangbackend/ipcsource/clangreparsesupportivetranslationunitjob.h
index 1b352c2c36..cb146299c7 100644
--- a/src/tools/clangbackend/ipcsource/clangreparsesupportivetranslationunitjob.h
+++ b/src/tools/clangbackend/ipcsource/clangreparsesupportivetranslationunitjob.h
@@ -25,8 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
namespace ClangBackEnd {
@@ -35,17 +34,13 @@ struct ReparseSupportiveTranslationUnitJobResult
TranslationUnitUpdateResult updateResult;
};
-class ReparseSupportiveTranslationUnitJob : public AsyncJob<ReparseSupportiveTranslationUnitJobResult>
+class ReparseSupportiveTranslationUnitJob : public DocumentJob<ReparseSupportiveTranslationUnitJobResult>
{
public:
using AsyncResult = ReparseSupportiveTranslationUnitJobResult;
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangrequestdocumentannotationsjob.h b/src/tools/clangbackend/ipcsource/clangrequestdocumentannotationsjob.h
index dcbe42b6e4..d3d88a03df 100644
--- a/src/tools/clangbackend/ipcsource/clangrequestdocumentannotationsjob.h
+++ b/src/tools/clangbackend/ipcsource/clangrequestdocumentannotationsjob.h
@@ -25,8 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
#include <clangsupport/diagnosticcontainer.h>
#include <clangsupport/highlightingmarkcontainer.h>
@@ -42,7 +41,7 @@ struct RequestDocumentAnnotationsJobResult
QVector<SourceRangeContainer> skippedSourceRanges;
};
-class RequestDocumentAnnotationsJob : public AsyncJob<RequestDocumentAnnotationsJobResult>
+class RequestDocumentAnnotationsJob : public DocumentJob<RequestDocumentAnnotationsJobResult>
{
public:
using AsyncResult = RequestDocumentAnnotationsJobResult;
@@ -52,10 +51,6 @@ public:
private:
void sendAnnotations(const AsyncResult &result);
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangrequestreferencesjob.h b/src/tools/clangbackend/ipcsource/clangrequestreferencesjob.h
index 13a904bddc..d92d869a9b 100644
--- a/src/tools/clangbackend/ipcsource/clangrequestreferencesjob.h
+++ b/src/tools/clangbackend/ipcsource/clangrequestreferencesjob.h
@@ -25,25 +25,18 @@
#pragma once
-#include "clangasyncjob.h"
+#include "clangdocumentjob.h"
#include "clangreferencescollector.h"
-#include "clangdocument.h"
-
-#include <clangsupport/sourcerangecontainer.h>
namespace ClangBackEnd {
-class RequestReferencesJob : public AsyncJob<ReferencesResult>
+class RequestReferencesJob : public DocumentJob<ReferencesResult>
{
public:
using AsyncResult = ReferencesResult;
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangsuspenddocumentjob.h b/src/tools/clangbackend/ipcsource/clangsuspenddocumentjob.h
index 16d5b52a1e..5948f8226f 100644
--- a/src/tools/clangbackend/ipcsource/clangsuspenddocumentjob.h
+++ b/src/tools/clangbackend/ipcsource/clangsuspenddocumentjob.h
@@ -25,20 +25,15 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
+#include "clangdocumentjob.h"
namespace ClangBackEnd {
-class SuspendDocumentJob : public AsyncJob<bool>
+class SuspendDocumentJob : public DocumentJob<bool>
{
public:
AsyncPrepareResult prepareAsyncRun() override;
void finalizeAsyncRun() override;
-
-private:
- Document m_pinnedDocument;
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd
diff --git a/src/tools/clangbackend/ipcsource/clangupdatedocumentannotationsjob.h b/src/tools/clangbackend/ipcsource/clangupdatedocumentannotationsjob.h
index a49e9b45b5..b7f56318f0 100644
--- a/src/tools/clangbackend/ipcsource/clangupdatedocumentannotationsjob.h
+++ b/src/tools/clangbackend/ipcsource/clangupdatedocumentannotationsjob.h
@@ -25,9 +25,7 @@
#pragma once
-#include "clangasyncjob.h"
-#include "clangdocument.h"
-#include "clangtranslationunitupdater.h"
+#include "clangdocumentjob.h"
#include <clangsupport/diagnosticcontainer.h>
#include <clangsupport/highlightingmarkcontainer.h>
@@ -45,7 +43,7 @@ struct UpdateDocumentAnnotationsJobResult
QVector<SourceRangeContainer> skippedSourceRanges;
};
-class UpdateDocumentAnnotationsJob : public AsyncJob<UpdateDocumentAnnotationsJobResult>
+class UpdateDocumentAnnotationsJob : public DocumentJob<UpdateDocumentAnnotationsJobResult>
{
public:
using AsyncResult = UpdateDocumentAnnotationsJobResult;
@@ -60,12 +58,6 @@ protected:
private:
void incorporateUpdaterResult(const AsyncResult &result);
void sendAnnotations(const AsyncResult &result);
-
-protected:
- Document m_pinnedDocument;
-
-private:
- FileContainer m_pinnedFileContainer;
};
} // namespace ClangBackEnd