forked from OSchip/llvm-project
clang-format: [JS] Support annotated classes.
llvm-svn: 272654
This commit is contained in:
parent
985c0c274b
commit
6465008e0e
|
@ -1461,7 +1461,8 @@ private:
|
|||
return Current->getPrecedence();
|
||||
if (Current->isOneOf(tok::period, tok::arrow))
|
||||
return PrecedenceArrowAndPeriod;
|
||||
if (Style.Language == FormatStyle::LK_Java &&
|
||||
if ((Style.Language == FormatStyle::LK_Java ||
|
||||
Style.Language == FormatStyle::LK_JavaScript) &&
|
||||
Current->isOneOf(Keywords.kw_extends, Keywords.kw_implements,
|
||||
Keywords.kw_throws))
|
||||
return 0;
|
||||
|
|
|
@ -948,6 +948,11 @@ TEST_F(FormatTestJS, ClassDeclarations) {
|
|||
" },\n"
|
||||
" };\n"
|
||||
"}");
|
||||
verifyFormat("@Component({\n"
|
||||
" moduleId: module.id,\n"
|
||||
"})\n"
|
||||
"class SessionListComponent implements OnDestroy, OnInit {\n"
|
||||
"}");
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJS, InterfaceDeclarations) {
|
||||
|
|
Loading…
Reference in New Issue