Skip to content

Conversation

@mszabo-wikia
Copy link
Contributor

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.

@meta-cla meta-cla bot added the CLA Signed label Dec 4, 2025
@meta-codesync
Copy link

meta-codesync bot commented Dec 4, 2025

@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.)

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 mszabo-wikia force-pushed the fix-formatting-of-trailing-newlines branch from 0f26849 to 419cd56 Compare December 10, 2025 11:21
@facebook-github-bot
Copy link
Contributor

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

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.

2 participants