aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-05-28 02:20:55 +0100
committerLukas Wirth <[email protected]>2021-05-28 02:20:55 +0100
commit1894db49b1e4c3200e9f561feb7f9891e54e1453 (patch)
tree8c5bab7e516a4cd1f326faac127240d0678ad624 /crates/ide_completion/src/completions
parent9e71dd9799879fc9070f8717f8711fba5dae490a (diff)
Complete keywords in (Assoc)ItemList with leading attribute
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/keyword.rs15
1 files changed, 15 insertions, 0 deletions
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
@@ -395,6 +395,21 @@ fn quux() -> i32 {
395 } 395 }
396 396
397 #[test] 397 #[test]
398 fn test_keywords_in_impl_def_with_attr() {
399 check(
400 r"impl My { #[foo] $0 }",
401 expect![[r#"
402 kw fn
403 kw const
404 kw type
405 kw unsafe
406 kw pub(crate)
407 kw pub
408 "#]],
409 );
410 }
411
412 #[test]
398 fn test_keywords_in_loop() { 413 fn test_keywords_in_loop() {
399 check( 414 check(
400 r"fn my() { loop { $0 } }", 415 r"fn my() { loop { $0 } }",