2

Resharper alerts me about public functions that are never accessed. This is useful in most areas in my code, but I have a project that contains classes that function as a public API (actually Hot-Chocolate GraphAPI functions), so, naturally, there are no calls to them elsewhere in the code. I don't need Resharper to tell me about them.

I know it's possible to disable these kinds of warnings per file by including a comment. I'm wondering if there is a way to disable this warning across an entire project.

N.B. I don't want to disable Resharper itself in this project (as described in this answer). Resharper is still providing value to me and it's just this specific warning that I want to disable.

CSJ
  • 3,641
  • 2
  • 19
  • 29

3 Answers3

1

ReSharper's help lists various ways to disable a specific inspection. You can disable a specific inspection in a scope either using an .editorconfig file, or with a ReSharper settings file.

Igor Akhmetov
  • 1,807
  • 13
  • 15
1

Following the link provided (thanks @IgorAkhmetov) I created an .editorSettings file in the scope I wanted (the root of the single project) with the following contents:

resharper_unused_member_global_highlighting = none
resharper_class_never_instantiated_global_highlighting = none

Outcome: Resharper stopped telling me about unused public members, or uninstantiated public classes, in that project only. It carries on telling me about those problems in the rest of my codebase.

CSJ
  • 3,641
  • 2
  • 19
  • 29
0

Option "Solution-wide inspections" can be turned off in project's properties: enter image description here

Ivan Serduk
  • 451
  • 2
  • 2
  • I still want _other_ inspections to apply in this project as well. – CSJ Jan 28 '22 at 15:57
  • "Solution-Wide Inspections" option in projects properties affects only global usage inspections like "non-private member is never used", "non-private class is never instantiated" and others that requires knowledge about symbols usage in other files and projects. – Ivan Serduk Jan 31 '22 at 06:36