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

Wrong indentation of else after comment #241

Closed
jindraivanek opened this issue May 6, 2018 · 3 comments
Closed

Wrong indentation of else after comment #241

jindraivanek opened this issue May 6, 2018 · 3 comments

Comments

@jindraivanek
Copy link
Contributor

if true then 1
else //comment
    if true then 2
    else 3

gets formatted to

if true then 1
else //comment
     if true then 2
else 3

which is compiler error.

Without comment it works:

if true then 1
else
    if true then 2
    else 3

->

if true then 1
else if true then 2
else 3

@jindraivanek
Copy link
Contributor Author

@nojaf
Copy link
Contributor

nojaf commented May 6, 2018

It was unclear to us why two tests are ignored, we just kept them ignore during move to dotnet core.

jindraivanek added a commit to jindraivanek/fantomas that referenced this issue May 7, 2018
jindraivanek added a commit to jindraivanek/fantomas that referenced this issue May 7, 2018
@jindraivanek jindraivanek mentioned this issue May 7, 2018
@jindraivanek
Copy link
Contributor Author

Initially I thought this will be hard to fix because of how comment integration works, but then I found out we have positions of comments in Context.Comments, so we can use it to change output in case of comment.

See #244 :)

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

No branches or pull requests

2 participants