Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8.2.1 not showing documentation description on autocomplete

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

Here's my code:

/// 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.

enter image description here

enter image description here

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

enter image description here

like image 710
glv19 Avatar asked Jan 24 '17 14:01

glv19


2 Answers

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

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).

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

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.

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

like image 100
Thomas Avatar answered Nov 11 '22 18:11

Thomas


For me the best way to resolve this is by cleaning the project Shift+Command+K, and if that is not working, it is a god idea to remove Derived Data folder.

To remove this folder go to Xcode preferences, Locations tabDerived Data folder location

and click on the small arrow to open a finder, and remove manually the folder.

Restart Xcode, and check if now is working

like image 45
C-Viorel Avatar answered Nov 11 '22 16:11

C-Viorel