hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Fix IDE formatting of correctly formatted files with trailing newlines

Open mszabo-wikia opened this issue 2 weeks ago • 2 comments

Since D60978552, we special-case removing a range of lines during IDE formatting so that T188437747 does not rear its ugly head. However, when document-formatting a file that is already correctly formatted save for some spurious trailing newlines, this logic ends up consuming the last non-newline line. So, only shift the start offset if the last changed line wasn't a trailing line that got removed.

Add a test and wire up hh_single_ide_format with the OSS dune build so that IDE format tests can be run.

mszabo-wikia avatar Dec 04 '25 02:12 mszabo-wikia

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D88329959. (Because this pull request was imported automatically, there will not be any future comments.)

meta-codesync[bot] avatar Dec 04 '25 02:12 meta-codesync[bot]

@mszabo-wikia has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar Dec 10 '25 11:12 facebook-github-bot