diff options
author | Seivan Heidari <[email protected]> | 2019-11-02 12:43:57 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-02 12:43:57 +0000 |
commit | 1d8bb4c6c1fef1f8ea513e07d0a7d4c5483129d2 (patch) | |
tree | 055ee515dfaad62af5d2a92bb4ab921a88ee09de /crates/ra_syntax/src/ast.rs | |
parent | 1b6c68e51fcbba59c2e99c31d1400cbd6d44f928 (diff) | |
parent | eb8f76a86fe88fcad370577b344f397dd6118cfd (diff) |
Merge branch 'master' into feature/themes
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index a12da5be2..1ec9881b9 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -113,6 +113,20 @@ fn test_doc_comment_of_items() { | |||
113 | } | 113 | } |
114 | 114 | ||
115 | #[test] | 115 | #[test] |
116 | fn test_doc_comment_of_statics() { | ||
117 | let file = SourceFile::parse( | ||
118 | r#" | ||
119 | /// Number of levels | ||
120 | static LEVELS: i32 = 0; | ||
121 | "#, | ||
122 | ) | ||
123 | .ok() | ||
124 | .unwrap(); | ||
125 | let st = file.syntax().descendants().find_map(StaticDef::cast).unwrap(); | ||
126 | assert_eq!("Number of levels", st.doc_comment_text().unwrap()); | ||
127 | } | ||
128 | |||
129 | #[test] | ||
116 | fn test_doc_comment_preserves_indents() { | 130 | fn test_doc_comment_preserves_indents() { |
117 | let file = SourceFile::parse( | 131 | let file = SourceFile::parse( |
118 | r#" | 132 | r#" |