aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/traits.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index f275a4955..76313684e 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -120,7 +120,7 @@ pub trait DocCommentsOwner: AstNode {
120 has_comments = true; 120 has_comments = true;
121 let prefix_len = comment.prefix().len(); 121 let prefix_len = comment.prefix().len();
122 122
123 let line = comment.text().as_str(); 123 let line: &str = comment.text().as_str();
124 124
125 // Determine if the prefix or prefix + 1 char is stripped 125 // Determine if the prefix or prefix + 1 char is stripped
126 let pos = 126 let pos =
@@ -136,7 +136,10 @@ pub trait DocCommentsOwner: AstNode {
136 line.len() 136 line.len()
137 }; 137 };
138 138
139 line[pos..end].trim_end().to_owned() 139 // Note that we do not trim the end of the line here
140 // since whitespace can have special meaning at the end
141 // of a line in markdown.
142 line[pos..end].to_owned()
140 }) 143 })
141 .join("\n"); 144 .join("\n");
142 145