I want to know as if there exists configuration in Uncrustify, so that following formatting(or at least some part of it) can be achieved(language is objective-c).
Original code:
@interface BaseVideoViewController : BaseViewController <UICollectionViewDelegate, UICollectionViewDataSource, CircleTransitionFromController, PassiveUserGifCellDelegate, PassiveUserCollectionViewDelegate>
@property (strong, nonatomic) NSMutableArray <TokBoxParticipants *> *currentPassivePlayersArray;
@interface BaseVideoViewController () {
NSMutableArray <NSString *> *passiveUserForCellList;
}
[UIView animateWithDuration:1.0 parama1:2.0 animations:^{
// oc_block should come down if in same line by formatter
}
completion:^(BOOL finished) {
// something
}];
switch (something.state) {
case 0: {}
Break;
}
if (_voiceTextView == nil) {
Desired code after formatting:
@interface BaseVideoViewController: BaseViewController <UICollectionViewDelegate, UICollectionViewDataSource, CircleTransitionFromController, PassiveUserGifCellDelegate, PassiveUserCollectionViewDelegate>
@property (strong, nonatomic) NSMutableArray <TokBoxParticipants *> *currentPassivePlayersArray;
@interface BaseVideoViewController() {
NSMutableArray<NSString *> *passiveUserForCellList;
}
[UIView animateWithDuration:1.0 parama1:2.0
animations:^{
// oc_block should come down if in same line by formatter
}
completion:^(BOOL finished) {
// something
}];
switch (something.state) {
case 0: {
Break;
}
}
if (_voiceTextView == nil) {
Changes which need to be observed after formatting:
- There is space between 'if' and '(', but I don't want space between 'BaseVideoViewController' and '('.
- I dont want space between interface name i.e. 'BaseVideoViewController' and ':'.
- I want space between data-type and angular bracket('<') in interface or property definition, but not at other places in code.
- Notice the change in break statement.
- When calling function, I want parameters to come into new line, if that parameter has value starting from '^'(parameter named animations, completions in above code).