Clang: Introduce headers for client/server messages

This reduces the overhead when a new message needs to be added.

Change-Id: I5bb2833af2f06f2a8e101cfb03f75ffc2927bf68
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Nikolai Kosjar
2017-06-15 16:43:37 +02:00
parent 1e76485402
commit b869f02f72
20 changed files with 111 additions and 191 deletions

View File

@@ -155,6 +155,8 @@ HEADERS += \
$$PWD/pchmanagerclientproxy.h \ $$PWD/pchmanagerclientproxy.h \
$$PWD/projectpartpch.h \ $$PWD/projectpartpch.h \
$$PWD/precompiledheadersupdatedmessage.h \ $$PWD/precompiledheadersupdatedmessage.h \
$$PWD/removepchprojectpartsmessage.h $$PWD/removepchprojectpartsmessage.h \
$$PWD/clangcodemodelclientmessages.h \
$$PWD/clangcodemodelservermessages.h \
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols

View File

@@ -24,14 +24,8 @@
****************************************************************************/ ****************************************************************************/
#include "clangcodemodelclientinterface.h" #include "clangcodemodelclientinterface.h"
#include "clangcodemodelclientmessages.h"
#include "cmbcodecompletedmessage.h"
#include "cmbechomessage.h"
#include "documentannotationschangedmessage.h"
#include "referencesmessage.h"
#include "messageenvelop.h" #include "messageenvelop.h"
#include "projectpartsdonotexistmessage.h"
#include "translationunitdoesnotexistmessage.h"
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>

View File

