Skip to content
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

Comment between lines breaks indentation #2944

Open
2 of 4 tasks
pbiggar opened this issue Aug 8, 2023 · 1 comment
Open
2 of 4 tasks

Comment between lines breaks indentation #2944

pbiggar opened this issue Aug 8, 2023 · 1 comment

Comments

@pbiggar
Copy link
Contributor

pbiggar commented Aug 8, 2023

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

  • The formatted result breaks my code.
  • The formatted result gives compiler warnings.
  • I or my company would be willing to help fix this.
  • I would like a release if this problem is solved.

Options

Fantomas main branch at 1/1/1990

    { config with
                IndentSize = 2 }
@nojaf
Copy link
Contributor

nojaf commented Aug 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants