如何更改Xcode“添加文档”以返回块样式注释

时间:2019-10-12 19:07:04

标签: xcode

问题

有人知道如何将Xcode 11中的Add Documentation单行注释样式更改回Xcode 10中的块注释样式吗?

上下文

Xcode 10使我们能够通过按 command + Editor-> Structure-> Add Documentation中记录函数和方法选项 + / ,这将使用传统的C块注释样式在函数或方法上方插入注释,以使文档易于填写,例如:

/**
 Flashes the garage door opener light (built in) to give
 indication as to what might be going on.

 For example, we might flash it 0.25 second interval for 2
 seconds to indicate that the garage door is going to close
 or we might flash it with an SOS pattern if the
 garage door is jammed

 @param flashPattern    flashPattern enumerated to indicate
                        what pattern to flash on the garage
                        door light to indicate status
                        of the garage door opener
 */
void FlashGarageDoorOpenerLight(GarageDoorOpenerLightFlashPatterns flashPattern) {

Xcode将参数从函数声明中拉出,并为每个参数添加@param。只需在说明和参数占位符之间制表,然后填写即可。这个真的很棒,尽管还不完美...

现在Add Documentation Xcode 11将行尾注释样式斜杠///放在每行的前面:

/// Flashes the garage door opener light (built in) to give
/// indication as to what might be going on.
///
/// For example, we might flash it 0.25 second interval for 2
/// seconds to indicate that the garage door is going to close
/// or we might flash it with an SOS pattern if the
/// garage door is jammed
///
/// @param flashPattern flashPattern    enumerated to indicate
///                                     what pattern to flash on the garage
///                                     door light to indicate status
///                                     of the garage door opener
void FlashGarageDoorOpenerLight(GarageDoorOpenerLightFlashPatterns flashPattern) {

每行上都有所有///这些额外的内容在视觉上令人分心,并且似乎没有任何方法可以将Xcode还原为简单干净的块注释样式,因此出现了这个问题。

0 个答案:

没有答案