rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Fixed first comment and last comment not reordering issue

Open whizsid opened this issue 5 years ago • 5 comments

Fixes #4027 .

whizsid avatar Oct 30 '20 12:10 whizsid

Thanks @whizsid! Note CI is failing and we're blocked on https://github.com/rust-lang/rust/issues/78549

calebcartwright avatar Oct 30 '20 14:10 calebcartwright

Blocking issues should be resolved. When you get a chance can you rebase on master to grab the latest and get CI passing?

calebcartwright avatar Nov 10 '20 03:11 calebcartwright

@calebcartwright I adjusted my PR. can you review again?

whizsid avatar Feb 20 '21 10:02 whizsid

@calebcartwright I adjusted my PR. can you review again?

Thanks for the updates! This PR has been sitting out here for a while though, would you please rebase on master?

calebcartwright avatar Feb 21 '21 00:02 calebcartwright

While there's a few nits I do think the approach seems reasonable, and the resulting formatting is certainly better than what it exists today (some of these snippets get horribly butchered today).

I'd like to add a couple more test cases before merging though, just to be extra cautious. Could you add a couple snippets to cover the following:

  • A trailing mix of a block comment followed by a line comment (use foo; /* bar */ // evil
  • Multiline block comments
  • imports within indented scopes (e.g inside an inline module, function, etc.)

After those tests are added, should be good to merge

calebcartwright avatar Apr 08 '21 02:04 calebcartwright