CppEditor: Add missing include and ifdefs

Change-Id: I34b1d0f4fb10c7fcba6e6b7bc1b3d964e154db3a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Stenger
2023-02-02 12:02:46 +01:00
parent 209e3d0e66
commit f952918390
2 changed files with 9 additions and 2 deletions

View File

@@ -13,6 +13,7 @@
#include <cplusplus/Lexer.h> #include <cplusplus/Lexer.h>
#include <QFile> #include <QFile>
#include <QTextCharFormat>
#include <QTextDocument> #include <QTextDocument>
#include <QTextLayout> #include <QTextLayout>
@@ -460,6 +461,7 @@ void CppHighlighter::highlightDoxygenComment(const QString &text, int position,
setFormatWithSpaces(text, initial, it - uc - initial, format); setFormatWithSpaces(text, initial, it - uc - initial, format);
} }
#ifdef WITH_TESTS
namespace Internal { namespace Internal {
CppHighlighterTest::CppHighlighterTest() CppHighlighterTest::CppHighlighterTest()
{ {
@@ -541,6 +543,7 @@ void CppHighlighterTest::test()
QCOMPARE(actualFormat, expectedFormat); QCOMPARE(actualFormat, expectedFormat);
} }
} }
} // namespace Internal } // namespace Internal
#endif // WITH_TESTS
} // namespace CppEditor } // namespace CppEditor

View File

@@ -9,7 +9,9 @@
#include <cplusplus/Token.h> #include <cplusplus/Token.h>
#include <QTextCharFormat> #ifdef WITH_TESTS
#include <QTextDocument>
#endif
namespace CppEditor { namespace CppEditor {
@@ -37,6 +39,7 @@ private:
CPlusPlus::LanguageFeatures m_languageFeatures = CPlusPlus::LanguageFeatures::defaultFeatures(); CPlusPlus::LanguageFeatures m_languageFeatures = CPlusPlus::LanguageFeatures::defaultFeatures();
}; };
#ifdef WITH_TESTS
namespace Internal { namespace Internal {
class CppHighlighterTest : public CppHighlighter class CppHighlighterTest : public CppHighlighter
{ {
@@ -53,5 +56,6 @@ private:
QTextDocument m_doc; QTextDocument m_doc;
}; };
} // namespace Internal } // namespace Internal
#endif // WITH_TESTS
} // namespace CppEditor } // namespace CppEditor