aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_record_literal.rs
diff options
context:
space:
mode:
authorSeivan Heidari <[email protected]>2019-11-04 12:45:27 +0000
committerSeivan Heidari <[email protected]>2019-11-04 12:45:27 +0000
commitdad9bc6caad71e6aebb92ad9883c08d30431e9b1 (patch)
tree6495d47108bc56ab0fbb358125fe65ebece8934f /crates/ra_ide_api/src/completion/complete_record_literal.rs
parent1d8bb4c6c1fef1f8ea513e07d0a7d4c5483129d2 (diff)
parentcc2d75d0f88bdcb1b3e20db36decb6ee6eca517a (diff)
Merge branch 'master' into feature/themes
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"