diff options
author | Edwin Cheng <[email protected]> | 2020-03-05 20:32:08 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2020-03-05 20:32:08 +0000 |
commit | 0563cc8291227e9d84c8d931ceb2b3768512b770 (patch) | |
tree | d9eab16e32a422cfe436ecddae1fa747263c5890 /crates/ra_mbe/src/syntax_bridge.rs | |
parent | fc4d0a7768c95ba50a224cab401b3a04501463d3 (diff) |
fix regression from #3451
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 | } |