aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppeditor/cpphighlighter.h
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-01-16 10:51:13 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-05-16 14:06:04 +0000
commit837cb2e3974b4b8d157be8234adcd11b226a7caf (patch)
treefbcd833998a7572b2775d0e2e185d5bddb2177ce /src/plugins/cppeditor/cpphighlighter.h
parent5bc796094accf4f63d6a821b55daeb718506cb1a (diff)
CppEditor: Do not highlight C++ and Qt keywords for C
Task-number: QTCREATORBUG-2818 Task-number: QTCREATORBUG-18004 Change-Id: Ibca60a1711c827dd8b4c0486bff3d49b19a61d8b Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.h')
-rw-r--r--src/plugins/cppeditor/cpphighlighter.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h
index fd9ba578a5..a67336c77c 100644
--- a/src/plugins/cppeditor/cpphighlighter.h
+++ b/src/plugins/cppeditor/cpphighlighter.h
@@ -27,6 +27,8 @@
#include <texteditor/syntaxhighlighter.h>
+#include <cplusplus/Token.h>
+
#include <QTextCharFormat>
namespace CppEditor {
@@ -42,7 +44,8 @@ class CppHighlighter : public TextEditor::SyntaxHighlighter
public:
CppHighlighter(QTextDocument *document = 0);
- virtual void highlightBlock(const QString &text);
+ void setLanguageFeatures(const CPlusPlus::LanguageFeatures &languageFeatures);
+ void highlightBlock(const QString &text) override;
private:
void highlightWord(QStringRef word, int position, int length);
@@ -53,6 +56,9 @@ private:
int length);
bool isPPKeyword(const QStringRef &text) const;
+
+private:
+ CPlusPlus::LanguageFeatures m_languageFeatures = CPlusPlus::LanguageFeatures::defaultFeatures();
};
} // namespace Internal