File tree Expand file tree Collapse file tree 2 files changed +58
-29
lines changed Expand file tree Collapse file tree 2 files changed +58
-29
lines changed Original file line number Diff line number Diff line change @@ -7,35 +7,34 @@ use syntax::{
7
7
8
8
use crate :: assist_context:: { AssistContext , Assists } ;
9
9
10
- /// Assist: generate_documentation_template
11
- ///
12
- /// Adds a documentation template above a function definition / declaration
13
- ///
14
- /// ```
15
- /// fn my_func(a: i32, b: i32) -> Result<(), std::io::Error> {
16
- /// unimplemented!()
17
- /// }
18
- /// ```
19
- /// ->
20
- /// ```
21
- /// /// .
22
- /// ///
23
- /// /// # Examples
24
- /// ///
25
- /// /// ```rust
26
- /// /// use my_crate::my_func;
27
- /// ///
28
- /// /// let result = my_func(a, b);
29
- /// /// assert_eq!(result, );
30
- /// /// ```
31
- /// ///
32
- /// /// # Errors
33
- /// ///
34
- /// /// This function will return an error if .
35
- /// fn my_func(a: i32, b: i32) -> Result<(), std::io::Error> {
36
- /// unimplemented!()
37
- /// }
38
- /// ```
10
+ // Assist: generate_documentation_template
11
+ //
12
+ // Adds a documentation template above a function definition / declaration.
13
+ //
14
+ // ```
15
+ // fn my_$0func(a: i32, b: i32) -> Result<(), std::io::Error> {
16
+ // unimplemented!()
17
+ // }
18
+ // ```
19
+ // ->
20
+ // ```
21
+ // /// .
22
+ // ///
23
+ // /// # Examples
24
+ // ///
25
+ // /// ```
26
+ // /// use test::my_func;
27
+ // ///
28
+ // /// assert_eq!(my_func(a, b), );
29
+ // /// ```
30
+ // ///
31
+ // /// # Errors
32
+ // ///
33
+ // /// This function will return an error if .
34
+ // fn my_func(a: i32, b: i32) -> Result<(), std::io::Error> {
35
+ // unimplemented!()
36
+ // }
37
+ // ```
39
38
pub ( crate ) fn generate_documentation_template (
40
39
acc : & mut Assists ,
41
40
ctx : & AssistContext ,
Original file line number Diff line number Diff line change @@ -839,6 +839,36 @@ struct Point {
839
839
)
840
840
}
841
841
842
+ #[ test]
843
+ fn doctest_generate_documentation_template ( ) {
844
+ check_doc_test (
845
+ "generate_documentation_template" ,
846
+ r#####"
847
+ fn my_$0func(a: i32, b: i32) -> Result<(), std::io::Error> {
848
+ unimplemented!()
849
+ }
850
+ "##### ,
851
+ r#####"
852
+ /// .
853
+ ///
854
+ /// # Examples
855
+ ///
856
+ /// ```
857
+ /// use test::my_func;
858
+ ///
859
+ /// assert_eq!(my_func(a, b), );
860
+ /// ```
861
+ ///
862
+ /// # Errors
863
+ ///
864
+ /// This function will return an error if .
865
+ fn my_func(a: i32, b: i32) -> Result<(), std::io::Error> {
866
+ unimplemented!()
867
+ }
868
+ "##### ,
869
+ )
870
+ }
871
+
842
872
#[ test]
843
873
fn doctest_generate_enum_as_method ( ) {
844
874
check_doc_test (
You can’t perform that action at this time.
0 commit comments