Formatting fluent API

When I use a code refactoring, Rider insists on reformatting my code too. Is it possible either to not reformat code when doing a refactoring (such as file-scoped namespaces in project), or else, is it possible to format fluent API the way I like it? Instead I end up with 100+ files all with messed up fluent API calls.

Specifically, I would like my fluent API calls to look like this:

FluentAPI
.Start()
.DoSomething(x)
.DoSomethingElse(y);

Instead, Rider makes it like this which I do not want:

FluentAPI
   .Start()
   .DoSomething(x)
   .DoSomethingElse(y);

Thanks

0
2 comments

Hello Dave Cousineau ,

Thank you for reporting the issue. Unfortunately at the moment there is no way to format Fluen API this way. I have created a corresponding record on our bug tracker: RSRP-494152. The issue is handled by a dedicated developer there. Please upvote it and click Watch to monitor the progress of the issue.

Let me know if you have any further questions. Have a good day!

0

Thanks. I've been thinking about this, and while I would like the formatting option, what I would also like maybe even more is to be able to perform the refactoring without reformatting. Is this possible? It will probably never be the case that Rider will format my code 100% as I want it. There are all kind of other ways that the auto-formatting gets things wrong. The indenting on fluent-api is just the major one. Really what would have been better is if I could have done the namespace refactoring and not reformatted every single file in my solution.

Thanks

0

Please sign in to leave a comment.