mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add closing brace hints for macros
This commit is contained in:
parent
867a7dc7a0
commit
fccc12982e
1 changed files with 24 additions and 0 deletions
|
@ -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 @@ const _: () = {
|
|||
mod m {
|
||||
}
|
||||
//^ mod m
|
||||
|
||||
m! {}
|
||||
m!();
|
||||
m!(
|
||||
);
|
||||
//^ m!
|
||||
|
||||
m! {
|
||||
}
|
||||
//^ m!
|
||||
|
||||
fn f() {
|
||||
let v = vec![
|
||||
];
|
||||
}
|
||||
//^ fn f
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue