-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code reformat breaks the code #58
Comments
Hey, Rider uses Fantomas so if there is a problem you should report in https://github.com/fsprojects/fantomas/. Could you try this out in the online tool? https://jindraivanek.gitlab.io/fantomas-ui/#?fantomas=preview-trivia |
@nojaf : Trying the code above in the online tool you linked gives correct code. When I do the same in Rider, it gives the wrong code. So it seems to have been fixed in Fantomas then I guess :D so unless the error is in Rider, it will probably start working again when you roll out your new version. Is there an ETA on that? Also, can you add formatting options to the (fantomas) code formatting in Rider? Fantomas has a ton of options, and Rider seems to deviate quite far from Fantomas' default settings. |
This could be due to Rider uses different default settings compared to the online tool. We have
All Fantomas options are already in |
@auduchinok : Ah. Nice. I tried to search for "fantomas" in the settings without finding anything, so that's why I assumed the settings wasn't there. But that's the fantomas settings. I see. Nice 😄
I tried removing --edit-- |
Hello, I'm experiencing this annoying issue as well. I created a bug on Rider bug track but they asked to go on There, I found that the bug had been fixed already. I'd like that the formatting would work without having to change the I prefer having:
rather than (
|
Maybe @nojaf can answer? ^ @rulrok I too prefer the former style. While the second style is prettier in many ways, the former is more practical and will result in less git diff when add another field. It's almost more similar to how you would define types in other languages like TypeScript. @nojaf Maybe there should be an option for formatting types & lists in the former style? Or has that already been discussed somewhere? |
Hey, this looks like fsprojects/fantomas#453 |
Fixed in 2019.3 with Fantomas update. |
When running code
Reformat Code
(cmd+opt+L), the produced code is broken because of indentation when using []:is changed to:
^ Notice the extra space in front of []. That make the code on the next line "off side", which causes the whole parsing to fail.
Also, one unrelated question: I read on fantomas' site that Rider uses it for its formatting. However, fantomas' formatting is way more opinionated than Rider's. Imo that's mostly a good thing, but it would be nice if it was configurable so that I could choose fantomas' more opinionated formatting if I wanted to.
The text was updated successfully, but these errors were encountered: