The formatter should alphabetize `use` statements if they're not separated by an empty line
We already alphabetize items within a single use statements. It would be nice to also alphabetize the use statements themselves if they're not separated by an empty line. This replicates the behavior of the Rust formatter.
cc @eureka-cpu couldn't find an open issue for this but please close it if it's already tracked somewhere else!
This will be included in the ItemUse::format() functionality !
This will be included in the
ItemUse::format()functionality !
Since the deadline is approaching I've unassigned for the time being since I will be working on finishing out the basic features. If someone picks it up by all means! if not I will continue once the MVP is finished.
To be clear, it currently does sort alphabetically just in the scope of each use statement and not as a group of use statements.
@cr-fuel to do this you'll need to add some extra logic to separate the use statements into individual blocks to be formatted with what is already there. You'll need to collect the use statements first, by looking ahead for the next use statement. If it finds there are two consecutive newlines, only then you should format the previous block.