diff options
Diffstat (limited to 'crates/ra_syntax/src/parsing/text_tree_sink.rs')
-rw-r--r-- | crates/ra_syntax/src/parsing/text_tree_sink.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/parsing/text_tree_sink.rs b/crates/ra_syntax/src/parsing/text_tree_sink.rs index 22aed1db1..6d1828d20 100644 --- a/crates/ra_syntax/src/parsing/text_tree_sink.rs +++ b/crates/ra_syntax/src/parsing/text_tree_sink.rs | |||
@@ -146,8 +146,8 @@ fn n_attached_trivias<'a>( | |||
146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, | 146 | trivias: impl Iterator<Item = (SyntaxKind, &'a str)>, |
147 | ) -> usize { | 147 | ) -> usize { |
148 | match kind { | 148 | match kind { |
149 | MACRO_CALL | CONST_DEF | TYPE_ALIAS_DEF | STRUCT_DEF | ENUM_DEF | ENUM_VARIANT | FN_DEF | 149 | MACRO_CALL | CONST | TYPE_ALIAS | STRUCT | ENUM | VARIANT | FN | TRAIT | MODULE |
150 | | TRAIT_DEF | MODULE | RECORD_FIELD_DEF | STATIC_DEF => { | 150 | | RECORD_FIELD | STATIC => { |
151 | let mut res = 0; | 151 | let mut res = 0; |
152 | let mut trivias = trivias.enumerate().peekable(); | 152 | let mut trivias = trivias.enumerate().peekable(); |
153 | 153 | ||
@@ -160,7 +160,10 @@ fn n_attached_trivias<'a>( | |||
160 | if let Some((peek_kind, peek_text)) = | 160 | if let Some((peek_kind, peek_text)) = |
161 | trivias.peek().map(|(_, pair)| pair) | 161 | trivias.peek().map(|(_, pair)| pair) |
162 | { | 162 | { |
163 | if *peek_kind == COMMENT && peek_text.starts_with("///") { | 163 | if *peek_kind == COMMENT |
164 | && peek_text.starts_with("///") | ||
165 | && !peek_text.starts_with("////") | ||
166 | { | ||
164 | continue; | 167 | continue; |
165 | } | 168 | } |
166 | } | 169 | } |