fsprojects / fantomas

FSharp source code formatter
https://fsprojects.github.io/fantomas
Other
764 stars 190 forks source link

Comment between lines breaks indentation #2944

Open pbiggar opened 12 months ago

pbiggar commented 12 months ago

Issue created from fantomas-online

Code

5 =
  // a comment
  5

Result

5 =
// a comment
5

Problem description

By not indenting the second line, reformatting creates incorrect code.

Extra information

Options

Fantomas main branch at 1/1/1990

    { config with
                IndentSize = 2 }
nojaf commented 11 months ago

This is a bit tricky, I must admit. Dealing with the equals infix operator involves considering various complex scenarios. Tackling this without unintentionally causing new issues will definitely be a challenge.

I'd be happy to pair with someone if there are volunteers.