【问题标题】:Is there any short cuts for Xcode to tidy up the code?Xcode 有什么捷径可以整理代码吗?
【发布时间】:2023-03-23 10:36:01
【问题描述】:

例如,我有这样的事情:

aVarible = 123; 
bIndex = 234; 
cSomethingVerylong = 456;

我想编写这样的代码:

aVarible           = 123; 
bIndex             = 234; 
cSomethingVerylong = 456;

我该怎么做?谢谢。

【问题讨论】:

  • 请不要这样做,但如果你必须这样做,那么这就是空格和/或制表键的用途。
  • 这样的代码缩进在过去会导致许多编译器错误:)

标签: xcode editor code-formatting indentation


【解决方案1】:

你可以使用 uncrustify:

http://uncrustify.sourceforge.net/

我不使用它,所以我不能保证它的质量,但它确实声称完全按照你在问题中的建议做。如果这就是所有你想要做的,那可能是矫枉过正,但如果你想以多种方式“整理”你的代码,那么这就是 uncrustify 的用途。

【讨论】:

    猜你喜欢
    • 2015-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-29
    • 2012-12-07
    • 1970-01-01
    相关资源
    最近更新 更多