BennoDual
BennoDual

Reputation: 6259

Resharper - Disable notification for unused public methods

Resharper 2016.1 is notify unused public methods. Is there a way to disable this notifications global? I want only disable notification of unused public methods. Unused private methods should be notified nevertheless.

Upvotes: 2

Views: 458

Answers (2)

sbp
sbp

Reputation: 963

I have resharper 2018.1. I don't know if this is version specific but in addition to @citizenmatt's answer you also need to make sure that "Show non-private type members when solution-wide analysis is off" is unchecked on the same options page. You could search for 'solution wide' in top left search of resharper options to quickly get on that page as per the image below.

enter image description here

Upvotes: 0

citizenmatt
citizenmatt

Reputation: 18573

You'll need to turn off Solution Wide Analysis (ReSharper → Options → Code Inspection Settings). This will disable a number of inspections, but also disable marking public methods as being unused. Alternatively, you can use ReSharper's annotations, and add an attribute such as [PublicAPI] to the public methods that are used externally.

Private methods will remain marked as unused, because that only requires ReSharper to analyse a single class, rather than the whole solution.

Upvotes: 3

Related Questions