Xcode with uncrustify: how to align function declaration to colon?
I have the following code :
@interface TRYoutubeManager : AFHTTPRequestOperationManager
- (void)getVideosForDefaultChannelsWithSuccess:(void (^)(NSArray *youtubeVideosArray))successBlock failure:(void (^)(NSError *error))failureBlock;
@end
So I want to keep the 120 digit line limit. And align the declaration in colons like:
@interface TRYoutubeManager : AFHTTPRequestOperationManager
- (void)getVideosForDefaultChannelsWithSuccess:(void (^)(NSArray *youtubeVideosArray))successBlock
failure:(void (^)(NSError *error))failureBlock;
@end
But when I apply Uncrustify on it I get :
@interface TRYoutubeManager : AFHTTPRequestOperationManager
- (void)getVideosForDefaultChannelsWithSuccess:(void (^)(NSArray *youtubeVideosArray))successBlock failure:(void (^)(
NSError *
error))
failureBlock;
@end
The plugin messes with it all. Linear limit exceeded. Here are some critical (I think) parameters:
# Align ObjC declaration params on colon
align_oc_decl_colon = true #
# Alignment span for ObjC message colons
align_oc_msg_colon_span = 20 # number
# Alignment span for ObjC message spec
align_oc_msg_spec_span = 0 # number
# Code width
code_width = 120 # number
The entire configuration file is HERE
Please help me to configure the Uncrustify config correclty.
+3
source to share
1 answer
Have you tried looking at them:
nl_oc_msg_leave_one_liner { False, True } Don't
split one-line OC messages
nl_oc_msg_args { False, True } Whether to
put each OC message parameter on a separate line See
nl_oc_msg_leave_one_liner
I don't think the formatter will actually move the parameters to the declaration on new lines for you, align_oc_decl_colon
will only align them to colons if they are already on multiple lines.
+1
source to share