Any way to get DocC to generate documentation for extensions I’ve made? I have this, for example:
extension
Int
{
/**
Renders a unicode-superscript version of the integer.
1234 -> ¹²³⁴
-1234 -> ⁻¹²³⁴
*/
public
var
superscriptString: String
{
var s = …
return s
}
}
But building the docs with Xcode just ignores it. My understanding is there’s a switch for docc proper, but I don’t know how to set that up in Xcode (version 26.1).
And honestly, I don’t know why it’s off by default.
I just cobbled up a quick example in Package.swift and built the content in Xcode, and the extensions show up and are included. Here's a quick screenshot of my "dummy project" and it's contents - including an extension modeled loosely after your example (but which doesn't do anything)
Well, I don’t know why I wasn’t seeing it before, but it is indeed building all of my documentation. When I had this issue a while back, I was told that by default, it didn’t build documentation for extensions. Either that was false, or it has changed, and that misunderstanding, combined with my inability to see, made me think it wasn’t working properly.