8429: 8425: Added documentation for on enter covering //! doc comments. r=jonas-schievink a=chetankhilosiya

Also added passing test case.

Co-authored-by: Chetan Khilosiya <chetan.khilosiya@gmail.com>
This commit is contained in:
bors[bot] 2021-04-08 23:33:36 +00:00 committed by GitHub
commit 354151df35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@
//
// - kbd:[Enter] inside triple-slash comments automatically inserts `///`
// - kbd:[Enter] in the middle or after a trailing space in `//` inserts `//`
// - kbd:[Enter] inside `//!` doc comments automatically inserts `//!`
//
// This action needs to be assigned to shortcut explicitly.
//
@ -186,6 +187,25 @@ fn does_not_continue_before_doc_comment() {
do_check_noop(r"$0//! docz");
}
#[test]
fn continues_another_doc_comment() {
do_check(
r#"
fn main() {
//! Documentation for$0 on enter
let x = 1 + 1;
}
"#,
r#"
fn main() {
//! Documentation for
//! $0 on enter
let x = 1 + 1;
}
"#,
);
}
#[test]
fn continues_code_comment_in_the_middle_of_line() {
do_check(