When code contains a comment between return and the value:
return /* lengthy comment here */ ( lengthyValueComesHere);
Do not wrap before the comment, as that'd break the code through JS' automatic
semicolon insertion.
Differential D24257
clang-format: [JS] ignore comments when wrapping returns. mprobst on Sep 6 2016, 8:24 AM. Authored by
Details When code contains a comment between return and the value: return /* lengthy comment here */ ( lengthyValueComesHere); Do not wrap before the comment, as that'd break the code through JS' automatic
Diff Detail Event Timeline
Comment Actions Looks good.
|
Should the entire method generally consider the previous non-comment, instead of just the previous token? Not sure if that makes sense in all cases, and I don't think we always have a previous non-comment token either.