aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/handlers/generate_new.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/handlers/generate_new.rs')
-rw-r--r--crates/assists/src/handlers/generate_new.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/crates/assists/src/handlers/generate_new.rs b/crates/assists/src/handlers/generate_new.rs
index c5fec4e0a..5c52b2bc8 100644
--- a/crates/assists/src/handlers/generate_new.rs
+++ b/crates/assists/src/handlers/generate_new.rs
@@ -14,7 +14,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists};
14// 14//
15// ``` 15// ```
16// struct Ctx<T: Clone> { 16// struct Ctx<T: Clone> {
17// data: T,<|> 17// data: T,$0
18// } 18// }
19// ``` 19// ```
20// -> 20// ->
@@ -182,7 +182,7 @@ mod tests {
182 // Check output of generation 182 // Check output of generation
183 check_assist( 183 check_assist(
184 generate_new, 184 generate_new,
185"struct Foo {<|>}", 185"struct Foo {$0}",
186"struct Foo {} 186"struct Foo {}
187 187
188impl Foo { 188impl Foo {
@@ -192,7 +192,7 @@ impl Foo {
192 ); 192 );
193 check_assist( 193 check_assist(
194 generate_new, 194 generate_new,
195"struct Foo<T: Clone> {<|>}", 195"struct Foo<T: Clone> {$0}",
196"struct Foo<T: Clone> {} 196"struct Foo<T: Clone> {}
197 197
198impl<T: Clone> Foo<T> { 198impl<T: Clone> Foo<T> {
@@ -202,7 +202,7 @@ impl<T: Clone> Foo<T> {
202 ); 202 );
203 check_assist( 203 check_assist(
204 generate_new, 204 generate_new,
205"struct Foo<'a, T: Foo<'a>> {<|>}", 205"struct Foo<'a, T: Foo<'a>> {$0}",
206"struct Foo<'a, T: Foo<'a>> {} 206"struct Foo<'a, T: Foo<'a>> {}
207 207
208impl<'a, T: Foo<'a>> Foo<'a, T> { 208impl<'a, T: Foo<'a>> Foo<'a, T> {
@@ -212,7 +212,7 @@ impl<'a, T: Foo<'a>> Foo<'a, T> {
212 ); 212 );
213 check_assist( 213 check_assist(
214 generate_new, 214 generate_new,
215"struct Foo { baz: String <|>}", 215"struct Foo { baz: String $0}",
216"struct Foo { baz: String } 216"struct Foo { baz: String }
217 217
218impl Foo { 218impl Foo {
@@ -222,7 +222,7 @@ impl Foo {
222 ); 222 );
223 check_assist( 223 check_assist(
224 generate_new, 224 generate_new,
225"struct Foo { baz: String, qux: Vec<i32> <|>}", 225"struct Foo { baz: String, qux: Vec<i32> $0}",
226"struct Foo { baz: String, qux: Vec<i32> } 226"struct Foo { baz: String, qux: Vec<i32> }
227 227
228impl Foo { 228impl Foo {
@@ -234,7 +234,7 @@ impl Foo {
234 // Check that visibility modifiers don't get brought in for fields 234 // Check that visibility modifiers don't get brought in for fields
235 check_assist( 235 check_assist(
236 generate_new, 236 generate_new,
237"struct Foo { pub baz: String, pub qux: Vec<i32> <|>}", 237"struct Foo { pub baz: String, pub qux: Vec<i32> $0}",
238"struct Foo { pub baz: String, pub qux: Vec<i32> } 238"struct Foo { pub baz: String, pub qux: Vec<i32> }
239 239
240impl Foo { 240impl Foo {
@@ -246,7 +246,7 @@ impl Foo {
246 // Check that it reuses existing impls 246 // Check that it reuses existing impls
247 check_assist( 247 check_assist(
248 generate_new, 248 generate_new,
249"struct Foo {<|>} 249"struct Foo {$0}
250 250
251impl Foo {} 251impl Foo {}
252", 252",
@@ -259,7 +259,7 @@ impl Foo {
259 ); 259 );
260 check_assist( 260 check_assist(
261 generate_new, 261 generate_new,
262"struct Foo {<|>} 262"struct Foo {$0}
263 263
264impl Foo { 264impl Foo {
265 fn qux(&self) {} 265 fn qux(&self) {}
@@ -277,7 +277,7 @@ impl Foo {
277 277
278 check_assist( 278 check_assist(
279 generate_new, 279 generate_new,
280"struct Foo {<|>} 280"struct Foo {$0}
281 281
282impl Foo { 282impl Foo {
283 fn qux(&self) {} 283 fn qux(&self) {}
@@ -302,7 +302,7 @@ impl Foo {
302 // Check visibility of new fn based on struct 302 // Check visibility of new fn based on struct
303 check_assist( 303 check_assist(
304 generate_new, 304 generate_new,
305"pub struct Foo {<|>}", 305"pub struct Foo {$0}",
306"pub struct Foo {} 306"pub struct Foo {}
307 307
308impl Foo { 308impl Foo {
@@ -312,7 +312,7 @@ impl Foo {
312 ); 312 );
313 check_assist( 313 check_assist(
314 generate_new, 314 generate_new,
315"pub(crate) struct Foo {<|>}", 315"pub(crate) struct Foo {$0}",
316"pub(crate) struct Foo {} 316"pub(crate) struct Foo {}
317 317
318impl Foo { 318impl Foo {
@@ -327,7 +327,7 @@ impl Foo {
327 check_assist_not_applicable( 327 check_assist_not_applicable(
328 generate_new, 328 generate_new,
329 " 329 "
330struct Foo {<|>} 330struct Foo {$0}
331 331
332impl Foo { 332impl Foo {
333 fn new() -> Self { 333 fn new() -> Self {
@@ -339,7 +339,7 @@ impl Foo {
339 check_assist_not_applicable( 339 check_assist_not_applicable(
340 generate_new, 340 generate_new,
341 " 341 "
342struct Foo {<|>} 342struct Foo {$0}
343 343
344impl Foo { 344impl Foo {
345 fn New() -> Self { 345 fn New() -> Self {
@@ -356,7 +356,7 @@ impl Foo {
356 " 356 "
357struct SomeThingIrrelevant; 357struct SomeThingIrrelevant;
358/// Has a lifetime parameter 358/// Has a lifetime parameter
359struct Foo<'a, T: Foo<'a>> {<|>} 359struct Foo<'a, T: Foo<'a>> {$0}
360struct EvenMoreIrrelevant; 360struct EvenMoreIrrelevant;
361", 361",
362 "/// Has a lifetime parameter 362 "/// Has a lifetime parameter
@@ -381,7 +381,7 @@ impl<N: AstNode> AstId<N> {
381} 381}
382 382
383pub struct Source<T> { 383pub struct Source<T> {
384 pub file_id: HirFileId,<|> 384 pub file_id: HirFileId,$0
385 pub ast: T, 385 pub ast: T,
386} 386}
387 387