-
Notifications
You must be signed in to change notification settings - Fork 925
reorder_imports does not respect comments #1373
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
Comments
This needs some kind of discussion. Currently there's a test that expects the behavior that comments moves together with the code below; this one doesn't follow the rule. Example:
to:
|
@ishitatsuyuki I'm not clear - are you saying the example is expected but doesn't happen or happens but shouldn't? It looks correct to me (that is the 'sticky' comment sticks to the import of |
@nrc this is the current behavior and it clearly conflicts with the example posted by OP. |
Ah ok, so I guess the question is whether the first comment should be special-cased and kept at the top of the imports instead of sticking to the import it is 'on top of'? At the moment, it seems that the comment is left and newlines are inserted? There also seems to be some confusion about whether we maintain grouping of imports. So, I think that
|
Triage: the first issue is fixed, closing in favor of #2185. |
rustfmt produces
The comment 1 lost their context. I would expect something like:
Maybe related with #1137
The text was updated successfully, but these errors were encountered: