Highlight unused symbols.

This commit is contained in:
Roberto Raggi
2009-11-30 15:21:16 +01:00
parent f87f2c9766
commit 756a67854a
2 changed files with 6 additions and 5 deletions

View File

@@ -1934,7 +1934,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
int line = 0, column = 0;
convertPosition(position(), &line, &column);
QList<QTextEdit::ExtraSelection> allSelections;
QList<QTextEdit::ExtraSelection> unusedSelections;
m_renameSelections.clear();
@@ -1955,16 +1955,16 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
if (uses.size() == 1) {
// it's an unused declaration
// highlightUses(uses, &allSelections);
highlightUses(uses, &unusedSelections);
} else if (good) {
QList<QTextEdit::ExtraSelection> selections;
highlightUses(uses, &selections);
m_renameSelections += selections;
allSelections += selections;
}
}
setExtraSelections(CodeSemanticsSelection, allSelections);
setExtraSelections(UnusedSymbolSelection, unusedSelections);
setExtraSelections(CodeSemanticsSelection, m_renameSelections);
}
SemanticHighlighter::Source CPPEditor::currentSource(bool force)

View File

@@ -471,8 +471,9 @@ public:
ParenthesesMatchingSelection,
CodeWarningsSelection,
CodeSemanticsSelection,
OtherSelection,
UnusedSymbolSelection,
FakeVimSelection,
OtherSelection,
NExtraSelectionKinds
};
void setExtraSelections(ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections);