aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-07 04:54:28 +0100
committerGitHub <[email protected]>2021-04-07 04:54:28 +0100
commitad50f5007f7fe0e02b128a2643cfca2468056f9a (patch)
tree3c0caf3950f164bbebe1cc5796488d34eb6160a7 /crates/ide
parentcf41e1410a0cf87a05b2dd632e3b5d67f8d55327 (diff)
parent35bec31bca7356d6ae4ef9bfc4f813ebeeb4c971 (diff)
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: https://github.com/simrat39/rust-tools.nvim/issues/2#issuecomment-814551847 Co-authored-by: Emmanuel Thompson <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/expand_macro.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs
index 9eeabbeda..d5628e3df 100644
--- a/crates/ide/src/expand_macro.rs
+++ b/crates/ide/src/expand_macro.rs
@@ -103,6 +103,9 @@ fn insert_whitespaces(syn: SyntaxNode) -> String {
103 format!("\n{}}}", " ".repeat(indent)) 103 format!("\n{}}}", " ".repeat(indent))
104 } 104 }
105 R_CURLY => format!("}}\n{}", " ".repeat(indent)), 105 R_CURLY => format!("}}\n{}", " ".repeat(indent)),
106 LIFETIME_IDENT if is_next(|it| it == IDENT, true) => {
107 format!("{} ", token.text().to_string())
108 }
106 T![;] => format!(";\n{}", " ".repeat(indent)), 109 T![;] => format!(";\n{}", " ".repeat(indent)),
107 T![->] => " -> ".to_string(), 110 T![->] => " -> ".to_string(),
108 T![=] => " = ".to_string(), 111 T![=] => " = ".to_string(),