[clang] [clang-format] Disable string breaking in JS for now (PR #66372)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 14 17:38:53 PDT 2023


================
@@ -2237,15 +2237,10 @@ ContinuationIndenter::createBreakableToken(const FormatToken &Current,
                                            LineState &State, bool AllowBreak) {
   unsigned StartColumn = State.Column - Current.ColumnWidth;
   if (Current.isStringLiteral()) {
-    // Strings in JSON can not be broken.
-    if (Style.isJson() || !Style.BreakStringLiterals || !AllowBreak)
-      return nullptr;
-
-    // Strings in TypeScript types and dictionary keys can not be broken.
-    if (Style.isJavaScript() &&
-        (Current.is(TT_SelectorName) ||
-         State.Line->startsWith(Keywords.kw_type) ||
-         State.Line->startsWith(tok::kw_export, Keywords.kw_type))) {
+    // Strings in JSON can not be broken. Breaking strings in JavaScript is
----------------
owenca wrote:

```suggestion
    // Strings in JSON cannot be broken. Breaking strings in JavaScript is
```

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


More information about the cfe-commits mailing list