Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/macro_expansion_tests.rs')
| -rw-r--r-- | crates/hir_def/src/macro_expansion_tests.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_def/src/macro_expansion_tests.rs b/crates/hir_def/src/macro_expansion_tests.rs index 76bd0299fb..96957471c8 100644 --- a/crates/hir_def/src/macro_expansion_tests.rs +++ b/crates/hir_def/src/macro_expansion_tests.rs @@ -20,7 +20,7 @@ use stdx::format_to; use syntax::{ ast::{self, edit::IndentLevel}, AstNode, - SyntaxKind::{self, IDENT}, + SyntaxKind::{self, IDENT, LIFETIME_IDENT}, SyntaxNode, T, }; @@ -102,8 +102,9 @@ fn pretty_print_macro_expansion(expn: SyntaxNode) -> String { let space = match (prev_kind, curr_kind) { _ if prev_kind.is_trivia() || curr_kind.is_trivia() => "", (T![=], _) | (_, T![=]) => " ", - (T![;], _) => "\n", - (IDENT, IDENT) => " ", + (_, T!['{']) => " ", + (T![;] | T!['}'], _) => "\n", + (IDENT | LIFETIME_IDENT, IDENT | LIFETIME_IDENT) => " ", (IDENT, _) if curr_kind.is_keyword() => " ", (_, IDENT) if prev_kind.is_keyword() => " ", _ => "", |