This revision was automatically updated to reflect the committed changes.
Closed by commit rG8d1c85454daa: [clang-format][NFC] Move static variable in 
scope (authored by HazardyKnusperkeks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115068/new/

https://reviews.llvm.org/D115068

Files:
  clang/lib/Format/ContinuationIndenter.cpp


Index: clang/lib/Format/ContinuationIndenter.cpp
===================================================================
--- clang/lib/Format/ContinuationIndenter.cpp
+++ clang/lib/Format/ContinuationIndenter.cpp
@@ -493,14 +493,14 @@
       return true;
   }
 
-  // Break after the closing parenthesis of TypeScript decorators before
-  // functions, getters and setters.
-  static const llvm::StringSet<> BreakBeforeDecoratedTokens = {"get", "set",
-                                                               "function"};
   if (Style.Language == FormatStyle::LK_JavaScript &&
-      BreakBeforeDecoratedTokens.contains(Current.TokenText) &&
       Previous.is(tok::r_paren) && Previous.is(TT_JavaAnnotation)) {
-    return true;
+    // Break after the closing parenthesis of TypeScript decorators before
+    // functions, getters and setters.
+    static const llvm::StringSet<> BreakBeforeDecoratedTokens = {"get", "set",
+                                                                 "function"};
+    if (BreakBeforeDecoratedTokens.contains(Current.TokenText))
+      return true;
   }
 
   // If the return type spans multiple lines, wrap before the function name.


Index: clang/lib/Format/ContinuationIndenter.cpp
===================================================================
--- clang/lib/Format/ContinuationIndenter.cpp
+++ clang/lib/Format/ContinuationIndenter.cpp
@@ -493,14 +493,14 @@
       return true;
   }
 
-  // Break after the closing parenthesis of TypeScript decorators before
-  // functions, getters and setters.
-  static const llvm::StringSet<> BreakBeforeDecoratedTokens = {"get", "set",
-                                                               "function"};
   if (Style.Language == FormatStyle::LK_JavaScript &&
-      BreakBeforeDecoratedTokens.contains(Current.TokenText) &&
       Previous.is(tok::r_paren) && Previous.is(TT_JavaAnnotation)) {
-    return true;
+    // Break after the closing parenthesis of TypeScript decorators before
+    // functions, getters and setters.
+    static const llvm::StringSet<> BreakBeforeDecoratedTokens = {"get", "set",
+                                                                 "function"};
+    if (BreakBeforeDecoratedTokens.contains(Current.TokenText))
+      return true;
   }
 
   // If the return type spans multiple lines, wrap before the function name.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D115068: [clang-f... Marek Kurdej via Phabricator via cfe-commits
    • [PATCH] D115068: [cl... Björn Schäpers via Phabricator via cfe-commits

Reply via email to