Preserve newlines before leading comments
commit2388513e5f9e9fde3f7feaaa500ba75367e9f501
authorJake Bailey <jakebailey@fb.com>
Tue, 28 Mar 2017 14:53:16 +0000 (28 07:53 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 28 Mar 2017 14:57:22 +0000 (28 07:57 -0700)
treeba63b80a0ef0ca014a574d5daf63a6e2a1d0a405
parent4cfbfdc9eaecaf3a2e18b49a4669aa037a778296
Preserve newlines before leading comments

Summary:
Since comments in leading trivia usually annotate the line following them, throwing away the newline can lead to confusing output, since it looks like the comment is an annotation on the *previous* line instead.

Also fixes some broken indentation in binary expressions.

Depends on D4741258

Reviewed By: eshrews

Differential Revision: D4741399

fbshipit-source-id: 83b1a90bba5fab5f9c3a5a834fc78981c4aeeafb
hphp/hack/src/hackfmt/hack_format.ml