Xcode 8.2.1在自动完成功能上未显示文档描述 [英] Xcode 8.2.1 not showing documentation description on autocomplete

查看:101
本文介绍了Xcode 8.2.1在自动完成功能上未显示文档描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在向Xcode 8.2.1中的代码添加文档时遇到问题.

I'm having problems adding documentation to my code in Xcode 8.2.1.

这是我的代码:

/// Test documentation method
///
/// - Parameter string: The input string
/// - Returns: The output bool
func testMethod(string:String) -> Bool {

    if string == "YES" {
        return true
    }

    return false
}

文档会在快速帮助窗口中按预期显示,但说明不会在代码自动完成窗口中显示.

The documentation shows as expected in the quick help window but the description doesn't show in the code autocomplete window.

是否有一种方法可以使描述显示在自动完成框中,如下图所示:

Is there a way to get the description to show in the autocomplete box as in the image below:

推荐答案

是的,添加到方法和属性顶部的描述不再显示在弹出窗口中.

You are right, the descriptions you added to the top of your methods and properties don't appear in the popover anymore.

如前所述,您只能看到Apple自己的方法和属性的描述.
原因是Xcode不会从其类中解析这些内容,而是从单独的文档集(您可以在Xcode的Help/Documentation and API reference选项卡中找到)中解析它们.

As noted, you can only see the descriptions of Apple's own methods and properties.
The reason being that Xcode doesn't parse these from their classes but rather from a separate documentation set (which you can find in Xcode's Help/Documentation and API reference tab).

因此,除非Apple决定更改此设置,否则恐怕无法在弹出窗口中看到您自己的照片.

So unless Apple decides to change this, I'm afraid it won't be possible to see your own in the popover.

您可以关注现有的文档集生成器( AppleDoc

You could keep an eye on existing doc set generators (AppleDoc, Jazzy), maybe they'll offer a way to link their documentation to Xcode's popover.

请记住,在方法或属性上使用 alt + 单击来打开快速帮助弹出窗口时,您确实会看到自己的注释.

Keep in mind that you do see your own comments when opening the quick help popover with alt + click on a method or property.

这篇关于Xcode 8.2.1在自动完成功能上未显示文档描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