[clang] [clang-format] Detect nesting in template strings (PR #119989)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 14 19:15:52 PST 2024


================
@@ -2157,6 +2157,13 @@ TEST_F(FormatTestJS, TemplateStringMultiLineExpression) {
                "                          aaaa:  aaaaa,\n"
                "                          bbbb:  bbbbb,\n"
                "                        })}`;");
+
+  verifyFormat("`${\n"
+               "    (\n"
+               "        FOOFOOFOOFOO____FOO_FOO_FO_FOO_FOOO -\n"
+               "            (barbarbarbar____bar_bar_bar_bar_bar_bar +\n"
+               "             bar_bar_bar_barbarbar___bar_bar_bar + 1),\n"
+               "        )}`;\n");
----------------
owenca wrote:

```suggestion
               "        )}`;");
```

https://github.com/llvm/llvm-project/pull/119989


More information about the cfe-commits mailing list