aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/join_lines.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/join_lines.rs b/crates/ra_ide_api/src/join_lines.rs
index 6f71b27db..7deeb3494 100644
--- a/crates/ra_ide_api/src/join_lines.rs
+++ b/crates/ra_ide_api/src/join_lines.rs
@@ -244,6 +244,34 @@ fn foo(e: Result<U, V>) {
244 } 244 }
245 245
246 #[test] 246 #[test]
247 fn join_lines_multiline_in_block() {
248 check_join_lines(
249 r"
250fn foo() {
251 match ty {
252 <|> Some(ty) => {
253 match ty {
254 _ => false,
255 }
256 }
257 _ => true,
258 }
259}
260",
261 r"
262fn foo() {
263 match ty {
264 <|> Some(ty) => match ty {
265 _ => false,
266 },
267 _ => true,
268 }
269}
270",
271 );
272 }
273
274 #[test]
247 fn join_lines_keeps_comma_for_block_in_match_arm() { 275 fn join_lines_keeps_comma_for_block_in_match_arm() {
248 // We already have a comma 276 // We already have a comma
249 check_join_lines( 277 check_join_lines(