diff options
author | Kevaundray Wedderburn <[email protected]> | 2021-01-06 20:15:48 +0000 |
---|---|---|
committer | Kevaundray Wedderburn <[email protected]> | 2021-01-07 12:09:23 +0000 |
commit | 72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 (patch) | |
tree | c138363e3592c690d841aeedb9ac97d6b2ff4396 /crates/assists/src/handlers/change_visibility.rs | |
parent | 171c3c08fe245938fb25321394233de5fe2abc7c (diff) |
Change <|> to $0 - Rebase
Diffstat (limited to 'crates/assists/src/handlers/change_visibility.rs')
-rw-r--r-- | crates/assists/src/handlers/change_visibility.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/crates/assists/src/handlers/change_visibility.rs b/crates/assists/src/handlers/change_visibility.rs index 22d7c95d9..ac8c44124 100644 --- a/crates/assists/src/handlers/change_visibility.rs +++ b/crates/assists/src/handlers/change_visibility.rs | |||
@@ -13,7 +13,7 @@ use crate::{utils::vis_offset, AssistContext, AssistId, AssistKind, Assists}; | |||
13 | // Adds or changes existing visibility specifier. | 13 | // Adds or changes existing visibility specifier. |
14 | // | 14 | // |
15 | // ``` | 15 | // ``` |
16 | // <|>fn frobnicate() {} | 16 | // $0fn frobnicate() {} |
17 | // ``` | 17 | // ``` |
18 | // -> | 18 | // -> |
19 | // ``` | 19 | // ``` |
@@ -118,23 +118,23 @@ mod tests { | |||
118 | 118 | ||
119 | #[test] | 119 | #[test] |
120 | fn change_visibility_adds_pub_crate_to_items() { | 120 | fn change_visibility_adds_pub_crate_to_items() { |
121 | check_assist(change_visibility, "<|>fn foo() {}", "pub(crate) fn foo() {}"); | 121 | check_assist(change_visibility, "$0fn foo() {}", "pub(crate) fn foo() {}"); |
122 | check_assist(change_visibility, "f<|>n foo() {}", "pub(crate) fn foo() {}"); | 122 | check_assist(change_visibility, "f$0n foo() {}", "pub(crate) fn foo() {}"); |
123 | check_assist(change_visibility, "<|>struct Foo {}", "pub(crate) struct Foo {}"); | 123 | check_assist(change_visibility, "$0struct Foo {}", "pub(crate) struct Foo {}"); |
124 | check_assist(change_visibility, "<|>mod foo {}", "pub(crate) mod foo {}"); | 124 | check_assist(change_visibility, "$0mod foo {}", "pub(crate) mod foo {}"); |
125 | check_assist(change_visibility, "<|>trait Foo {}", "pub(crate) trait Foo {}"); | 125 | check_assist(change_visibility, "$0trait Foo {}", "pub(crate) trait Foo {}"); |
126 | check_assist(change_visibility, "m<|>od {}", "pub(crate) mod {}"); | 126 | check_assist(change_visibility, "m$0od {}", "pub(crate) mod {}"); |
127 | check_assist(change_visibility, "unsafe f<|>n foo() {}", "pub(crate) unsafe fn foo() {}"); | 127 | check_assist(change_visibility, "unsafe f$0n foo() {}", "pub(crate) unsafe fn foo() {}"); |
128 | } | 128 | } |
129 | 129 | ||
130 | #[test] | 130 | #[test] |
131 | fn change_visibility_works_with_struct_fields() { | 131 | fn change_visibility_works_with_struct_fields() { |
132 | check_assist( | 132 | check_assist( |
133 | change_visibility, | 133 | change_visibility, |
134 | r"struct S { <|>field: u32 }", | 134 | r"struct S { $0field: u32 }", |
135 | r"struct S { pub(crate) field: u32 }", | 135 | r"struct S { pub(crate) field: u32 }", |
136 | ); | 136 | ); |
137 | check_assist(change_visibility, r"struct S ( <|>u32 )", r"struct S ( pub(crate) u32 )"); | 137 | check_assist(change_visibility, r"struct S ( $0u32 )", r"struct S ( pub(crate) u32 )"); |
138 | } | 138 | } |
139 | 139 | ||
140 | #[test] | 140 | #[test] |
@@ -142,33 +142,33 @@ mod tests { | |||
142 | mark::check!(change_visibility_field_false_positive); | 142 | mark::check!(change_visibility_field_false_positive); |
143 | check_assist_not_applicable( | 143 | check_assist_not_applicable( |
144 | change_visibility, | 144 | change_visibility, |
145 | r"struct S { field: [(); { let <|>x = ();}] }", | 145 | r"struct S { field: [(); { let $0x = ();}] }", |
146 | ) | 146 | ) |
147 | } | 147 | } |
148 | 148 | ||
149 | #[test] | 149 | #[test] |
150 | fn change_visibility_pub_to_pub_crate() { | 150 | fn change_visibility_pub_to_pub_crate() { |
151 | check_assist(change_visibility, "<|>pub fn foo() {}", "pub(crate) fn foo() {}") | 151 | check_assist(change_visibility, "$0pub fn foo() {}", "pub(crate) fn foo() {}") |
152 | } | 152 | } |
153 | 153 | ||
154 | #[test] | 154 | #[test] |
155 | fn change_visibility_pub_crate_to_pub() { | 155 | fn change_visibility_pub_crate_to_pub() { |
156 | check_assist(change_visibility, "<|>pub(crate) fn foo() {}", "pub fn foo() {}") | 156 | check_assist(change_visibility, "$0pub(crate) fn foo() {}", "pub fn foo() {}") |
157 | } | 157 | } |
158 | 158 | ||
159 | #[test] | 159 | #[test] |
160 | fn change_visibility_const() { | 160 | fn change_visibility_const() { |
161 | check_assist(change_visibility, "<|>const FOO = 3u8;", "pub(crate) const FOO = 3u8;"); | 161 | check_assist(change_visibility, "$0const FOO = 3u8;", "pub(crate) const FOO = 3u8;"); |
162 | } | 162 | } |
163 | 163 | ||
164 | #[test] | 164 | #[test] |
165 | fn change_visibility_static() { | 165 | fn change_visibility_static() { |
166 | check_assist(change_visibility, "<|>static FOO = 3u8;", "pub(crate) static FOO = 3u8;"); | 166 | check_assist(change_visibility, "$0static FOO = 3u8;", "pub(crate) static FOO = 3u8;"); |
167 | } | 167 | } |
168 | 168 | ||
169 | #[test] | 169 | #[test] |
170 | fn change_visibility_type_alias() { | 170 | fn change_visibility_type_alias() { |
171 | check_assist(change_visibility, "<|>type T = ();", "pub(crate) type T = ();"); | 171 | check_assist(change_visibility, "$0type T = ();", "pub(crate) type T = ();"); |
172 | } | 172 | } |
173 | 173 | ||
174 | #[test] | 174 | #[test] |
@@ -181,7 +181,7 @@ mod tests { | |||
181 | // comments | 181 | // comments |
182 | 182 | ||
183 | #[derive(Debug)] | 183 | #[derive(Debug)] |
184 | <|>struct Foo; | 184 | $0struct Foo; |
185 | ", | 185 | ", |
186 | r" | 186 | r" |
187 | /// docs | 187 | /// docs |
@@ -199,14 +199,14 @@ mod tests { | |||
199 | check_assist_not_applicable( | 199 | check_assist_not_applicable( |
200 | change_visibility, | 200 | change_visibility, |
201 | r"mod foo { pub enum Foo {Foo1} } | 201 | r"mod foo { pub enum Foo {Foo1} } |
202 | fn main() { foo::Foo::Foo1<|> } ", | 202 | fn main() { foo::Foo::Foo1$0 } ", |
203 | ); | 203 | ); |
204 | } | 204 | } |
205 | 205 | ||
206 | #[test] | 206 | #[test] |
207 | fn change_visibility_target() { | 207 | fn change_visibility_target() { |
208 | check_assist_target(change_visibility, "<|>fn foo() {}", "fn"); | 208 | check_assist_target(change_visibility, "$0fn foo() {}", "fn"); |
209 | check_assist_target(change_visibility, "pub(crate)<|> fn foo() {}", "pub(crate)"); | 209 | check_assist_target(change_visibility, "pub(crate)$0 fn foo() {}", "pub(crate)"); |
210 | check_assist_target(change_visibility, "struct S { <|>field: u32 }", "field"); | 210 | check_assist_target(change_visibility, "struct S { $0field: u32 }", "field"); |
211 | } | 211 | } |
212 | } | 212 | } |