670895a49c
3482: Fix regression from #3451 r=matklad a=edwin0cheng There is a regression from #3451 such that the following code has failed to parse in raw item collecting phase: ```rust macro_rules! with_std { ($($i:item)*) => ($(#[cfg(feature = "std")]$i)*) } with_std! { mod macros; mod others; } ``` ### Rationale We always assume the last token of an statement will not end with a whitespace, which is true. It is because in parsing phase, we always emit `SyntaxNode` before any whitespace. Such that in various parts of RA code, we solely check the semi-colon by using `SyntaxNode::last_child_token() == ";"` . However, in #3451, we insert some whitespaces between puncts such that we broke above assumption. This PR fixed this bug by make sure we don't add any whitespace if it is a semicolon. Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com> |
||
---|---|---|
.. | ||
ra_arena | ||
ra_assists | ||
ra_cargo_watch | ||
ra_cfg | ||
ra_db | ||
ra_fmt | ||
ra_hir | ||
ra_hir_def | ||
ra_hir_expand | ||
ra_hir_ty | ||
ra_ide | ||
ra_ide_db | ||
ra_mbe | ||
ra_parser | ||
ra_prof | ||
ra_project_model | ||
ra_syntax | ||
ra_text_edit | ||
ra_tt | ||
rust-analyzer | ||
test_utils |