-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Question: Custom computation expressions sometimes formatted incorrectly #315
Comments
It's weird because with CLI this code will be formatted without problem. |
While working on http://ratatosk.dynu.net/fantomas/, I encounter second issue. Turns out it is caused by different versions of Workaround is to use matching version of
Another option is to use
I think we have two options how to fix this:
I would prefer option 1. |
I have created a separate issue #339 to deal with the second issue presented above ( |
I think this is no longer an issue (see example). |
Hello,
I am trying the latest Fantomas on the default SAFE stack template, using Saturn. For the most part, it is formatting the code well. However, Saturn uses a number of custom computation expressions, and Fantomas is behaving very oddly.
I am seeing 2 issues.
First question has to do with how the following code block is reformatted. By default,
Server.fs
contains the following block of code:I ran the file through the Fantomas command-line utility (no options), and it changed to the following:
While I understand some of the behavior, I don't understand why
router
and{
are on separate lines. From looking at the computation expression tests https://github.com/fsprojects/fantomas/blob/master/src/Fantomas.Tests/ComputationExpressionTests.fs, it should have looked likerouter {
.On a positive note, it didn't indent the
get
call any further.PLEASE SEE #339 FOR MORE INFORMATION ABOUT THE FOLLOWING ISSUE.
Second question is about when I format through the Fantomas library and FAKE. I am seeing the following error message when I try to run the
Server.fs
file throughcheckCode
.If I comment out all the computation expressions in
Server.fs
, then that error goes away. However, any computation express inServer.fs
causes the error to be printed out. Because of this, I'm concerned about runningServer.fs
throughformatCode
.I even tried leaving only one computation expression
Server.fs
:Based on what I saw in Fantomas, this is a
YieldOrReturn
. I still get the same error message. Why is Fantomas trying to change this toYieldOrReturnFrom
(akareturn!
)?The text was updated successfully, but these errors were encountered: