aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_record_literal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_record_literal.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_record_literal.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_record_literal.rs b/crates/ra_ide_api/src/completion/complete_record_literal.rs
index 4406695d5..0295b8101 100644
--- a/crates/ra_ide_api/src/completion/complete_record_literal.rs
+++ b/crates/ra_ide_api/src/completion/complete_record_literal.rs
@@ -32,6 +32,34 @@ mod tests {
32 } 32 }
33 33
34 #[test] 34 #[test]
35 fn test_record_literal_deprecated_field() {
36 let completions = complete(
37 r"
38 struct A {
39 #[deprecated]
40 the_field: u32,
41 }
42 fn foo() {
43 A { the<|> }
44 }
45 ",
46 );
47 assert_debug_snapshot!(completions, @r###"
48 ⋮[
49 ⋮ CompletionItem {
50 ⋮ label: "the_field",
51 ⋮ source_range: [142; 145),
52 ⋮ delete: [142; 145),
53 ⋮ insert: "the_field",
54 ⋮ kind: Field,
55 ⋮ detail: "u32",
56 ⋮ deprecated: true,
57 ⋮ },
58 ⋮]
59 "###);
60 }
61
62 #[test]
35 fn test_record_literal_field() { 63 fn test_record_literal_field() {
36 let completions = complete( 64 let completions = complete(
37 r" 65 r"