diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-12 17:59:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-08-12 17:59:40 +0100 |
commit | f277ec27ac024992e8b8834c68e16b31c983be1b (patch) | |
tree | e754396302c88aa602bb77be30ce1835c205f730 /crates/ra_assists/src/handlers/merge_imports.rs | |
parent | d583f2c46d22cf8d643ebf98be9cb7059a304431 (diff) | |
parent | 0635458a6bf883b5abcae024afb17a11688fef92 (diff) |
Merge #5730
5730: **Merge Imports** assist handles self
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/merge_imports.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/merge_imports.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index 9c5c6eda7..47d465404 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -165,6 +165,33 @@ use std::fmt::{Display, Debug}; | |||
165 | } | 165 | } |
166 | 166 | ||
167 | #[test] | 167 | #[test] |
168 | fn merge_self1() { | ||
169 | check_assist( | ||
170 | merge_imports, | ||
171 | r" | ||
172 | use std::fmt<|>; | ||
173 | use std::fmt::Display; | ||
174 | ", | ||
175 | r" | ||
176 | use std::fmt::{self, Display}; | ||
177 | ", | ||
178 | ); | ||
179 | } | ||
180 | |||
181 | #[test] | ||
182 | fn merge_self2() { | ||
183 | check_assist( | ||
184 | merge_imports, | ||
185 | r" | ||
186 | use std::{fmt, <|>fmt::Display}; | ||
187 | ", | ||
188 | r" | ||
189 | use std::{fmt::{Display, self}}; | ||
190 | ", | ||
191 | ); | ||
192 | } | ||
193 | |||
194 | #[test] | ||
168 | fn test_merge_nested() { | 195 | fn test_merge_nested() { |
169 | check_assist( | 196 | check_assist( |
170 | merge_imports, | 197 | merge_imports, |