[clang] [clang-format] Handle C++ keywords in other languages better (PR #132941)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 29 00:12:28 PDT 2025


================
@@ -834,6 +834,11 @@ TEST_F(FormatTestJS, AsyncFunctions) {
                "}",
                "async function hello(myparamnameiswaytooloooong) {}",
                getGoogleJSStyleWithColumns(10));
+  verifyFormat("async function\n"
+               "union(\n"
+               "    myparamnameiswaytooloooong) {\n"
+               "}",
+               getGoogleJSStyleWithColumns(10));
----------------
owenca wrote:

Can you add something like `const auto Style = getGoogleJSStyleWithColumns(10);` and reuse it here and at line 849 below?

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


More information about the cfe-commits mailing list