diff options
author | Hoàng Đức Hiếu <[email protected]> | 2019-02-03 13:12:57 +0000 |
---|---|---|
committer | Hoàng Đức Hiếu <[email protected]> | 2019-02-03 13:12:57 +0000 |
commit | 9dd7ccf609745334ece375b5cf0918131365b7bd (patch) | |
tree | 998997041361209c39af91124b9b1aae0135a762 /crates | |
parent | 1c5a63e3dbb53654dbc2fd10492d46f373192ab4 (diff) |
fold complete_postfix tests into one
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_postfix.rs | 43 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion2.snap | 123 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion3.snap | 123 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion4.snap | 123 | ||||
-rw-r--r-- | crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap (renamed from crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion1.snap) | 2 |
5 files changed, 3 insertions, 411 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index af25452b8..e3a739d6d 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide_api/src/completion/complete_postfix.rs | |||
@@ -56,9 +56,9 @@ mod tests { | |||
56 | } | 56 | } |
57 | 57 | ||
58 | #[test] | 58 | #[test] |
59 | fn test_filter_postfix_completion1() { | 59 | fn postfix_completion_works_for_trivial_path_expression() { |
60 | check_snippet_completion( | 60 | check_snippet_completion( |
61 | "filter_postfix_completion1", | 61 | "postfix_completion_works_for_trivial_path_expression", |
62 | r#" | 62 | r#" |
63 | fn main() { | 63 | fn main() { |
64 | let bar = "a"; | 64 | let bar = "a"; |
@@ -67,43 +67,4 @@ mod tests { | |||
67 | "#, | 67 | "#, |
68 | ); | 68 | ); |
69 | } | 69 | } |
70 | |||
71 | #[test] | ||
72 | fn test_filter_postfix_completion2() { | ||
73 | check_snippet_completion( | ||
74 | "filter_postfix_completion2", | ||
75 | r#" | ||
76 | fn main() { | ||
77 | let bar = "a"; | ||
78 | bar.i<|> | ||
79 | } | ||
80 | "#, | ||
81 | ); | ||
82 | } | ||
83 | |||
84 | #[test] | ||
85 | fn test_filter_postfix_completion3() { | ||
86 | check_snippet_completion( | ||
87 | "filter_postfix_completion3", | ||
88 | r#" | ||
89 | fn main() { | ||
90 | let bar = "a"; | ||
91 | bar.if<|> | ||
92 | } | ||
93 | "#, | ||
94 | ); | ||
95 | } | ||
96 | |||
97 | #[test] | ||
98 | fn test_filter_postfix_completion4() { | ||
99 | check_snippet_completion( | ||
100 | "filter_postfix_completion4", | ||
101 | r#" | ||
102 | fn main() { | ||
103 | let bar = "a"; | ||
104 | bar.dbg<|> | ||
105 | } | ||
106 | "#, | ||
107 | ); | ||
108 | } | ||
109 | } | 70 | } |
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion2.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion2.snap deleted file mode 100644 index b46366d88..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion2.snap +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | --- | ||
2 | created: "2019-02-02T15:08:34.016388824+00:00" | ||
3 | creator: [email protected] | ||
4 | expression: kind_completions | ||
5 | source: crates/ra_ide_api/src/completion/completion_item.rs | ||
6 | --- | ||
7 | [ | ||
8 | CompletionItem { | ||
9 | completion_kind: Postfix, | ||
10 | label: "dbg", | ||
11 | kind: None, | ||
12 | detail: None, | ||
13 | documentation: None, | ||
14 | lookup: None, | ||
15 | insert_text: Some( | ||
16 | "dbg!(bar)" | ||
17 | ), | ||
18 | insert_text_format: Snippet, | ||
19 | source_range: [76; 77), | ||
20 | text_edit: Some( | ||
21 | TextEdit { | ||
22 | atoms: [ | ||
23 | AtomTextEdit { | ||
24 | delete: [72; 76), | ||
25 | insert: "" | ||
26 | } | ||
27 | ] | ||
28 | } | ||
29 | ) | ||
30 | }, | ||
31 | CompletionItem { | ||
32 | completion_kind: Postfix, | ||
33 | label: "if", | ||
34 | kind: None, | ||
35 | detail: None, | ||
36 | documentation: None, | ||
37 | lookup: None, | ||
38 | insert_text: Some( | ||
39 | "if bar {$0}" | ||
40 | ), | ||
41 | insert_text_format: Snippet, | ||
42 | source_range: [76; 77), | ||
43 | text_edit: Some( | ||
44 | TextEdit { | ||
45 | atoms: [ | ||
46 | AtomTextEdit { | ||
47 | delete: [72; 76), | ||
48 | insert: "" | ||
49 | } | ||
50 | ] | ||
51 | } | ||
52 | ) | ||
53 | }, | ||
54 | CompletionItem { | ||
55 | completion_kind: Postfix, | ||
56 | label: "match", | ||
57 | kind: None, | ||
58 | detail: None, | ||
59 | documentation: None, | ||
60 | lookup: None, | ||
61 | insert_text: Some( | ||
62 | "match bar {\n${1:_} => {$0\\},\n}" | ||
63 | ), | ||
64 | insert_text_format: Snippet, | ||
65 | source_range: [76; 77), | ||
66 | text_edit: Some( | ||
67 | TextEdit { | ||
68 | atoms: [ | ||
69 | AtomTextEdit { | ||
70 | delete: [72; 76), | ||
71 | insert: "" | ||
72 | } | ||
73 | ] | ||
74 | } | ||
75 | ) | ||
76 | }, | ||
77 | CompletionItem { | ||
78 | completion_kind: Postfix, | ||
79 | label: "not", | ||
80 | kind: None, | ||
81 | detail: None, | ||
82 | documentation: None, | ||
83 | lookup: None, | ||
84 | insert_text: Some( | ||
85 | "!bar" | ||
86 | ), | ||
87 | insert_text_format: Snippet, | ||
88 | source_range: [76; 77), | ||
89 | text_edit: Some( | ||
90 | TextEdit { | ||
91 | atoms: [ | ||
92 | AtomTextEdit { | ||
93 | delete: [72; 76), | ||
94 | insert: "" | ||
95 | } | ||
96 | ] | ||
97 | } | ||
98 | ) | ||
99 | }, | ||
100 | CompletionItem { | ||
101 | completion_kind: Postfix, | ||
102 | label: "while", | ||
103 | kind: None, | ||
104 | detail: None, | ||
105 | documentation: None, | ||
106 | lookup: None, | ||
107 | insert_text: Some( | ||
108 | "while bar {\n$0\n}" | ||
109 | ), | ||
110 | insert_text_format: Snippet, | ||
111 | source_range: [76; 77), | ||
112 | text_edit: Some( | ||
113 | TextEdit { | ||
114 | atoms: [ | ||
115 | AtomTextEdit { | ||
116 | delete: [72; 76), | ||
117 | insert: "" | ||
118 | } | ||
119 | ] | ||
120 | } | ||
121 | ) | ||
122 | } | ||
123 | ] | ||
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion3.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion3.snap deleted file mode 100644 index 3f865cf93..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion3.snap +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | --- | ||
2 | created: "2019-02-02T15:08:34.060136941+00:00" | ||
3 | creator: [email protected] | ||
4 | expression: kind_completions | ||
5 | source: crates/ra_ide_api/src/completion/completion_item.rs | ||
6 | --- | ||
7 | [ | ||
8 | CompletionItem { | ||
9 | completion_kind: Postfix, | ||
10 | label: "dbg", | ||
11 | kind: None, | ||
12 | detail: None, | ||
13 | documentation: None, | ||
14 | lookup: None, | ||
15 | insert_text: Some( | ||
16 | "dbg!(bar)" | ||
17 | ), | ||
18 | insert_text_format: Snippet, | ||
19 | source_range: [78; 78), | ||
20 | text_edit: Some( | ||
21 | TextEdit { | ||
22 | atoms: [ | ||
23 | AtomTextEdit { | ||
24 | delete: [72; 78), | ||
25 | insert: "" | ||
26 | } | ||
27 | ] | ||
28 | } | ||
29 | ) | ||
30 | }, | ||
31 | CompletionItem { | ||
32 | completion_kind: Postfix, | ||
33 | label: "if", | ||
34 | kind: None, | ||
35 | detail: None, | ||
36 | documentation: None, | ||
37 | lookup: None, | ||
38 | insert_text: Some( | ||
39 | "if bar {$0}" | ||
40 | ), | ||
41 | insert_text_format: Snippet, | ||
42 | source_range: [78; 78), | ||
43 | text_edit: Some( | ||
44 | TextEdit { | ||
45 | atoms: [ | ||
46 | AtomTextEdit { | ||
47 | delete: [72; 78), | ||
48 | insert: "" | ||
49 | } | ||
50 | ] | ||
51 | } | ||
52 | ) | ||
53 | }, | ||
54 | CompletionItem { | ||
55 | completion_kind: Postfix, | ||
56 | label: "match", | ||
57 | kind: None, | ||
58 | detail: None, | ||
59 | documentation: None, | ||
60 | lookup: None, | ||
61 | insert_text: Some( | ||
62 | "match bar {\n${1:_} => {$0\\},\n}" | ||
63 | ), | ||
64 | insert_text_format: Snippet, | ||
65 | source_range: [78; 78), | ||
66 | text_edit: Some( | ||
67 | TextEdit { | ||
68 | atoms: [ | ||
69 | AtomTextEdit { | ||
70 | delete: [72; 78), | ||
71 | insert: "" | ||
72 | } | ||
73 | ] | ||
74 | } | ||
75 | ) | ||
76 | }, | ||
77 | CompletionItem { | ||
78 | completion_kind: Postfix, | ||
79 | label: "not", | ||
80 | kind: None, | ||
81 | detail: None, | ||
82 | documentation: None, | ||
83 | lookup: None, | ||
84 | insert_text: Some( | ||
85 | "!bar" | ||
86 | ), | ||
87 | insert_text_format: Snippet, | ||
88 | source_range: [78; 78), | ||
89 | text_edit: Some( | ||
90 | TextEdit { | ||
91 | atoms: [ | ||
92 | AtomTextEdit { | ||
93 | delete: [72; 78), | ||
94 | insert: "" | ||
95 | } | ||
96 | ] | ||
97 | } | ||
98 | ) | ||
99 | }, | ||
100 | CompletionItem { | ||
101 | completion_kind: Postfix, | ||
102 | label: "while", | ||
103 | kind: None, | ||
104 | detail: None, | ||
105 | documentation: None, | ||
106 | lookup: None, | ||
107 | insert_text: Some( | ||
108 | "while bar {\n$0\n}" | ||
109 | ), | ||
110 | insert_text_format: Snippet, | ||
111 | source_range: [78; 78), | ||
112 | text_edit: Some( | ||
113 | TextEdit { | ||
114 | atoms: [ | ||
115 | AtomTextEdit { | ||
116 | delete: [72; 78), | ||
117 | insert: "" | ||
118 | } | ||
119 | ] | ||
120 | } | ||
121 | ) | ||
122 | } | ||
123 | ] | ||
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion4.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion4.snap deleted file mode 100644 index da1033e7c..000000000 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion4.snap +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | --- | ||
2 | created: "2019-02-02T15:08:34.069147268+00:00" | ||
3 | creator: [email protected] | ||
4 | expression: kind_completions | ||
5 | source: crates/ra_ide_api/src/completion/completion_item.rs | ||
6 | --- | ||
7 | [ | ||
8 | CompletionItem { | ||
9 | completion_kind: Postfix, | ||
10 | label: "dbg", | ||
11 | kind: None, | ||
12 | detail: None, | ||
13 | documentation: None, | ||
14 | lookup: None, | ||
15 | insert_text: Some( | ||
16 | "dbg!(bar)" | ||
17 | ), | ||
18 | insert_text_format: Snippet, | ||
19 | source_range: [78; 78), | ||
20 | text_edit: Some( | ||
21 | TextEdit { | ||
22 | atoms: [ | ||
23 | AtomTextEdit { | ||
24 | delete: [72; 78), | ||
25 | insert: "" | ||
26 | } | ||
27 | ] | ||
28 | } | ||
29 | ) | ||
30 | }, | ||
31 | CompletionItem { | ||
32 | completion_kind: Postfix, | ||
33 | label: "if", | ||
34 | kind: None, | ||
35 | detail: None, | ||
36 | documentation: None, | ||
37 | lookup: None, | ||
38 | insert_text: Some( | ||
39 | "if bar {$0}" | ||
40 | ), | ||
41 | insert_text_format: Snippet, | ||
42 | source_range: [78; 78), | ||
43 | text_edit: Some( | ||
44 | TextEdit { | ||
45 | atoms: [ | ||
46 | AtomTextEdit { | ||
47 | delete: [72; 78), | ||
48 | insert: "" | ||
49 | } | ||
50 | ] | ||
51 | } | ||
52 | ) | ||
53 | }, | ||
54 | CompletionItem { | ||
55 | completion_kind: Postfix, | ||
56 | label: "match", | ||
57 | kind: None, | ||
58 | detail: None, | ||
59 | documentation: None, | ||
60 | lookup: None, | ||
61 | insert_text: Some( | ||
62 | "match bar {\n${1:_} => {$0\\},\n}" | ||
63 | ), | ||
64 | insert_text_format: Snippet, | ||
65 | source_range: [78; 78), | ||
66 | text_edit: Some( | ||
67 | TextEdit { | ||
68 | atoms: [ | ||
69 | AtomTextEdit { | ||
70 | delete: [72; 78), | ||
71 | insert: "" | ||
72 | } | ||
73 | ] | ||
74 | } | ||
75 | ) | ||
76 | }, | ||
77 | CompletionItem { | ||
78 | completion_kind: Postfix, | ||
79 | label: "not", | ||
80 | kind: None, | ||
81 | detail: None, | ||
82 | documentation: None, | ||
83 | lookup: None, | ||
84 | insert_text: Some( | ||
85 | "!bar" | ||
86 | ), | ||
87 | insert_text_format: Snippet, | ||
88 | source_range: [78; 78), | ||
89 | text_edit: Some( | ||
90 | TextEdit { | ||
91 | atoms: [ | ||
92 | AtomTextEdit { | ||
93 | delete: [72; 78), | ||
94 | insert: "" | ||
95 | } | ||
96 | ] | ||
97 | } | ||
98 | ) | ||
99 | }, | ||
100 | CompletionItem { | ||
101 | completion_kind: Postfix, | ||
102 | label: "while", | ||
103 | kind: None, | ||
104 | detail: None, | ||
105 | documentation: None, | ||
106 | lookup: None, | ||
107 | insert_text: Some( | ||
108 | "while bar {\n$0\n}" | ||
109 | ), | ||
110 | insert_text_format: Snippet, | ||
111 | source_range: [78; 78), | ||
112 | text_edit: Some( | ||
113 | TextEdit { | ||
114 | atoms: [ | ||
115 | AtomTextEdit { | ||
116 | delete: [72; 78), | ||
117 | insert: "" | ||
118 | } | ||
119 | ] | ||
120 | } | ||
121 | ) | ||
122 | } | ||
123 | ] | ||
diff --git a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion1.snap b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap index 840ec4881..bc886ef0b 100644 --- a/crates/ra_ide_api/src/completion/snapshots/completion_item__filter_postfix_completion1.snap +++ b/crates/ra_ide_api/src/completion/snapshots/completion_item__postfix_completion_works_for_trivial_path_expression.snap | |||
@@ -1,5 +1,5 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-02-02T15:08:34.016389802+00:00" | 2 | created: "2019-02-03T11:38:42.897384636+00:00" |
3 | creator: [email protected] | 3 | creator: [email protected] |
4 | expression: kind_completions | 4 | expression: kind_completions |
5 | source: crates/ra_ide_api/src/completion/completion_item.rs | 5 | source: crates/ra_ide_api/src/completion/completion_item.rs |