Uncrustify obj-c:调用super,interface声明和实现声明之前和之后的换行符

时间:2015-08-05 10:49:43

标签: objective-c xcode uncrustify

如何在使用uncrustify

调用super之后添加换行符

当前

- (void)someFunction
{
   [super someFunction];
   more stuff;
   and more stuff;
}

所需

- (void)someFunction
{
   [super someFunction];

   more stuff;
   and more stuff;
}

如何在界面声明和实现声明之前和之后添加换行符

当前

@interface SCLoginScreenViewController ()
@property (weak, nonatomic) IBOutlet UIView *someView;
@property (weak, nonatomic) IBOutlet UIView *anotherView;
@end
@implementation SCLoginScreenViewController
- (void)someFunction
{
}

所需

@interface SCLoginScreenViewController ()

@property (weak, nonatomic) IBOutlet UIView *someView;
@property (weak, nonatomic) IBOutlet UIView *anotherView;

@end

@implementation SCLoginScreenViewController

- (void)someFunction
{
}
  • 我正在使用BBUncrustifyPlugin和UncrustifyX

1 个答案:

答案 0 :(得分:0)

不幸的是,Uncrustify目前不支持任何这些功能。 1

下面显示的唯一“新行后”选项。

(屏幕截图中未包含两个:Newline count after variable definition blockNewline count after variable definition block not at the top of a function body

enter image description here

“新行”部分还有其他一些选项。但同样,它们都不符合您的情况:

(屏幕截图中缺少Newline after while

enter image description here enter image description here

1. 我正在使用version2.1.1,我相信这是最新的