aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_syntax/src/ast.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index c5273a7a2..3aaa5edda 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -481,3 +481,16 @@ impl<'a> PrefixExpr<'a> {
481 } 481 }
482 } 482 }
483} 483}
484
485#[test]
486fn test_doc_comment_of_items() {
487 let file = SourceFileNode::parse(
488 r#"
489 //! doc
490 // non-doc
491 mod foo {}
492 "#,
493 );
494 let module = file.syntax().descendants().find_map(Module::cast).unwrap();
495 assert_eq!("doc", module.doc_comment_text());
496}