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 | a723865994f8a8e7d1bd895ff6b36401c8a1319c (patch) | |
tree | af4fafbf350d8ccbed14ca74704c385e042ee052 /lib/Format/TokenAnnotator.cpp | |
parent | 620c7e3e3bb219b4cc0e75bcef757d401b28f966 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 3a19215e18..83c5b2e8b9 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/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))) |