mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
Don't complete keywords in attributes inside expressions
This commit is contained in:
parent
2a48b53220
commit
2ac03ef1d6
@ -786,13 +786,13 @@ mod tests {
|
||||
at target_feature = "…"
|
||||
at test
|
||||
at track_caller
|
||||
kw return
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn complete_attribute_on_expr() {
|
||||
cov_mark::check!(no_keyword_completion_in_attr_of_expr);
|
||||
check(
|
||||
r#"fn main() { #[$0] foo() }"#,
|
||||
expect![[r#"
|
||||
@ -802,7 +802,6 @@ mod tests {
|
||||
at deny(…)
|
||||
at forbid(…)
|
||||
at warn(…)
|
||||
kw return
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
@ -48,6 +48,10 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte
|
||||
cov_mark::hit!(no_keyword_completion_in_record_lit);
|
||||
return;
|
||||
}
|
||||
if ctx.attribute_under_caret.is_some() {
|
||||
cov_mark::hit!(no_keyword_completion_in_attr_of_expr);
|
||||
return;
|
||||
}
|
||||
|
||||
// Suggest .await syntax for types that implement Future trait
|
||||
if let Some(receiver) = ctx.dot_receiver() {
|
||||
|
Loading…
Reference in New Issue
Block a user