Commit 756a6785 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Highlight unused symbols.

parent f87f2c97
...@@ -1934,7 +1934,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo) ...@@ -1934,7 +1934,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
int line = 0, column = 0; int line = 0, column = 0;
convertPosition(position(), &line, &column); convertPosition(position(), &line, &column);
QList<QTextEdit::ExtraSelection> allSelections; QList<QTextEdit::ExtraSelection> unusedSelections;
m_renameSelections.clear(); m_renameSelections.clear();
...@@ -1955,16 +1955,16 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo) ...@@ -1955,16 +1955,16 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
if (uses.size() == 1) { if (uses.size() == 1) {
// it's an unused declaration // it's an unused declaration
// highlightUses(uses, &allSelections); highlightUses(uses, &unusedSelections);
} else if (good) { } else if (good) {
QList<QTextEdit::ExtraSelection> selections; QList<QTextEdit::ExtraSelection> selections;
highlightUses(uses, &selections); highlightUses(uses, &selections);
m_renameSelections += selections; m_renameSelections += selections;
allSelections += selections;
} }
} }
setExtraSelections(CodeSemanticsSelection, allSelections); setExtraSelections(UnusedSymbolSelection, unusedSelections);
setExtraSelections(CodeSemanticsSelection, m_renameSelections);
} }
SemanticHighlighter::Source CPPEditor::currentSource(bool force) SemanticHighlighter::Source CPPEditor::currentSource(bool force)
......
...@@ -471,8 +471,9 @@ public: ...@@ -471,8 +471,9 @@ public:
ParenthesesMatchingSelection, ParenthesesMatchingSelection,
CodeWarningsSelection, CodeWarningsSelection,
CodeSemanticsSelection, CodeSemanticsSelection,
OtherSelection, UnusedSymbolSelection,
FakeVimSelection, FakeVimSelection,
OtherSelection,
NExtraSelectionKinds NExtraSelectionKinds
}; };
void setExtraSelections(ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections); void setExtraSelections(ExtraSelectionKind kind, const QList<QTextEdit::ExtraSelection> &selections);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment