Skip to content

Commit ad50f50

Browse files
Merge #8392
8392: Add space after lifetime in expand macro r=edwin0cheng a=sharksforarms When a lifetime is followed by an ident, this lead to invalid syntax. This adds a whitespace between the lifetime and the identifier. Noticed this here: simrat39/rust-tools.nvim#2 (comment) Co-authored-by: Emmanuel Thompson <eet6646@gmail.com>
2 parents cf41e14 + 35bec31 commit ad50f50

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/ide/src/expand_macro.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ fn insert_whitespaces(syn: SyntaxNode) -> String {
103103
format!("\n{}}}", " ".repeat(indent))
104104
}
105105
R_CURLY => format!("}}\n{}", " ".repeat(indent)),
106+
LIFETIME_IDENT if is_next(|it| it == IDENT, true) => {
107+
format!("{} ", token.text().to_string())
108+
}
106109
T![;] => format!(";\n{}", " ".repeat(indent)),
107110
T![->] => " -> ".to_string(),
108111
T![=] => " = ".to_string(),

0 commit comments

Comments
 (0)