diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2015-10-25 23:31:20 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-06-20 10:55:31 +0000 |
commit | 246e72262c4812a82a5e7d5289f7a2308a9ace43 (patch) | |
tree | da14953f00075da8ada1e284267e7ae286ba0266 /src/plugins/cpptools/semantichighlighter.cpp | |
parent | 72e6dd2ab102ddb45ab3de12f61ab1d21c41e6eb (diff) |
CppTools: Separate highlighting for function declarations and calls
Task-number: QTCREATORBUG-15564
Change-Id: Iab1b60e19448202432f98295c89769cd376aa03f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/cpptools/semantichighlighter.cpp')
-rw-r--r-- | src/plugins/cpptools/semantichighlighter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/cpptools/semantichighlighter.cpp b/src/plugins/cpptools/semantichighlighter.cpp index df0107ba63c..c0d0ceefa6e 100644 --- a/src/plugins/cpptools/semantichighlighter.cpp +++ b/src/plugins/cpptools/semantichighlighter.cpp @@ -134,6 +134,14 @@ unsigned SemanticHighlighter::documentRevision() const return m_baseTextDocument->document()->revision(); } +static TextStyles mixinStyle(TextStyle main, TextStyle mixin) +{ + TextStyles res; + res.mainStyle = main; + res.mixinStyles.push_back(mixin); + return res; +} + void SemanticHighlighter::updateFormatMapFromFontSettings() { QTC_ASSERT(m_baseTextDocument, return); @@ -148,6 +156,10 @@ void SemanticHighlighter::updateFormatMapFromFontSettings() m_formatMap[LabelUse] = fs.toTextCharFormat(C_LABEL); m_formatMap[MacroUse] = fs.toTextCharFormat(C_PREPROCESSOR); m_formatMap[FunctionUse] = fs.toTextCharFormat(C_FUNCTION); + m_formatMap[FunctionDeclarationUse] = + fs.toTextCharFormat(mixinStyle(C_FUNCTION, C_DECLARATION)); + m_formatMap[VirtualFunctionDeclarationUse] = + fs.toTextCharFormat(mixinStyle(C_VIRTUAL_METHOD, C_DECLARATION)); m_formatMap[PseudoKeywordUse] = fs.toTextCharFormat(C_KEYWORD); m_formatMap[StringUse] = fs.toTextCharFormat(C_STRING); } |