diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-04 21:09:32 +0100 |
commit | cacdb0eab8131bfb945eb7ed0150c92ec56eefe2 (patch) | |
tree | f762de90ce813591bc640ae0bce36493a3dcafa9 /crates/ra_assists/src/auto_import.rs | |
parent | 4e8664d9d37021e85d72b6228fa45e7edf4a1a74 (diff) | |
parent | 1834bae5b86c54ed9dece26e82436919d59e6cb7 (diff) |
Merge #1486
1486: allow rustfmt to reorder imports r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/auto_import.rs')
-rw-r--r-- | crates/ra_assists/src/auto_import.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/crates/ra_assists/src/auto_import.rs b/crates/ra_assists/src/auto_import.rs index 9617beb5c..75ab8fa0f 100644 --- a/crates/ra_assists/src/auto_import.rs +++ b/crates/ra_assists/src/auto_import.rs | |||
@@ -1,14 +1,15 @@ | |||
1 | use hir::{self, db::HirDatabase}; | ||
1 | use ra_text_edit::TextEditBuilder; | 2 | use ra_text_edit::TextEditBuilder; |
2 | use hir::{ self, db::HirDatabase}; | ||
3 | 3 | ||
4 | use ra_syntax::{ | ||
5 | T, | ||
6 | ast::{ self, NameOwner }, AstNode, SyntaxNode, Direction, TextRange, SmolStr, | ||
7 | SyntaxKind::{ PATH, PATH_SEGMENT } | ||
8 | }; | ||
9 | use crate::{ | 4 | use crate::{ |
5 | assist_ctx::{Assist, AssistCtx}, | ||
10 | AssistId, | 6 | AssistId, |
11 | assist_ctx::{AssistCtx, Assist}, | 7 | }; |
8 | use ra_syntax::{ | ||
9 | ast::{self, NameOwner}, | ||
10 | AstNode, Direction, SmolStr, | ||
11 | SyntaxKind::{PATH, PATH_SEGMENT}, | ||
12 | SyntaxNode, TextRange, T, | ||
12 | }; | 13 | }; |
13 | 14 | ||
14 | fn collect_path_segments_raw<'a>( | 15 | fn collect_path_segments_raw<'a>( |
@@ -577,7 +578,7 @@ pub(crate) fn auto_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist | |||
577 | #[cfg(test)] | 578 | #[cfg(test)] |
578 | mod tests { | 579 | mod tests { |
579 | use super::*; | 580 | use super::*; |
580 | use crate::helpers::{ check_assist, check_assist_not_applicable }; | 581 | use crate::helpers::{check_assist, check_assist_not_applicable}; |
581 | 582 | ||
582 | #[test] | 583 | #[test] |
583 | fn test_auto_import_add_use_no_anchor() { | 584 | fn test_auto_import_add_use_no_anchor() { |