diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-28 02:21:45 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-28 02:21:45 +0100 |
commit | bca00ac340522fa15f0fa00c6652097f4e86085c (patch) | |
tree | 7a3ebc4a1414dbd3d9c2d85647cdda860c17efbe /crates/ide_completion/src/completions | |
parent | 3a1598c3bcbf089239c2fdff698b9c02670362b3 (diff) | |
parent | 1894db49b1e4c3200e9f561feb7f9891e54e1453 (diff) |
Merge #9033
9033: Complete keywords in (Assoc)ItemList with leading attribute r=Veykril a=Veykril
Fixes #7673
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r-- | crates/ide_completion/src/completions/keyword.rs | 15 |
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 } }", |