[PATCH] clang-format: [js] Support template strings.
djasper at google.com
Fri Feb 20 04:38:28 PST 2015
Looks good, I'll add the test and commit.
Comment at: lib/Format/Format.cpp:798
@@ +797,3 @@
+ IsMultiline || I->NewlinesBefore > 0 || I->IsMultiline;
+ if (I->isNot(tok::unknown) || I->TokenText != "`")
> djasper wrote:
> > Can you add a test with two template strings? I think that might do the wrong thing as you need to abort when you find a TT_TemplateString.
> It's not strictly needed - if there was a preceding template string, it cannot just equals "`", it must have at least opener and closer "``". But it's a reasonable optimization and IMHO adds clarity.
I agree. Still seems useful to have a test ;-).
More information about the cfe-commits