Skip to content
Snippets Groups Projects
Commit 83dff048 authored by Francois Ferrand's avatar Francois Ferrand Committed by Erik Verbruggen
Browse files

Highlight macro definitions like other uses.


Change-Id: I5a0852e5c1e154b52d712f1dfcfe2fc04e0eb9fb
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent f128a924
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,18 @@ QFuture<CppHighlightingSupport::Use> CppHighlightingSupportInternal::highlightin ...@@ -53,8 +53,18 @@ QFuture<CppHighlightingSupport::Use> CppHighlightingSupportInternal::highlightin
const Document::Ptr &doc, const Document::Ptr &doc,
const Snapshot &snapshot) const const Snapshot &snapshot) const
{ {
//Get macro uses
QList<CheckSymbols::Use> macroUses; 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()) { foreach (Document::MacroUse macro, doc->macroUses()) {
const QString name = QString::fromUtf8(macro.macro().name()); const QString name = QString::fromUtf8(macro.macro().name());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment