C#C
C#3y ago
__dil__

❔ Prevent Rider from removing "redundant" named arguments.

As per the title, I have constructors which take a lot of arguments. I use the constructors to manually instantiate a bunch of stuff in a list, like this:
{
  new ...(
    // Lots of arguments here
  ),
  new ...(
    // Lots of arguments here
  ),
  // etc...
}


A lot of these arguments have the same type and it's possible that I might add/remove some arguments as the project evolves.

So, for the sake of readability and not breaking code when I change the constructors, I'd like all the arguments to be named. Unfortunately, Rider removes the annotations that it thinks are redundant. That's usually fine, but in this specific instance I want full clarity and consistency.

Any way I can achieve this without globally disabling code cleanup?
Was this page helpful?