重新格式化以在新行中包含方法参数

bra*_*ray 4 appcode

Code-> Style-> Objective-C的首选项中有如此多的设置.我正在寻找合适的代码来重新格式化这行代码

SCPropertyDefinition *test = [SCPropertyDefinition definitionWithName:@"created_at" title:@"Tweeted At" type:SCPropertyTypeLabel];
Run Code Online (Sandbox Code Playgroud)

这种格式

SCPropertyDefinition *test = [SCPropertyDefinition definitionWithName:@"created_at" 
                                                                title:@"Tweeted At" 
                                                                 type:SCPropertyTypeLabel];
Run Code Online (Sandbox Code Playgroud)

(关键是让冒号缩进匹配)

我想它应该在Wrapping and Braces选项卡中,但我还没找到合适的设置.谢谢你的想法.

小智 12

您要查找的设置已Wrapping and Braces | Method call arguments设置为Chop down if long启用Align by colon.请注意,有单独的设置Method parameters.

  • 不,它还在那里.您应该转到settings-> Code Style-> Obj-C查找"Method parameters"并将"Do not wrap"改为"Wrap always"或"Chop down if if long" (2认同)