Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import sorting should use a natural sort #5714

Closed
jgarvin opened this issue Aug 12, 2020 · 4 comments
Closed

import sorting should use a natural sort #5714

jgarvin opened this issue Aug 12, 2020 · 4 comments

Comments

@jgarvin
Copy link

jgarvin commented Aug 12, 2020

Current behavior if you ask analyzer to add uses for each type for you:

use std::num::{NonZeroU16, NonZeroU8, NonZeroU32, NonZeroU64};

This would be slightly nicer:

use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64};

@bjorn3
Copy link
Member

bjorn3 commented Aug 12, 2020

Rust-analyzer should use the same order as rustfmt in my opinion. This means alphabetic instead of natural.

@iago-lito
Copy link

Agreed. In any case, if Rust-analyzer outputs something different than rustfmt, then rustfmt wipes the difference anyway on the next fist pass. So maybe this is a feature to ask at rustfmt instead?

@lnicola
Copy link
Member

lnicola commented Aug 12, 2020

I think this is out of scope for now, but you can file this as a rustfmt feature request.

@lnicola lnicola closed this as completed Aug 12, 2020
@jgarvin
Copy link
Author

jgarvin commented Aug 12, 2020

Filed w/ rustfmt: rust-lang/rustfmt#4381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants