From 1894db49b1e4c3200e9f561feb7f9891e54e1453 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 28 May 2021 03:20:55 +0200 Subject: Complete keywords in (Assoc)ItemList with leading attribute --- crates/ide_completion/src/completions/keyword.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/ide_completion/src/completions/keyword.rs') diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs index 96447a603..c9673df85 100644 --- a/crates/ide_completion/src/completions/keyword.rs +++ b/crates/ide_completion/src/completions/keyword.rs @@ -394,6 +394,21 @@ fn quux() -> i32 { ); } + #[test] + fn test_keywords_in_impl_def_with_attr() { + check( + r"impl My { #[foo] $0 }", + expect![[r#" + kw fn + kw const + kw type + kw unsafe + kw pub(crate) + kw pub + "#]], + ); + } + #[test] fn test_keywords_in_loop() { check( -- cgit v1.2.3