Attach docs to statics
This commit is contained in:
@@ -112,6 +112,20 @@ fn test_doc_comment_of_items() {
|
||||
assert_eq!("doc", module.doc_comment_text().unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_comment_of_statics() {
|
||||
let file = SourceFile::parse(
|
||||
r#"
|
||||
/// Number of levels
|
||||
static LEVELS: i32 = 0;
|
||||
"#,
|
||||
)
|
||||
.ok()
|
||||
.unwrap();
|
||||
let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap();
|
||||
assert_eq!("Number of levels", st.doc_comment_text().unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_comment_preserves_indents() {
|
||||
let file = SourceFile::parse(
|
||||
|
||||
Reference in New Issue
Block a user