Closed llvmbot closed 10 years ago
This is about r195440 clang-format: Improve formatting of ObjC method expressions.
Generally I agree that normally we should keep arguments stick to colon, but I think it does not work as intended.
(1) really weird indent when breaking before type (cast), shouldn't type (cast) have higher penalty than ObjC colon?
---------------------------- WAS -------------------------------------
(2) Why it is tearing @[ apart, @[ and @{ should not be breakable at all, also indent is somehow weird.
---------------------------- WAS ------------------------------------- [mailComposeViewController setToRecipients: @[ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]]; ---------------------------- NOW ------------------------------------- [mailComposeViewController setToRecipients:@ [ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];
---------------------------- WAS ------------------------------------- _navigationSegmentedControl = [[UISegmentedControl alloc] initWithItems: @[ [[UIImage imageNamed:@"NavUpWhite"] ABB_buttonIcon], [[UIImage imageNamed:@"NavDownWhite"] ABB_buttonIcon] ]]; ---------------------------- NOW ------------------------------------- _navigationSegmentedControl = [[UISegmentedControl alloc] initWithItems:@ [ [[UIImage imageNamed:@"NavUpWhite"] ABB_buttonIcon], [[UIImage imageNamed:@"NavDownWhite"] ABB_buttonIcon] ]];
Fixed in r195550.
Extended Description
This is about r195440 clang-format: Improve formatting of ObjC method expressions.
Generally I agree that normally we should keep arguments stick to colon, but I think it does not work as intended.
(1) really weird indent when breaking before type (cast), shouldn't type (cast) have higher penalty than ObjC colon?
---------------------------- WAS -------------------------------------
---------------------------- WAS -------------------------------------
(2) Why it is tearing @[ apart, @[ and @{ should not be breakable at all, also indent is somehow weird.
---------------------------- WAS ------------------------------------- [mailComposeViewController setToRecipients: @[ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]]; ---------------------------- NOW ------------------------------------- [mailComposeViewController setToRecipients:@ [ NSBundle.mainBundle.infoDictionary[@"ABBFeedbackEmail"] ]];
---------------------------- WAS ------------------------------------- _navigationSegmentedControl = [[UISegmentedControl alloc] initWithItems: @[ [[UIImage imageNamed:@"NavUpWhite"] ABB_buttonIcon], [[UIImage imageNamed:@"NavDownWhite"] ABB_buttonIcon] ]]; ---------------------------- NOW ------------------------------------- _navigationSegmentedControl = [[UISegmentedControl alloc] initWithItems:@ [ [[UIImage imageNamed:@"NavUpWhite"] ABB_buttonIcon], [[UIImage imageNamed:@"NavDownWhite"] ABB_buttonIcon] ]];