mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
8425: Added documentation for on enter covering //! doc comments.
Also added passing test case.
This commit is contained in:
parent
5f279d57f0
commit
a8b5400cc6
1 changed files with 20 additions and 0 deletions
|
@ -18,6 +18,7 @@ use text_edit::TextEdit;
|
|||
//
|
||||
// - 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 foo() {
|
|||
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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue