Skip to content

Commit ecac8e3

Browse files
committed
Format and codegen for attr
1 parent 1141259 commit ecac8e3

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

crates/ide-assists/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ mod handlers {
344344
unqualify_method_call::unqualify_method_call,
345345
wrap_return_type_in_result::wrap_return_type_in_result,
346346
wrap_unwrap_cfg_attr::wrap_unwrap_cfg_attr,
347-
347+
348348
// These are manually sorted for better priorities. By default,
349349
// priority is determined by the size of the target range (smaller
350350
// target wins). If the ranges are equal, position in this list is

crates/ide-assists/src/tests/generated.rs

+19
Original file line numberDiff line numberDiff line change
@@ -3151,3 +3151,22 @@ fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
31513151
"#####,
31523152
)
31533153
}
3154+
3155+
#[test]
3156+
fn doctest_wrap_unwrap_cfg_attr() {
3157+
check_doc_test(
3158+
"wrap_unwrap_cfg_attr",
3159+
r#####"
3160+
#[derive$0(Debug)]
3161+
struct S {
3162+
field: i32
3163+
}
3164+
"#####,
3165+
r#####"
3166+
#[cfg_attr($0, derive(Debug))]
3167+
struct S {
3168+
field: i32
3169+
}
3170+
"#####,
3171+
)
3172+
}

0 commit comments

Comments
 (0)