diff options
| author | Martin Probst <martin@probst.io> | 2018-09-26 08:28:33 +0000 |
|---|---|---|
| committer | Martin Probst <martin@probst.io> | 2018-09-26 08:28:33 +0000 |
| commit | cc525e7b8d62231c3825630a4c1e384031d7b41d (patch) | |
| tree | b4f97008423a26d5302e31aeb7ab3665fa95bb3f /clang/lib | |
| parent | f9a52903efa5a32e1d2914d26dbee77a25c7c2a8 (diff) | |
| download | bcm5719-llvm-cc525e7b8d62231c3825630a4c1e384031d7b41d.tar.gz bcm5719-llvm-cc525e7b8d62231c3825630a4c1e384031d7b41d.zip | |
clang-format: [JS] space after parameter naming.
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
llvm-svn: 343080
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 3a19215e180..83c5b2e8b96 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2517,7 +2517,9 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, 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))) |

