【问题标题】:Uncrustify obj-c: Newline before and after call to super, interface declaration and implementation declarationUncrustify obj-c:调用super前后换行,接口声明和实现声明
【发布时间】:2015-08-05 10:49:42
【问题描述】:

如何在使用 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

【问题讨论】:

  • 看来,需要创建一个可以做到这一点的插件!
  • @RoNiT,已经有一个插件 - BBUncrustifyPlugin。问题是使用 250 个选项中的哪个选项

标签: objective-c xcode uncrustify


【解决方案1】:

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

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

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

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

(截图中缺少Newline after while


1. 我用的是version2.1.1,相信是最新的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-09-23
    • 2020-12-03
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    • 2013-10-08
    • 2013-11-13
    相关资源
    最近更新 更多