Highlight macro definitions like other uses.

Change-Id: I5a0852e5c1e154b52d712f1dfcfe2fc04e0eb9fb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Francois Ferrand
2013-01-18 15:54:52 +01:00
committed by Erik Verbruggen
parent f128a92485
commit 83dff048cf

View File

@@ -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());