Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/format.rs')
| -rw-r--r-- | crates/ide/src/syntax_highlighting/format.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs index ce24311115..b755a945cd 100644 --- a/crates/ide/src/syntax_highlighting/format.rs +++ b/crates/ide/src/syntax_highlighting/format.rs @@ -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))?; |