Visual Studio doesn't offer automatic formatting for F#, is there any other editor I can use to automate that?
I would like it would put reasonable white spaces in between arithmetic operators (a+b)
goes to (a + b)
or assignment operators =
The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
Select the text you want to automatically indent.Click menu Edit → Advanced → *Format Selection, or press Ctrl + K , Ctrl + F . Format Selection applies the smart indenting rules for the language in which you are programming to the selected text. Save this answer.
I have been developing a source code formatter for F#. The source can be found on Github.
At the moment, a VS extension has been released in Visual Studio gallery. Integration to other IDEs and editors should be possible while the API and command line are already available.
The VS extension can handle the situations you described quite well via formatting selection feature.
Generic code indentation is supported in FSharpMode in Emacs: Link to download site But it wont help you to do automatic white-space separation of operators, only indentation.
Maybe write a simple formatter based on Tomas Petriceks code for syntax highlighting?
Link to FSharp.Formatting
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With