]> git.lizzy.rs Git - rust.git/commitdiff
Merge #5989
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Wed, 16 Sep 2020 20:03:41 +0000 (20:03 +0000)
committerGitHub <noreply@github.com>
Wed, 16 Sep 2020 20:03:41 +0000 (20:03 +0000)
5989: Rewrite import merging r=jonas-schievink a=Veykril

Rewrites how import merging is being handled. It is now a recursive function to properly handle merging of intermediate levels in the import trees. With this ordering the imports is also now possible tho it doesn't quite order it the same way as `rustfmt` does yet, namely it orders lowercase identifiers after uppercase identifiers as that is the standard character order that rust uses. This also fixes a few weird behaviors that were visible in some of the `replace_qualified_name_with_use.rs` tests.

This really took longer than I was hoping for, fighting with import trees is quite the exhausting task ðŸ˜…

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
1  2 
crates/assists/src/handlers/replace_qualified_name_with_use.rs
crates/assists/src/utils/insert_use.rs