New options for Named expression

Normally I didn't use named expressions because I try to avoid having methods with too many parameters, but some methods from the technology that I use don't follow the same idea, so to make things clear I tried to name parameter in some of those methods like this

Which is good, but doing a reformat and clearing up will remove those names unless I change this setting, so I did it, but now I end with some names that aren't too useful, like

So, what I want is some kind of mid term, maybe being able to change the minimum amount of arguments before changing to named parameters OR being able to disable it by a whole letting things be as I write it (but I need to be able to keep calling the Reformat and clean up on the file). Do we have some of the above options?

 

0
1 comment

Hello Joao Gavron, thank you for your message.

Have you tried Parameter name hints instead of writing named arguments? It seems that at the moment I can not offer other options to do something similar to what you described, unfortunately.

The idea of the parameter name hints is to show parameter names for arguments whose intention may not be clear, but at the same time not to clutter the editor with hints where the argument purpose is obvious, and of course if there are named arguments in the call. To achieve this, JetBrains Rider applies a number of configurable heuristics.

You can customize parameter name hints for specific needs here: "File | Settings | Editor | Inlay Hints | C# | Parameter Name Hints". Please let me know what you think about it.

0

Please sign in to leave a comment.