diff options
author | Francois Ferrand <thetypz@gmail.com> | 2013-01-18 15:54:52 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-01-23 14:39:05 +0100 |
commit | 83dff048cfbeb8424293afdddfb3069cda46541f (patch) | |
tree | bfce5f158769814953bca2cca4882e8245f15c57 /src | |
parent | f128a92485b98339fab0d8dff8846bcd5c8f996f (diff) | |
download | qt-creator-83dff048cfbeb8424293afdddfb3069cda46541f.tar.gz |
Highlight macro definitions like other uses.
Change-Id: I5a0852e5c1e154b52d712f1dfcfe2fc04e0eb9fb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/cpptools/cpphighlightingsupportinternal.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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<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()); |