Code reformat breaks the code
See original GitHub issueWhen running code Reformat Code
(cmd+opt+L), the produced code is broken because of indentation when using [<Annotations>]:
[<CLIMutable>]
type CreateUser =
{ [<JsonRequired>]
Name: string }
is changed to:
[<CLIMutable>]
type CreateUser =
{ [<JsonRequired>]
Name: string }
^ Notice the extra space in front of [<JsonRequired>]. 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
VS code formatting breaks the code unexpectedly in .js files
I am a newbie in React. I am using vscode. Whenever I save app.js file, it formats the whole code and throws errors....
Read more >Reformat code | IntelliJ IDEA Documentation
IntelliJ IDEA lets you reformat your code according to the requirements you've specified in your current code style scheme or the .editorconfig file....
Read more >Code formatting: is it worth to make bad code to look bad?
Not only bad formatting makes it harder to improve the code, but also, bad (or, more likely, unfamiliar) formatting may make code look...
Read more >Automatically reformat Python code in Visual Studio
Automatically format Python code in Visual Studio, including spacing, statements, wrapping, and comments.
Read more >Code formatting
This helps the automatic formatter to insert an appropriate amount of line breaks for Flutter-style code. Here is an example of automatically formatted...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This could be due to Rider uses different default settings compared to the online tool. We have
PreserveEndOfLine
enabled by default to try to preserve used formatting style where possible.All Fantomas options are already in
File | Settings | Editor | Code Style | F#
.Fixed in 2019.3 with Fantomas update.