forked from qt-creator/qt-creator
Clang: Integrate highlighting results from backend
Change-Id: I2c3fb69aabfe075bde76d63eafc2ca370f17493c Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
eb2457869d
commit
7ce9ef9db4
@@ -31,8 +31,11 @@
|
||||
#include "mockipclient.h"
|
||||
|
||||
#include <clangipcserver.h>
|
||||
#include <highlightingchangedmessage.h>
|
||||
#include <highlightingmarkcontainer.h>
|
||||
#include <ipcclientproxy.h>
|
||||
#include <ipcserverproxy.h>
|
||||
#include <requesthighlightingmessage.h>
|
||||
#include <translationunitdoesnotexistexception.h>
|
||||
#include <translationunitparseerrorexception.h>
|
||||
|
||||
@@ -43,6 +46,7 @@
|
||||
#include <cmbregistertranslationunitsforeditormessage.h>
|
||||
#include <cmbunregisterprojectsforeditormessage.h>
|
||||
#include <cmbunregistertranslationunitsforeditormessage.h>
|
||||
#include <highlightingchangedmessage.h>
|
||||
#include <diagnosticschangedmessage.h>
|
||||
#include <projectpartsdonotexistmessage.h>
|
||||
#include <translationunitdoesnotexistmessage.h>
|
||||
@@ -62,6 +66,7 @@ using testing::Contains;
|
||||
using testing::Not;
|
||||
using testing::Eq;
|
||||
using testing::PrintToString;
|
||||
using testing::_;
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -78,6 +83,9 @@ using ClangBackEnd::TranslationUnitDoesNotExistMessage;
|
||||
using ClangBackEnd::ProjectPartsDoNotExistMessage;
|
||||
using ClangBackEnd::UpdateTranslationUnitsForEditorMessage;
|
||||
using ClangBackEnd::UpdateVisibleTranslationUnitsMessage;
|
||||
using ClangBackEnd::RequestHighlightingMessage;
|
||||
using ClangBackEnd::HighlightingChangedMessage;
|
||||
using ClangBackEnd::HighlightingMarkContainer;
|
||||
|
||||
MATCHER_P5(HasDirtyTranslationUnit,
|
||||
filePath,
|
||||
@@ -168,6 +176,18 @@ TEST_F(ClangIpcServer, GetCodeCompletion)
|
||||
clangServer.completeCode(completeCodeMessage);
|
||||
}
|
||||
|
||||
TEST_F(ClangIpcServer, RequestHighlighting)
|
||||
{
|
||||
RequestHighlightingMessage requestHighlightingMessage({variableTestFilePath, projectPartId});
|
||||
|
||||
HighlightingMarkContainer highlightingMarkContainer(1, 6, 8, ClangBackEnd::HighlightingType::Function);
|
||||
|
||||
EXPECT_CALL(mockIpcClient, highlightingChanged(Property(&HighlightingChangedMessage::highlightingMarks, Contains(highlightingMarkContainer))))
|
||||
.Times(1);
|
||||
|
||||
clangServer.requestHighlighting(requestHighlightingMessage);
|
||||
}
|
||||
|
||||
TEST_F(ClangIpcServer, GetCodeCompletionDependingOnArgumets)
|
||||
{
|
||||
CompleteCodeMessage completeCodeMessage(variableTestFilePath,
|
||||
|
||||
Reference in New Issue
Block a user