Based on this answer, I hope I am on-topic here.

I have the following function call in my project:

return InteropServices.MarshalResponse<TResponse, __GenericSingleResponse, TMarshaledClass>(interopResponse, interopResponse.RequestData, this.RequestDataType);

As you can see, it is way too long to be well-readable and so I am hoping for ways to make it more readable (e.g where to break, after every type parameter?).

If it wasn't for the type parameters, I would break it like this

return InteropServices.MarshalResponse(interopResponse, 

but I'm confused about how to break the type parameters.

One way to make it more readable is of course to rethink the InteropServices.MarshalResponse signature, but I would rather not like to do that, because it would be very difficult.

  • 2
    \$\begingroup\$ It's hard to be on topic with a single like of code... \$\endgroup\$ – t3chb0t Mar 23 '18 at 9:51

The answer to this is very boring.

The best way to format the code is let your code editor to do it for you. Hence, you should setup your code editor to format the code in a style that you or your team approves.

Once you do that, let the IDE format the code for you ctlr + e, D to format the current document in Visual studio.


Not the answer you're looking for? Browse other questions tagged or ask your own question.