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 24ab69c commit 09a78caCopy full SHA for 09a78ca
crates/ide_assists/src/handlers/extract_function.rs
@@ -3384,4 +3384,36 @@ fn foo() -> Result<(), i64> {
3384
}"##,
3385
);
3386
}
3387
+
3388
+ #[test]
3389
+ fn param_usage_in_macro() {
3390
+ check_assist(
3391
+ extract_function,
3392
+ r"
3393
+macro_rules! m {
3394
+ ($val:expr) => { $val };
3395
+}
3396
3397
+fn foo() {
3398
+ let n = 1;
3399
+ $0let k = n * m!(n);$0
3400
+ let m = k + 1;
3401
+}",
3402
3403
3404
3405
3406
3407
3408
3409
+ let k = fun_name(n);
3410
3411
3412
3413
+fn $0fun_name(n: i32) -> i32 {
3414
+ let k = n * m!(n);
3415
+ k
3416
3417
+ );
3418
+ }
3419
0 commit comments