diff options
Diffstat (limited to 'crates/ra_mbe/src/syntax_bridge.rs')
-rw-r--r-- | crates/ra_mbe/src/syntax_bridge.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index d8ee74faa..fb9fa5314 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -448,7 +448,9 @@ impl<'a> TreeSink for TtTreeSink<'a> { | |||
448 | Some(tt::TokenTree::Leaf(tt::Leaf::Punct(_))), | 448 | Some(tt::TokenTree::Leaf(tt::Leaf::Punct(_))), |
449 | ) = (last.token_tree(), next.token_tree()) | 449 | ) = (last.token_tree(), next.token_tree()) |
450 | { | 450 | { |
451 | if curr.spacing == tt::Spacing::Alone { | 451 | // Note: We always assume the semi-colon would be the last token in |
452 | // other parts of RA such that we don't add whitespace here. | ||
453 | if curr.spacing == tt::Spacing::Alone && curr.char != ';' { | ||
452 | self.inner.token(WHITESPACE, " ".into()); | 454 | self.inner.token(WHITESPACE, " ".into()); |
453 | self.text_pos += TextUnit::of_char(' '); | 455 | self.text_pos += TextUnit::of_char(' '); |
454 | } | 456 | } |