[PATCH] D115068: [clang-format][NFC] Move static variable in scope
Björn Schäpers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 3 12:00:26 PST 2021
HazardyKnusperkeks created this revision.
HazardyKnusperkeks added reviewers: MyDeveloperDay, curdeius, owenpan.
HazardyKnusperkeks added a project: clang-format.
HazardyKnusperkeks requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Let only the JS/TS users pay for the initialistation.
Repository:
rG LLVM Github Monorepo
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115068.391702.patch
Type: text/x-patch
Size: 1178 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211203/1bcfef58/attachment.bin>
More information about the cfe-commits
mailing list