mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 18:15:07 +03:00
Add closing brace hints for macros
This commit is contained in:
@@ -209,6 +209,14 @@ fn closing_brace_hints(
|
||||
_ => return None,
|
||||
}
|
||||
}
|
||||
} else if let Some(mac) = ast::MacroCall::cast(node.clone()) {
|
||||
let last_token = mac.syntax().last_token()?;
|
||||
if last_token.kind() != T![;] && last_token.kind() != SyntaxKind::R_CURLY {
|
||||
return None;
|
||||
}
|
||||
closing_token = last_token;
|
||||
|
||||
format!("{}!", mac.path()?)
|
||||
} else {
|
||||
return None;
|
||||
};
|
||||
@@ -2433,6 +2441,22 @@ impl dyn Tr {
|
||||
mod m {
|
||||
}
|
||||
//^ mod m
|
||||
|
||||
m! {}
|
||||
m!();
|
||||
m!(
|
||||
);
|
||||
//^ m!
|
||||
|
||||
m! {
|
||||
}
|
||||
//^ m!
|
||||
|
||||
fn f() {
|
||||
let v = vec![
|
||||
];
|
||||
}
|
||||
//^ fn f
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user