diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs
index b755a945cdb..6f6671f8ca7 100644
--- a/crates/ide/src/syntax_highlighting/format.rs
+++ b/crates/ide/src/syntax_highlighting/format.rs
@@ -28,9 +28,18 @@ pub(super) fn highlight_format_string(
 }
 
 fn is_format_string(string: &ast::String) -> Option<()> {
-    let parent = string.syntax().parent()?;
+    // Check if `string` is a format string argument of a macro invocation.
+    // `string` is a string literal, mapped down into the innermost macro expansion.
+    // Since `format_args!` etc. remove the format string when expanding, but place all arguments
+    // in the expanded output, we know that the string token is (part of) the format string if it
+    // appears in `format_args!` (otherwise it would have been mapped down further).
+    //
+    // This setup lets us correctly highlight the components of `concat!("{}", "bla")` format
+    // strings. It still fails for `concat!("{", "}")`, but that is rare.
+
+    let macro_call = string.syntax().ancestors().find_map(ast::MacroCall::cast)?;
+    let name = macro_call.path()?.segment()?.name_ref()?;
 
-    let name = parent.parent().and_then(ast::MacroCall::cast)?.path()?.segment()?.name_ref()?;
     if !matches!(
         name.text().as_str(),
         "format_args" | "format_args_nl" | "const_format_args" | "panic_2015" | "panic_2021"
@@ -41,13 +50,6 @@ fn is_format_string(string: &ast::String) -> Option<()> {
     // 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))?;
-    if &first_literal != string {
-        return None;
-    }
-
     Some(())
 }
 
diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
index 4f67c4316a4..893094b24a4 100644
--- a/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
+++ b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html
@@ -145,4 +145,5 @@ pre                 { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
     <span class="macro">assert!</span><span class="parenthesis">(</span><span class="bool_literal">true</span><span class="comma">,</span> <span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal"> asdasd"</span><span class="comma">,</span> <span class="numeric_literal">1</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">toho!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">fmt"</span><span class="comma">,</span> <span class="numeric_literal">0</span><span class="parenthesis">)</span><span class="semicolon">;</span>
     <span class="macro">asm!</span><span class="parenthesis">(</span><span class="string_literal">"mov eax, </span><span class="format_specifier">{</span><span class="numeric_literal">0</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="parenthesis">)</span><span class="semicolon">;</span>
+    <span class="macro">format_args!</span><span class="parenthesis">(</span>concat<span class="punctuation">!</span><span class="parenthesis">(</span><span class="string_literal">"</span><span class="format_specifier">{</span><span class="format_specifier">}</span><span class="string_literal">"</span><span class="parenthesis">)</span><span class="comma">,</span> <span class="string_literal">"{}"</span><span class="parenthesis">)</span><span class="semicolon">;</span>
 <span class="brace">}</span></code></pre>
\ No newline at end of file
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 6972d431d24..850de3908fa 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -540,6 +540,7 @@ fn main() {
     assert!(true, "{} asdasd", 1);
     toho!("{}fmt", 0);
     asm!("mov eax, {0}");
+    format_args!(concat!("{}"), "{}");
 }"#
         .trim(),
         expect_file!["./test_data/highlight_strings.html"],