diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2025-06-15 18:23:18 +0200 |
|---|---|---|
| committer | Tadeo Kondrak <me@tadeo.ca> | 2025-06-15 18:23:18 +0200 |
| commit | 68d841e7d6731482dd822a3238082690f0587b4c (patch) | |
| tree | 2988f05e45cc5e5bac5e1e4ea8065e9c1f623ff1 | |
| parent | 0339a97ad22dc185f71f5fd0267201f1525ca1ab (diff) | |
| download | rust-68d841e7d6731482dd822a3238082690f0587b4c.tar.gz rust-68d841e7d6731482dd822a3238082690f0587b4c.zip | |
Use is_any_identifier in pretty_print_macro_expansion
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs index 15b31c1e7ed..1c69b37f164 100644 --- a/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs +++ b/src/tools/rust-analyzer/crates/hir-def/src/macro_expansion_tests/mod.rs @@ -302,19 +302,12 @@ fn pretty_print_macro_expansion( (_, T!['{']) => " ", (T![;] | T!['{'] | T!['}'], _) => "\n", (_, T!['}']) => "\n", - (IDENT | LIFETIME_IDENT, IDENT | LIFETIME_IDENT) => " ", - _ if prev_kind.is_keyword(Edition::CURRENT) - && curr_kind.is_keyword(Edition::CURRENT) => - { - " " - } - (IDENT | LIFETIME_IDENT, _) - if curr_kind.is_keyword(Edition::CURRENT) || curr_kind.is_literal() => - { - " " - } - (_, IDENT | LIFETIME_IDENT) - if prev_kind.is_keyword(Edition::CURRENT) || prev_kind.is_literal() => + _ if (prev_kind.is_any_identifier() + || prev_kind == LIFETIME_IDENT + || prev_kind.is_literal()) + && (curr_kind.is_any_identifier() + || curr_kind == LIFETIME_IDENT + || curr_kind.is_literal()) => { " " } |
