Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
756a6785
Commit
756a6785
authored
Nov 30, 2009
by
Roberto Raggi
Browse files
Highlight unused symbols.
parent
f87f2c97
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppeditor.cpp
View file @
756a6785
...
...
@@ -1934,7 +1934,7 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
int
line
=
0
,
column
=
0
;
convertPosition
(
position
(),
&
line
,
&
column
);
QList
<
QTextEdit
::
ExtraSelection
>
all
Selections
;
QList
<
QTextEdit
::
ExtraSelection
>
unused
Selections
;
m_renameSelections
.
clear
();
...
...
@@ -1955,16 +1955,16 @@ void CPPEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
if
(
uses
.
size
()
==
1
)
{
// it's an unused declaration
//
highlightUses(uses, &
all
Selections);
highlightUses
(
uses
,
&
unused
Selections
);
}
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
)
...
...
src/plugins/texteditor/basetexteditor.h
View file @
756a6785
...
...
@@ -471,8 +471,9 @@ public:
ParenthesesMatchingSelection
,
CodeWarningsSelection
,
CodeSemanticsSelection
,
Other
Selection
,
UnusedSymbol
Selection
,
FakeVimSelection
,
OtherSelection
,
NExtraSelectionKinds
};
void
setExtraSelections
(
ExtraSelectionKind
kind
,
const
QList
<
QTextEdit
::
ExtraSelection
>
&
selections
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment