Merge #11261
11261: fix: Don't complete attributes with existing expressions r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11254 due to the comment being lowered to an attribute bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
54782428a6
@ -56,6 +56,7 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
|
||||
_ => (),
|
||||
},
|
||||
(_, Some(_)) => (),
|
||||
(_, None) if attribute.expr().is_some() => (),
|
||||
(_, None) => complete_new_attribute(acc, ctx, attribute),
|
||||
}
|
||||
Some(())
|
||||
|
@ -40,6 +40,19 @@ struct Foo;
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn proc_macros_on_comment() {
|
||||
check(
|
||||
r#"
|
||||
//- proc_macros: identity
|
||||
/// $0
|
||||
#[proc_macros::identity]
|
||||
struct Foo;
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn proc_macros_qualified() {
|
||||
check(
|
||||
|
Loading…
x
Reference in New Issue
Block a user