mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Merge b6f4ad90e9
into 1d90205a98
This commit is contained in:
commit
54205ed1d0
3 changed files with 1106 additions and 0 deletions
1068
crates/ide-assists/src/handlers/merge_let_stmts.rs
Normal file
1068
crates/ide-assists/src/handlers/merge_let_stmts.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -184,6 +184,7 @@ mod handlers {
|
|||
mod introduce_named_type_parameter;
|
||||
mod invert_if;
|
||||
mod merge_imports;
|
||||
mod merge_let_stmts;
|
||||
mod merge_match_arms;
|
||||
mod merge_nested_if;
|
||||
mod move_bounds;
|
||||
|
@ -322,6 +323,7 @@ mod handlers {
|
|||
merge_imports::merge_imports,
|
||||
merge_match_arms::merge_match_arms,
|
||||
merge_nested_if::merge_nested_if,
|
||||
merge_let_stmts::merge_let_stmts,
|
||||
move_bounds::move_bounds_to_where_clause,
|
||||
move_const_to_impl::move_const_to_impl,
|
||||
move_from_mod_rs::move_from_mod_rs,
|
||||
|
|
|
@ -2450,6 +2450,42 @@ use std::{fmt::Formatter, io};
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_merge_let_stmts() {
|
||||
check_doc_test(
|
||||
"merge_let_stmts",
|
||||
r#####"
|
||||
fn main() {
|
||||
$0let a = 2;
|
||||
let b = 3;$0
|
||||
}
|
||||
"#####,
|
||||
r#####"
|
||||
fn main() {
|
||||
let (a, b) = (2, 3);
|
||||
}
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_merge_let_stmts_1() {
|
||||
check_doc_test(
|
||||
"merge_let_stmts",
|
||||
r#####"
|
||||
fn main() {
|
||||
$0let a: i32 = 2;
|
||||
let b = 3;
|
||||
}
|
||||
"#####,
|
||||
r#####"
|
||||
fn main() {
|
||||
let (a, b): (i32, _) = (2, 3);
|
||||
}
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_merge_match_arms() {
|
||||
check_doc_test(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue