From 83dff048cfbeb8424293afdddfb3069cda46541f Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Fri, 18 Jan 2013 15:54:52 +0100 Subject: Highlight macro definitions like other uses. Change-Id: I5a0852e5c1e154b52d712f1dfcfe2fc04e0eb9fb Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cpphighlightingsupportinternal.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cpphighlightingsupportinternal.cpp') diff --git a/src/plugins/cpptools/cpphighlightingsupportinternal.cpp b/src/plugins/cpptools/cpphighlightingsupportinternal.cpp index 73da69f5ff..122cbaf891 100644 --- a/src/plugins/cpptools/cpphighlightingsupportinternal.cpp +++ b/src/plugins/cpptools/cpphighlightingsupportinternal.cpp @@ -53,8 +53,18 @@ QFuture CppHighlightingSupportInternal::highlightin const Document::Ptr &doc, const Snapshot &snapshot) const { - //Get macro uses QList 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()); -- cgit v1.2.1