diff options
-rw-r--r-- | crates/ide/src/typing/on_enter.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crates/ide/src/typing/on_enter.rs b/crates/ide/src/typing/on_enter.rs index 9144681bf..6f1ce3689 100644 --- a/crates/ide/src/typing/on_enter.rs +++ b/crates/ide/src/typing/on_enter.rs | |||
@@ -18,6 +18,7 @@ use text_edit::TextEdit; | |||
18 | // | 18 | // |
19 | // - kbd:[Enter] inside triple-slash comments automatically inserts `///` | 19 | // - kbd:[Enter] inside triple-slash comments automatically inserts `///` |
20 | // - kbd:[Enter] in the middle or after a trailing space in `//` inserts `//` | 20 | // - kbd:[Enter] in the middle or after a trailing space in `//` inserts `//` |
21 | // - kbd:[Enter] inside `//!` doc comments automatically inserts `//!` | ||
21 | // | 22 | // |
22 | // This action needs to be assigned to shortcut explicitly. | 23 | // This action needs to be assigned to shortcut explicitly. |
23 | // | 24 | // |
@@ -187,6 +188,25 @@ fn foo() { | |||
187 | } | 188 | } |
188 | 189 | ||
189 | #[test] | 190 | #[test] |
191 | fn continues_another_doc_comment() { | ||
192 | do_check( | ||
193 | r#" | ||
194 | fn main() { | ||
195 | //! Documentation for$0 on enter | ||
196 | let x = 1 + 1; | ||
197 | } | ||
198 | "#, | ||
199 | r#" | ||
200 | fn main() { | ||
201 | //! Documentation for | ||
202 | //! $0 on enter | ||
203 | let x = 1 + 1; | ||
204 | } | ||
205 | "#, | ||
206 | ); | ||
207 | } | ||
208 | |||
209 | #[test] | ||
190 | fn continues_code_comment_in_the_middle_of_line() { | 210 | fn continues_code_comment_in_the_middle_of_line() { |
191 | do_check( | 211 | do_check( |
192 | r" | 212 | r" |