aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_assists/src/doc_tests/generated.rs2
-rw-r--r--crates/ra_assists/src/handlers/add_function.rs54
-rw-r--r--docs/user/assists.md2
-rw-r--r--xtask/tests/tidy-tests/main.rs1
4 files changed, 30 insertions, 29 deletions
diff --git a/crates/ra_assists/src/doc_tests/generated.rs b/crates/ra_assists/src/doc_tests/generated.rs
index b63b4d81a..b39e60870 100644
--- a/crates/ra_assists/src/doc_tests/generated.rs
+++ b/crates/ra_assists/src/doc_tests/generated.rs
@@ -78,7 +78,7 @@ fn foo() {
78} 78}
79 79
80fn bar(arg: &str, baz: Baz) { 80fn bar(arg: &str, baz: Baz) {
81 unimplemented!() 81 todo!()
82} 82}
83 83
84"#####, 84"#####,
diff --git a/crates/ra_assists/src/handlers/add_function.rs b/crates/ra_assists/src/handlers/add_function.rs
index 488bae08f..ad4ab66ed 100644
--- a/crates/ra_assists/src/handlers/add_function.rs
+++ b/crates/ra_assists/src/handlers/add_function.rs
@@ -29,7 +29,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
29// } 29// }
30// 30//
31// fn bar(arg: &str, baz: Baz) { 31// fn bar(arg: &str, baz: Baz) {
32// unimplemented!() 32// todo!()
33// } 33// }
34// 34//
35// ``` 35// ```
@@ -80,7 +80,7 @@ impl FunctionBuilder {
80 Some(Self { append_fn_at, fn_name, type_params, params }) 80 Some(Self { append_fn_at, fn_name, type_params, params })
81 } 81 }
82 fn render(self) -> Option<FunctionTemplate> { 82 fn render(self) -> Option<FunctionTemplate> {
83 let placeholder_expr = ast::make::expr_unimplemented(); 83 let placeholder_expr = ast::make::expr_todo();
84 let fn_body = ast::make::block_expr(vec![], Some(placeholder_expr)); 84 let fn_body = ast::make::block_expr(vec![], Some(placeholder_expr));
85 let fn_def = ast::make::fn_def(self.fn_name, self.type_params, self.params, fn_body); 85 let fn_def = ast::make::fn_def(self.fn_name, self.type_params, self.params, fn_body);
86 let fn_def = ast::make::add_newlines(2, fn_def); 86 let fn_def = ast::make::add_newlines(2, fn_def);
@@ -225,7 +225,7 @@ fn foo() {
225} 225}
226 226
227fn bar() { 227fn bar() {
228 <|>unimplemented!() 228 <|>todo!()
229} 229}
230", 230",
231 ) 231 )
@@ -252,7 +252,7 @@ impl Foo {
252} 252}
253 253
254fn bar() { 254fn bar() {
255 <|>unimplemented!() 255 <|>todo!()
256} 256}
257", 257",
258 ) 258 )
@@ -276,7 +276,7 @@ fn foo1() {
276} 276}
277 277
278fn bar() { 278fn bar() {
279 <|>unimplemented!() 279 <|>todo!()
280} 280}
281 281
282fn foo2() {} 282fn foo2() {}
@@ -302,7 +302,7 @@ mod baz {
302 } 302 }
303 303
304 fn bar() { 304 fn bar() {
305 <|>unimplemented!() 305 <|>todo!()
306 } 306 }
307} 307}
308", 308",
@@ -315,20 +315,20 @@ mod baz {
315 add_function, 315 add_function,
316 r" 316 r"
317struct Baz; 317struct Baz;
318fn baz() -> Baz { unimplemented!() } 318fn baz() -> Baz { todo!() }
319fn foo() { 319fn foo() {
320 bar<|>(baz()); 320 bar<|>(baz());
321} 321}
322", 322",
323 r" 323 r"
324struct Baz; 324struct Baz;
325fn baz() -> Baz { unimplemented!() } 325fn baz() -> Baz { todo!() }
326fn foo() { 326fn foo() {
327 bar(baz()); 327 bar(baz());
328} 328}
329 329
330fn bar(baz: Baz) { 330fn bar(baz: Baz) {
331 <|>unimplemented!() 331 <|>todo!()
332} 332}
333", 333",
334 ); 334 );
@@ -361,7 +361,7 @@ impl Baz {
361} 361}
362 362
363fn bar(baz: Baz) { 363fn bar(baz: Baz) {
364 <|>unimplemented!() 364 <|>todo!()
365} 365}
366", 366",
367 ) 367 )
@@ -382,7 +382,7 @@ fn foo() {
382} 382}
383 383
384fn bar(arg: &str) { 384fn bar(arg: &str) {
385 <|>unimplemented!() 385 <|>todo!()
386} 386}
387"#, 387"#,
388 ) 388 )
@@ -403,7 +403,7 @@ fn foo() {
403} 403}
404 404
405fn bar(arg: char) { 405fn bar(arg: char) {
406 <|>unimplemented!() 406 <|>todo!()
407} 407}
408"#, 408"#,
409 ) 409 )
@@ -424,7 +424,7 @@ fn foo() {
424} 424}
425 425
426fn bar(arg: i32) { 426fn bar(arg: i32) {
427 <|>unimplemented!() 427 <|>todo!()
428} 428}
429", 429",
430 ) 430 )
@@ -445,7 +445,7 @@ fn foo() {
445} 445}
446 446
447fn bar(arg: u8) { 447fn bar(arg: u8) {
448 <|>unimplemented!() 448 <|>todo!()
449} 449}
450", 450",
451 ) 451 )
@@ -470,7 +470,7 @@ fn foo() {
470} 470}
471 471
472fn bar(x: u8) { 472fn bar(x: u8) {
473 <|>unimplemented!() 473 <|>todo!()
474} 474}
475", 475",
476 ) 476 )
@@ -493,7 +493,7 @@ fn foo() {
493} 493}
494 494
495fn bar(worble: ()) { 495fn bar(worble: ()) {
496 <|>unimplemented!() 496 <|>todo!()
497} 497}
498", 498",
499 ) 499 )
@@ -506,7 +506,7 @@ fn bar(worble: ()) {
506 r" 506 r"
507trait Foo {} 507trait Foo {}
508fn foo() -> impl Foo { 508fn foo() -> impl Foo {
509 unimplemented!() 509 todo!()
510} 510}
511fn baz() { 511fn baz() {
512 <|>bar(foo()) 512 <|>bar(foo())
@@ -515,14 +515,14 @@ fn baz() {
515 r" 515 r"
516trait Foo {} 516trait Foo {}
517fn foo() -> impl Foo { 517fn foo() -> impl Foo {
518 unimplemented!() 518 todo!()
519} 519}
520fn baz() { 520fn baz() {
521 bar(foo()) 521 bar(foo())
522} 522}
523 523
524fn bar(foo: impl Foo) { 524fn bar(foo: impl Foo) {
525 <|>unimplemented!() 525 <|>todo!()
526} 526}
527", 527",
528 ) 528 )
@@ -556,7 +556,7 @@ mod Foo {
556 } 556 }
557 557
558 fn bar(baz: super::Baz::Bof) { 558 fn bar(baz: super::Baz::Bof) {
559 <|>unimplemented!() 559 <|>todo!()
560 } 560 }
561} 561}
562", 562",
@@ -580,7 +580,7 @@ fn foo<T>(t: T) {
580} 580}
581 581
582fn bar<T>(t: T) { 582fn bar<T>(t: T) {
583 <|>unimplemented!() 583 <|>todo!()
584} 584}
585", 585",
586 ) 586 )
@@ -611,7 +611,7 @@ fn foo() {
611} 611}
612 612
613fn bar(arg: fn() -> Baz) { 613fn bar(arg: fn() -> Baz) {
614 <|>unimplemented!() 614 <|>todo!()
615} 615}
616", 616",
617 ) 617 )
@@ -636,7 +636,7 @@ fn foo() {
636} 636}
637 637
638fn bar(closure: impl Fn(i64) -> i64) { 638fn bar(closure: impl Fn(i64) -> i64) {
639 <|>unimplemented!() 639 <|>todo!()
640} 640}
641", 641",
642 ) 642 )
@@ -657,7 +657,7 @@ fn foo() {
657} 657}
658 658
659fn bar(baz: ()) { 659fn bar(baz: ()) {
660 <|>unimplemented!() 660 <|>todo!()
661} 661}
662", 662",
663 ) 663 )
@@ -682,7 +682,7 @@ fn foo() {
682} 682}
683 683
684fn bar(baz_1: Baz, baz_2: Baz) { 684fn bar(baz_1: Baz, baz_2: Baz) {
685 <|>unimplemented!() 685 <|>todo!()
686} 686}
687", 687",
688 ) 688 )
@@ -707,7 +707,7 @@ fn foo() {
707} 707}
708 708
709fn bar(baz_1: Baz, baz_2: Baz, arg_1: &str, arg_2: &str) { 709fn bar(baz_1: Baz, baz_2: Baz, arg_1: &str, arg_2: &str) {
710 <|>unimplemented!() 710 <|>todo!()
711} 711}
712"#, 712"#,
713 ) 713 )
@@ -779,7 +779,7 @@ impl Foo {
779 self.bar(); 779 self.bar();
780 } 780 }
781 fn bar(&self) { 781 fn bar(&self) {
782 unimplemented!(); 782 todo!();
783 } 783 }
784} 784}
785 ", 785 ",
diff --git a/docs/user/assists.md b/docs/user/assists.md
index 1d9510423..6483ba4f3 100644
--- a/docs/user/assists.md
+++ b/docs/user/assists.md
@@ -77,7 +77,7 @@ fn foo() {
77} 77}
78 78
79fn bar(arg: &str, baz: Baz) { 79fn bar(arg: &str, baz: Baz) {
80 unimplemented!() 80 todo!()
81} 81}
82 82
83``` 83```
diff --git a/xtask/tests/tidy-tests/main.rs b/xtask/tests/tidy-tests/main.rs
index 4f525fcd0..101ae19bd 100644
--- a/xtask/tests/tidy-tests/main.rs
+++ b/xtask/tests/tidy-tests/main.rs
@@ -26,6 +26,7 @@ fn check_todo(path: &Path, text: &str) {
26 // Some of our assists generate `todo!()` so those files are whitelisted. 26 // Some of our assists generate `todo!()` so those files are whitelisted.
27 "doc_tests/generated.rs", 27 "doc_tests/generated.rs",
28 "handlers/add_missing_impl_members.rs", 28 "handlers/add_missing_impl_members.rs",
29 "handlers/add_function.rs",
29 // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make. 30 // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make.
30 "ast/make.rs", 31 "ast/make.rs",
31 ]; 32 ];