Add const_format_args! builtin macro, fix highlighting

This commit is contained in:
Jonas Schievink 2021-09-30 17:16:39 +02:00
parent 12fe0e4ffe
commit b994469a13
5 changed files with 35 additions and 10 deletions

View file

@ -38,6 +38,9 @@ fn is_format_string(string: &ast::String) -> Option<()> {
return None;
}
// NB: we match against `panic_2015`/`panic_2021` here because they have a special-cased arm for
// `"{}"`, which otherwise wouldn't get highlighted.
let first_literal = parent
.children_with_tokens()
.find_map(|it| it.as_token().cloned().and_then(ast::String::cast))?;