forked from OSchip/llvm-project
325ff7c5e0
Summary: clang-format wraps object literal keys in an object literal if they are marked as `TT_SelectorName`s and/or the colon is marked as `TT_DictLiteral`. Previously, clang-format would accidentally work because colons in type aliases were marked as `TT_DictLiteral`. r310367 fixed this to assing `TT_JsTypeColon`, which broke wrapping in certain situations. However the root cause was that clang-format incorrectly didn't skip questionmarks when detecting selector name. This change fixes both locations to (1) assign `TT_SelectorName` and (2) treat `TT_JsTypeColon` like `TT_DictLiteral`. Previously: type X = { a: string, b?: string, }; Now: type X = { a: string, b?: string, }; Reviewers: djasper, sammccall Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D36684 llvm-svn: 310852 |
||
---|---|---|
.. | ||
AffectedRangeManager.cpp | ||
AffectedRangeManager.h | ||
BreakableToken.cpp | ||
BreakableToken.h | ||
CMakeLists.txt | ||
ContinuationIndenter.cpp | ||
ContinuationIndenter.h | ||
Encoding.h | ||
Format.cpp | ||
FormatToken.cpp | ||
FormatToken.h | ||
FormatTokenLexer.cpp | ||
FormatTokenLexer.h | ||
NamespaceEndCommentsFixer.cpp | ||
NamespaceEndCommentsFixer.h | ||
SortJavaScriptImports.cpp | ||
SortJavaScriptImports.h | ||
TokenAnalyzer.cpp | ||
TokenAnalyzer.h | ||
TokenAnnotator.cpp | ||
TokenAnnotator.h | ||
UnwrappedLineFormatter.cpp | ||
UnwrappedLineFormatter.h | ||
UnwrappedLineParser.cpp | ||
UnwrappedLineParser.h | ||
UsingDeclarationsSorter.cpp | ||
UsingDeclarationsSorter.h | ||
WhitespaceManager.cpp | ||
WhitespaceManager.h |