We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc54775 commit d327f30Copy full SHA for d327f30
crates/ide-assists/src/handlers/extract_function.rs
@@ -5976,6 +5976,37 @@ fn $0fun_name() -> ControlFlow<()> {
5976
);
5977
}
5978
5979
+ #[test]
5980
+ fn comments_in_block_expr() {
5981
+ check_assist(
5982
+ extract_function,
5983
+ r#"
5984
+fn f() {
5985
+ let c = $0{
5986
+ // comment 1
5987
+ let a = 2 + 3;
5988
+ // comment 2
5989
+ let b = 5;
5990
+ a + b
5991
+ }$0;
5992
+}
5993
+"#,
5994
5995
5996
+ let c = fun_name();
5997
5998
+
5999
+fn $0fun_name() -> i32 {
6000
6001
6002
6003
6004
6005
6006
6007
+ );
6008
+ }
6009
6010
#[test]
6011
fn in_left_curly_is_not_applicable() {
6012
cov_mark::check!(extract_function_in_braces_is_not_applicable);
0 commit comments