diff --git a/src/plugins/cpptools/cpphighlightingsupportinternal.cpp b/src/plugins/cpptools/cpphighlightingsupportinternal.cpp index 73da69f5ff054048be018d03fdec3584fe4992c6..122cbaf891ea5b12c7f46eef8429cad0a2625d84 100644 --- a/src/plugins/cpptools/cpphighlightingsupportinternal.cpp +++ b/src/plugins/cpptools/cpphighlightingsupportinternal.cpp @@ -53,8 +53,18 @@ QFuture<CppHighlightingSupport::Use> CppHighlightingSupportInternal::highlightin const Document::Ptr &doc, const Snapshot &snapshot) const { - //Get macro uses QList<CheckSymbols::Use> macroUses; + + //Get macro definitions + foreach (const CPlusPlus::Macro& macro, doc->definedMacros()) { + int line, column; + editor()->convertPosition(macro.offset(), &line, &column); + ++column; //Highlighting starts at (column-1) --> compensate here + CheckSymbols::Use use(line, column, macro.name().size(), SemanticInfo::MacroUse); + macroUses.append(use); + } + + //Get macro uses foreach (Document::MacroUse macro, doc->macroUses()) { const QString name = QString::fromUtf8(macro.macro().name());