mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Treat comments beginning with four slashes as regular line comments
This commit is contained in:
parent
da1f316b02
commit
b6560e3ebb
2 changed files with 16 additions and 0 deletions
|
@ -242,6 +242,21 @@ fn test_comments_preserve_trailing_whitespace() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_four_slash_line_comment() {
|
||||
let file = SourceFile::parse(
|
||||
r#"
|
||||
//// too many slashes to be a doc comment
|
||||
/// doc comment
|
||||
mod foo {}
|
||||
"#,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
let module = file.syntax().descendants().find_map(Module::cast).unwrap();
|
||||
assert_eq!("doc comment", module.doc_comment_text().unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_where_predicates() {
|
||||
fn assert_bound(text: &str, bound: Option<TypeBound>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue