aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists/src/tests
diff options
context:
space:
mode:
authorunexge <[email protected]>2021-04-21 08:57:36 +0100
committerunexge <[email protected]>2021-04-21 08:57:36 +0100
commite0a60e71d7aab59858f62a16fce52ba35aeafc28 (patch)
tree759e3149a0f63017fac8374f9b763fb931f517fa /crates/ide_assists/src/tests
parent53599d11f6fec625bef69aeb699e657cfc37c310 (diff)
Add larger example for "Convert to named struct" assist
Diffstat (limited to 'crates/ide_assists/src/tests')
-rw-r--r--crates/ide_assists/src/tests/generated.rs34
1 files changed, 30 insertions, 4 deletions
diff --git a/crates/ide_assists/src/tests/generated.rs b/crates/ide_assists/src/tests/generated.rs
index 53f455adf..f4a4749c8 100644
--- a/crates/ide_assists/src/tests/generated.rs
+++ b/crates/ide_assists/src/tests/generated.rs
@@ -296,12 +296,38 @@ fn doctest_convert_tuple_struct_to_named_struct() {
296 check_doc_test( 296 check_doc_test(
297 "convert_tuple_struct_to_named_struct", 297 "convert_tuple_struct_to_named_struct",
298 r#####" 298 r#####"
299struct Inner; 299struct Point$0(f32, f32);
300struct A$0(Inner); 300
301impl Point {
302 pub fn new(x: f32, y: f32) -> Self {
303 Point(x, y)
304 }
305
306 pub fn x(&self) -> f32 {
307 self.0
308 }
309
310 pub fn y(&self) -> f32 {
311 self.1
312 }
313}
301"#####, 314"#####,
302 r#####" 315 r#####"
303struct Inner; 316struct Point { field1: f32, field2: f32 }
304struct A { field1: Inner } 317
318impl Point {
319 pub fn new(x: f32, y: f32) -> Self {
320 Point { field1: x, field2: y }
321 }
322
323 pub fn x(&self) -> f32 {
324 self.field1
325 }
326
327 pub fn y(&self) -> f32 {
328 self.field2
329 }
330}
305"#####, 331"#####,
306 ) 332 )
307} 333}