Patch by Martin Probst.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236485
91177308-0d34-0410-b5e6-
96231b3b80d8
} else if (Limit != 0 && Line.First->isNot(tok::kw_namespace) &&
!startsExternCBlock(Line)) {
// We don't merge short records.
- if (Line.First->isOneOf(tok::kw_class, tok::kw_union, tok::kw_struct))
+ if (Line.First->isOneOf(tok::kw_class, tok::kw_union, tok::kw_struct,
+ Keywords.kw_interface))
return 0;
// Check that we still have three lines and they fit into the limit.
verifyFormat("class C extends p.P implements i.I {}");
}
+TEST_F(FormatTestJS, InterfaceDeclarations) {
+ verifyFormat("interface I {\n"
+ " x: string;\n"
+ "}");
+}
+
TEST_F(FormatTestJS, MetadataAnnotations) {
verifyFormat("@A\nclass C {\n}");
verifyFormat("@A({arg: 'value'})\nclass C {\n}");