Before:
var MyLongClassName = goog.module.get('my.long.module.name.followedBy.MyLongClassName');
After:
var MyLongClassName =
goog.module.get('my.long.module.name.followedBy.MyLongClassName');
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222888
91177308-0d34-0410-b5e6-
96231b3b80d8
Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
Tok.Next->Next && (Tok.Next->Next->TokenText == "module" ||
Tok.Next->Next->TokenText == "require" ||
- Tok.Next->Next->TokenText == "provide");
+ Tok.Next->Next->TokenText == "provide") &&
+ Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
}
void resetTokenMetadata(FormatToken *Token) {
getGoogleJSStyleWithColumns(40));
verifyFormat("var long = goog.require('this.is.really.absurdly.long');",
getGoogleJSStyleWithColumns(40));
+
+ // These should be wrapped normally.
+ verifyFormat(
+ "var MyLongClassName =\n"
+ " goog.module.get('my.long.module.name.followedBy.MyLongClassName');");
}
TEST_F(FormatTestJS, FormatsFreestandingFunctions) {