This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] fix indenting bound functions.
ClosedPublic

Authored by mprobst on May 29 2017, 12:41 AM.

Details

Summary

The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:

fn((function() { ... }).bind(this));

This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.

Diff Detail

Repository
rL LLVM

Event Timeline

mprobst created this revision.May 29 2017, 12:41 AM
mprobst updated this revision to Diff 100588.May 29 2017, 12:42 AM
  • fix comment
djasper accepted this revision.May 29 2017, 12:43 AM
djasper added inline comments.
lib/Format/ContinuationIndenter.cpp
210 ↗(On Diff #100588)

Delete?

This revision is now accepted and ready to land.May 29 2017, 12:43 AM
mprobst updated this revision to Diff 100589.May 29 2017, 12:47 AM
  • fix comment
This revision was automatically updated to reflect the committed changes.