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

Fix interleaving of comments imperative structures. #1770

Merged
merged 1 commit into from
Jan 23, 2018
Merged

Conversation

jordwalke
Copy link
Member

Fix interleaving of comments imperative structures.

@jordwalke
Copy link
Member Author

jordwalke commented Jan 23, 2018

Fixes #1767 (weird unit formatting) and (makes formatting idempotent #1768)
(as well as some other comment formatting improvements).

There's still quite a few cases where the output is ugly when including end of line comments, but this is progress. (Those cases weren't mentioned in those two Issues)

There primary remaining issue is just the case where you have exactly one operation inside for/while/if braces, but then have a final comment after it before the closing brace. If any braces have multiple statements in them, the formatting is fine. This example wasn't mentioned in the Issues.

if (trueThing) {
  /* Comment before print */
  print_newline();
  /* Comment after final print */
}

@jordwalke jordwalke force-pushed the FixImperitive branch 2 times, most recently from bc3df67 to e16c4cc Compare January 23, 2018 10:41
Summary:

Test Plan:

Reviewers:

CC:
@jordwalke jordwalke merged commit 5151f3b into master Jan 23, 2018
@jordwalke jordwalke deleted the FixImperitive branch January 23, 2018 11:36
@jordwalke
Copy link
Member Author

Merging! Let me know if this caused any problems, and we'll quickly revert.

@kyldvs
Copy link

kyldvs commented Jan 23, 2018

Thanks :)

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

Successfully merging this pull request may close these issues.

3 participants