Gray names for unused functions (using solution-wide-analysis)

In the 4.5 beta, using solution-wide analysis, public methods that were unused in the solution showed up with grayed out names (the same as private methods that were unused). This was super-usefull for me. In the final 4.5 release however, unused public methods show up as a suggestions (with the little squiggly underline). I understand that this allows me to set the severity of the unused method, but having it be visually distinct from other suggestions was extremely helpful to me, not to mention it was consistent with the meaning of the grayed-out-name for private methods. It tends to blend in with other suggestions/warnings in my file, where I want it to stand out the same as an unused private method.

I was wondering, is there some way I can re-enable the graying-out of unused public method names so they look the same as the unused private method names? I looked for an option, but was unable to find one.

For example:

private void DoSomething() {...}

will show up gray if I don't call it anywhere in my class

public void DoSomethingElse() { ... }

will show up normally, but with a squiggly suggestion underline.

3 comments

Hi.

You may change severity of “Unused declaration (non-private accessibility) “.

This setting may either be changed via “Options/Code Inspection/Inspection severity” or via the special QuickFix “Inspection options for…” on the “squiggly underlined code”.

Change severity from ‘suggestion’ to ‘warning’.



0

Thanks. I didn't realize that this would cause the text to be grayed. It works now. Appreciate it!

0

In fact, we decided that the current behaviour is not convenient and changed
it for 4.5.1 bug-fix release. In ReSharper 4.5.1 unused methods are grayed
unless severity of this highlighting is set to error (that is unlikely).

Valentin Kipiatkov
CTO and Chief Scientist
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

In the 4.5 beta, using solution-wide analysis, public methods that
were unused in the solution showed up with grayed out names (the same
as private methods that were unused). This was super-usefull for me.
In the final 4.5 release however, unused public methods show up as a
suggestions (with the lit

tle squiggly underline). I understand that this allows me to set the
severity of the unused method, but having it be visually distinct from
other suggestions was extremely helpful to me, not to mention it was
consistent with the meaning of the grayed-out-name for private
methods. It tends to blend i

n with other suggestions/warnings in my file, where I want it to stand
out the same as an unused private method.

I was wondering, is there some way I can re-enable the graying-out of
unused public method names so they look the same as the unused private
method names? I looked for an option, but was unable to find one.

For example:

private void DoSomething() {...}

will show up gray if I don't call it anywhere in my class

public void DoSomethingElse() { ... }

will show up normally, but with a squiggly suggestion underline.

---
Original message URL:
http://www.jetbrains.net/devnet/message/5235874#5235874



0

Please sign in to leave a comment.