Summary:
Previously:
foo(/*bar=*/baz);
Now:
foo(/*bar=*/ baz);
The run-in parameter naming comment is not intended in JS.
Reviewers: mboehme
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52535
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343080
91177308-0d34-0410-b5e6-
96231b3b80d8
Right.MatchingParen->BlockKind != BK_Block))
return !Style.Cpp11BracedListStyle;
if (Left.is(TT_BlockComment))
- return !Left.TokenText.endswith("=*/");
+ // No whitespace in x(/*foo=*/1), except for JavaScript.
+ return Style.Language == FormatStyle::LK_JavaScript ||
+ !Left.TokenText.endswith("=*/");
if (Right.is(tok::l_paren)) {
if ((Left.is(tok::r_paren) && Left.is(TT_AttributeParen)) ||
(Left.is(tok::r_square) && Left.is(TT_AttributeSquare)))
"};"));
}
+TEST_F(FormatTestJS, ParameterNamingComment) {
+ verifyFormat("callFoo(/*spaceAfterParameterNamingComment=*/ 1);");
+}
+
} // end namespace tooling
} // end namespace clang