@@ -30,23 +30,24 @@
namespace ClangBackEnd { namespace ClangBackEnd {
class ClangCodeModelServerInterface; class ClangCodeModelServerInterface;
class RegisterTranslationUnitForEditorMessage;
class UpdateTranslationUnitsForEditorMessage;
class RegisterProjectPartsForEditorMessage;
class UnregisterTranslationUnitsForEditorMessage;
class UnregisterProjectPartsForEditorMessage;
class EchoMessage;
class CompleteCodeMessage;
class CodeCompletedMessage; class CodeCompletedMessage;
class TranslationUnitDoesNotExistMessage; class CompleteCodeMessage;
class DocumentAnnotationsChangedMessage;
class EchoMessage;
class ProjectPartsDoNotExistMessage; class ProjectPartsDoNotExistMessage;
class ReferencesMessage;
class RegisterProjectPartsForEditorMessage;
class RegisterTranslationUnitForEditorMessage;
class RegisterUnsavedFilesForEditorMessage; class RegisterUnsavedFilesForEditorMessage;
class UnregisterUnsavedFilesForEditorMessage;
class UpdateVisibleTranslationUnitsMessage;
class RequestDocumentAnnotationsMessage; class RequestDocumentAnnotationsMessage;
class RequestReferencesMessage; class RequestReferencesMessage;
class ReferencesMessage; class TranslationUnitDoesNotExistMessage;
class DocumentAnnotationsChangedMessage; class UnregisterProjectPartsForEditorMessage;
class UnregisterTranslationUnitsForEditorMessage;
class UnregisterUnsavedFilesForEditorMessage;
class UpdateTranslationUnitsForEditorMessage;
class UpdateVisibleTranslationUnitsMessage;
class CMBIPC_EXPORT ClangCodeModelClientInterface : public IpcClientInterface class CMBIPC_EXPORT ClangCodeModelClientInterface : public IpcClientInterface
{ {

View File

@@ -0,0 +1,34 @@
/****************************************************************************
**
** Copyright (C) 2016 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 "cmbalivemessage.h"
#include "cmbcodecompletedmessage.h"
#include "cmbechomessage.h"
#include "documentannotationschangedmessage.h"
#include "projectpartsdonotexistmessage.h"
#include "referencesmessage.h"
#include "translationunitdoesnotexistmessage.h"

View File

@@ -25,17 +25,10 @@
#include "clangcodemodelclientproxy.h" #include "clangcodemodelclientproxy.h"
#include "cmbalivemessage.h" #include "clangcodemodelclientmessages.h"
#include "cmbcodecompletedmessage.h"
#include "cmbechomessage.h"
#include "cmbregistertranslationunitsforeditormessage.h"
#include "documentannotationschangedmessage.h"
#include "referencesmessage.h"
#include "clangcodemodelserverinterface.h" #include "clangcodemodelserverinterface.h"
#include "ipcserverinterface.h" #include "ipcserverinterface.h"
#include "messageenvelop.h" #include "messageenvelop.h"
#include "projectpartsdonotexistmessage.h"
#include "translationunitdoesnotexistmessage.h"
#include <QDebug> #include <QDebug>
#include <QIODevice> #include <QIODevice>

View File

@@ -24,19 +24,8 @@
****************************************************************************/ ****************************************************************************/
#include "clangcodemodelserverinterface.h" #include "clangcodemodelserverinterface.h"
#include "clangcodemodelservermessages.h"
#include "cmbcompletecodemessage.h"
#include "cmbregisterprojectsforeditormessage.h"
#include "cmbregistertranslationunitsforeditormessage.h"
#include "cmbunregisterprojectsforeditormessage.h"
#include "cmbunregistertranslationunitsforeditormessage.h"
#include "messageenvelop.h" #include "messageenvelop.h"
#include "registerunsavedfilesforeditormessage.h"
#include "requestdocumentannotations.h"
#include "requestreferencesmessage.h"
#include "unregisterunsavedfilesforeditormessage.h"
#include "updatetranslationunitsforeditormessage.h"
#include "updatevisibletranslationunitsmessage.h"
#include <QDebug> #include <QDebug>
#include <QVariant> #include <QVariant>

View File

@@ -0,0 +1,40 @@
/****************************************************************************
**
** 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 "cmbechomessage.h"
#include "cmbcompletecodemessage.h"
#include "cmbendmessage.h"
#include "cmbregisterprojectsforeditormessage.h"
#include "cmbregistertranslationunitsforeditormessage.h"
#include "cmbunregisterprojectsforeditormessage.h"
#include "cmbunregistertranslationunitsforeditormessage.h"
#include "registerunsavedfilesforeditormessage.h"
#include "requestdocumentannotations.h"
#include "requestreferencesmessage.h"
#include "unregisterunsavedfilesforeditormessage.h"
#include "updatetranslationunitsforeditormessage.h"
#include "updatevisibletranslationunitsmessage.h"

View File

@@ -25,21 +25,9 @@
#include "clangcodemodelserverproxy.h" #include "clangcodemodelserverproxy.h"
#include <cmbalivemessage.h>
#include <cmbcompletecodemessage.h>
#include <cmbendmessage.h>
#include <cmbregisterprojectsforeditormessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregisterprojectsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <clangcodemodelclientinterface.h> #include <clangcodemodelclientinterface.h>
#include <clangcodemodelservermessages.h>
#include <messageenvelop.h> #include <messageenvelop.h>
#include <registerunsavedfilesforeditormessage.h>
#include <requestdocumentannotations.h>
#include <requestreferencesmessage.h>
#include <unregisterunsavedfilesforeditormessage.h>
#include <updatetranslationunitsforeditormessage.h>
#include <updatevisibletranslationunitsmessage.h>
#include <QLocalServer> #include <QLocalServer>
#include <QLocalSocket> #include <QLocalSocket>

View File

@@ -26,9 +26,6 @@
#include "connectionclient.h" #include "connectionclient.h"
#include "clangbackendipcdebugutils.h" #include "clangbackendipcdebugutils.h"
#include "cmbcompletecodemessage.h"
#include "cmbregistertranslationunitsforeditormessage.h"
#include "cmbunregistertranslationunitsforeditormessage.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QMetaMethod> #include <QMetaMethod>

View File

@@ -25,25 +25,8 @@
#include "messageenvelop.h" #include "messageenvelop.h"
#include "cmbcodecompletedmessage.h" #include "clangcodemodelclientmessages.h"
#include "cmbcompletecodemessage.h" #include "clangcodemodelservermessages.h"
#include "cmbechomessage.h"
#include "cmbregisterprojectsforeditormessage.h"
#include "cmbregistertranslationunitsforeditormessage.h"
#include "cmbunregisterprojectsforeditormessage.h"
#include "cmbunregistertranslationunitsforeditormessage.h"
#include "documentannotationschangedmessage.h"
#include "referencesmessage.h"
#include "messageenvelop.h"
#include "messageenvelop.h"
#include "projectpartsdonotexistmessage.h"
#include "registerunsavedfilesforeditormessage.h"
#include "requestdocumentannotations.h"
#include "requestreferencesmessage.h"
#include "translationunitdoesnotexistmessage.h"
#include "unregisterunsavedfilesforeditormessage.h"
#include "updatetranslationunitsforeditormessage.h"
#include "updatevisibletranslationunitsmessage.h"
namespace ClangBackEnd { namespace ClangBackEnd {

View File

@@ -45,30 +45,12 @@
#include <texteditor/codeassist/iassistprocessor.h> #include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <clangbackendipc/cmbcodecompletedmessage.h> #include <clangbackendipc/clangcodemodelservermessages.h>
#include <clangbackendipc/cmbcompletecodemessage.h> #include <clangbackendipc/clangcodemodelclientmessages.h>
#include <clangbackendipc/cmbechomessage.h>
#include <clangbackendipc/cmbendmessage.h>
#include <clangbackendipc/cmbregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/cmbregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbunregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/cmbunregisterprojectsforeditormessage.h>
#include <clangbackendipc/documentannotationschangedmessage.h>
#include <clangbackendipc/referencesmessage.h>
#include <clangbackendipc/requestreferencesmessage.h>
#include <clangbackendipc/registerunsavedfilesforeditormessage.h>
#include <clangbackendipc/requestdocumentannotations.h>
#include <clangbackendipc/requestreferencesmessage.h>
#include <clangbackendipc/filecontainer.h> #include <clangbackendipc/filecontainer.h>
#include <clangbackendipc/projectpartsdonotexistmessage.h>
#include <clangbackendipc/translationunitdoesnotexistmessage.h>
#include <clangbackendipc/unregisterunsavedfilesforeditormessage.h>
#include <clangbackendipc/updatetranslationunitsforeditormessage.h>
#include <clangbackendipc/updatevisibletranslationunitsmessage.h>
#include <cplusplus/Icons.h> #include <cplusplus/Icons.h>

View File

@@ -44,14 +44,8 @@
#include <texteditor/textdocument.h> #include <texteditor/textdocument.h>
#include <texteditor/texteditor.h> #include <texteditor/texteditor.h>
#include <clangbackendipc/cmbcompletecodemessage.h> #include <clangbackendipc/clangcodemodelservermessages.h>
#include <clangbackendipc/cmbendmessage.h>
#include <clangbackendipc/cmbregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/cmbunregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbunregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/registerunsavedfilesforeditormessage.h>
#include <clangbackendipc/updatetranslationunitsforeditormessage.h>
#include <utils/changeset.h> #include <utils/changeset.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -34,22 +34,8 @@
#include "clangexceptions.h" #include "clangexceptions.h"
#include "skippedsourceranges.h" #include "skippedsourceranges.h"
#include <clangbackendipcdebugutils.h> #include <clangbackendipc/clangbackendipcdebugutils.h>
#include <cmbcodecompletedmessage.h> #include <clangbackendipc/clangcodemodelservermessages.h>
#include <cmbcompletecodemessage.h>
#include <cmbregisterprojectsforeditormessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregisterprojectsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <documentannotationschangedmessage.h>
#include <registerunsavedfilesforeditormessage.h>
#include <requestdocumentannotations.h>
#include <requestreferencesmessage.h>
#include <projectpartsdonotexistmessage.h>
#include <translationunitdoesnotexistmessage.h>
#include <unregisterunsavedfilesforeditormessage.h>
#include <updatetranslationunitsforeditormessage.h>
#include <updatevisibletranslationunitsmessage.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -26,7 +26,6 @@
#include "clangdocuments.h" #include "clangdocuments.h"
#include <diagnosticset.h> #include <diagnosticset.h>
#include <documentannotationschangedmessage.h>
#include <highlightingmarks.h> #include <highlightingmarks.h>
#include <clangexceptions.h> #include <clangexceptions.h>
#include <projects.h> #include <projects.h>

View File

@@ -25,21 +25,8 @@
#include "echoclangcodemodelserver.h" #include "echoclangcodemodelserver.h"
#include <clangbackendipc/cmbcodecompletedmessage.h> #include <clangbackendipc/clangcodemodelservermessages.h>
#include <clangbackendipc/cmbcompletecodemessage.h>
#include <clangbackendipc/cmbechomessage.h>
#include <clangbackendipc/cmbendmessage.h>
#include <clangbackendipc/cmbregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/cmbunregisterprojectsforeditormessage.h>
#include <clangbackendipc/cmbunregistertranslationunitsforeditormessage.h>
#include <clangbackendipc/connectionserver.h> #include <clangbackendipc/connectionserver.h>
#include <clangbackendipc/registerunsavedfilesforeditormessage.h>
#include <clangbackendipc/requestdocumentannotations.h>
#include <clangbackendipc/requestreferencesmessage.h>
#include <clangbackendipc/unregisterunsavedfilesforeditormessage.h>
#include <clangbackendipc/updatetranslationunitsforeditormessage.h>
#include <clangbackendipc/updatevisibletranslationunitsmessage.h>
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>

View File

@@ -33,15 +33,9 @@
#include <clangcodemodelclientproxy.h> #include <clangcodemodelclientproxy.h>
#include <clangcodemodelserverproxy.h> #include <clangcodemodelserverproxy.h>
#include <clangtranslationunits.h> #include <clangtranslationunits.h>
#include <requestdocumentannotations.h>
#include <clangexceptions.h> #include <clangexceptions.h>
#include <cmbcompletecodemessage.h> #include <clangcodemodelservermessages.h>
#include <cmbregisterprojectsforeditormessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregisterprojectsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <requestreferencesmessage.h>
#include <utils/algorithm.h> #include <utils/algorithm.h>

View File

@@ -32,24 +32,9 @@
#include <clangcodemodelserverproxy.h> #include <clangcodemodelserverproxy.h>
#include <projectpartsdonotexistmessage.h> #include <projectpartsdonotexistmessage.h>
#include <cmbalivemessage.h> #include <clangcodemodelservermessages.h>
#include <cmbcodecompletedmessage.h>
#include <cmbcompletecodemessage.h>
#include <cmbechomessage.h>
#include <cmbendmessage.h>
#include <cmbregisterprojectsforeditormessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregisterprojectsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <documentannotationschangedmessage.h>
#include <readmessageblock.h> #include <readmessageblock.h>
#include <registerunsavedfilesforeditormessage.h>
#include <requestdocumentannotations.h>
#include <requestreferencesmessage.h>
#include <translationunitdoesnotexistmessage.h>
#include <unregisterunsavedfilesforeditormessage.h>
#include <updatetranslationunitsforeditormessage.h>
#include <updatevisibletranslationunitsmessage.h>
#include <writemessageblock.h> #include <writemessageblock.h>
#include <QBuffer> #include <QBuffer>

View File

@@ -27,20 +27,9 @@
#include "mockclangcodemodelclient.h" #include "mockclangcodemodelclient.h"
#include <cmbalivemessage.h>
#include <cmbcodecompletedmessage.h>
#include <cmbcompletecodemessage.h>
#include <cmbechomessage.h>
#include <cmbendmessage.h>
#include <cmbregisterprojectsforeditormessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregisterprojectsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <documentannotationschangedmessage.h>
#include <clangcodemodelconnectionclient.h> #include <clangcodemodelconnectionclient.h>
#include <projectpartsdonotexistmessage.h> #include <clangcodemodelservermessages.h>
#include <readmessageblock.h> #include <readmessageblock.h>
#include <translationunitdoesnotexistmessage.h>
#include <writemessageblock.h> #include <writemessageblock.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>

View File

@@ -28,14 +28,7 @@
#include "googletest.h" #include "googletest.h"
#include <clangbackendipc/clangcodemodelclientinterface.h> #include <clangbackendipc/clangcodemodelclientinterface.h>
#include <clangbackendipc/cmbcodecompletedmessage.h> #include <clangbackendipc/clangcodemodelclientmessages.h>
#include <clangbackendipc/cmbechomessage.h>
#include <clangbackendipc/documentannotationschangedmessage.h>
#include <clangbackendipc/referencesmessage.h>
#include <clangbackendipc/projectpartsdonotexistmessage.h>
#include <clangbackendipc/translationunitdoesnotexistmessage.h>
#include <clangbackendipc/updatetranslationunitsforeditormessage.h>
#include <clangbackendipc/updatevisibletranslationunitsmessage.h>
class MockClangCodeModelClient : public ClangBackEnd::ClangCodeModelClientInterface class MockClangCodeModelClient : public ClangBackEnd::ClangCodeModelClientInterface
{ {

View File

@@ -25,23 +25,13 @@
#include "googletest.h" #include "googletest.h"
#include <cmbalivemessage.h> #include <clangcodemodelclientmessages.h>
#include <cmbcodecompletedmessage.h> #include <clangcodemodelservermessages.h>
#include <cmbcompletecodemessage.h>
#include <cmbendmessage.h>
#include <cmbregistertranslationunitsforeditormessage.h>
#include <cmbunregistertranslationunitsforeditormessage.h>
#include <diagnosticcontainer.h> #include <diagnosticcontainer.h>
#include <documentannotationschangedmessage.h>
#include <highlightingmarkcontainer.h> #include <highlightingmarkcontainer.h>
#include <messageenvelop.h> #include <messageenvelop.h>
#include <requestdocumentannotations.h>
#include <requestreferencesmessage.h>
#include <referencesmessage.h>
#include <readmessageblock.h> #include <readmessageblock.h>
#include <registerunsavedfilesforeditormessage.h>
#include <unregisterunsavedfilesforeditormessage.h>
#include <updatetranslationunitsforeditormessage.h>
#include <writemessageblock.h> #include <writemessageblock.h>
#include <QBuffer> #include <QBuffer>