mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Don't complete attributes with existing expressions
This commit is contained in:
parent
a3393c9a57
commit
51419c1931
2 changed files with 14 additions and 0 deletions
|
@ -56,6 +56,7 @@ pub(crate) fn complete_attribute(acc: &mut Completions, ctx: &CompletionContext)
|
||||||
_ => (),
|
_ => (),
|
||||||
},
|
},
|
||||||
(_, Some(_)) => (),
|
(_, Some(_)) => (),
|
||||||
|
(_, None) if attribute.expr().is_some() => (),
|
||||||
(_, None) => complete_new_attribute(acc, ctx, attribute),
|
(_, None) => complete_new_attribute(acc, ctx, attribute),
|
||||||
}
|
}
|
||||||
Some(())
|
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]
|
#[test]
|
||||||
fn proc_macros_qualified() {
|
fn proc_macros_qualified() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue