C#: how should I deal with deliberately unused parameters?

Hi,

please consider the following method:

public void Foo(int i) {
Console.WriteLine("Hello World!");
}

Of course, Rider displays a warning, that the parameter "i" is unused. But there are some cases, where a parameter is left unused deliberately for good reasons.

When using eslint, we tag unused parameters with an underscore to suppress the issue: "_". We do even get a warning if somebody does start using a variable that starts with an "_".

Is there any similar setting in Rider as well?

Thank you!

0
2 comments

Hi Andreas E Hoffmann

Thank you for the request. 

If this case is not often, the best option is to disable inspection manually. Press Alt+Enter when caret on the parameter and choose this in the menu: 

I hope this helps! 

0

Thank you for your reply. This will have to do then :-)

0

Please sign in to leave a comment.