realm / jazzy

Soulful docs for Swift & Objective-C
https://realm.io
MIT License
7.35k stars 413 forks source link

Missing docs with @available(iOSApplicationExtension, unavailable) and APPLICATION_EXTENSION_API_ONLY = YES #1376

Closed MarcoEidinger closed 9 months ago

MarcoEidinger commented 11 months ago
@available(iOS 15.0, *)
@available(iOSApplicationExtension, unavailable)
/// API to be used in app but not in extension
public class MyApi {...}

in an iOS framework gets included in documentation output from Jazzy when Build Setting APPLICATION_EXTENSION_API_ONLY = NO;

Jazzy Good

The symbol gets NOT included in documentation output from Jazzy when Build Setting APPLICATION_EXTENSION_API_ONLY = YES;

Jazzy Bad

Tested with Jazzy 0.14.4

Use https://github.com/MarcoEidinger/DocUnavailableRepro to reproduce the issue.

Expectation is that API gets documented as it can be used in an application.

johnfairh commented 11 months ago

This looks like a Swift bug: you can look at Xcode Quick Help (I'm using 15.1b3) and see there is no quick help available for the MyApi but there is for MyApi.init() and UniversalApi.

Swift reports it to Jazzy as an unavailable symbol (no USR) and "key.internal_diagnostic": "Unavailable in the current compilation context.". Presumably Swift is reporting it to DocC in a similarly 'bad' way.

e: I don't know anything about this area of iOS/Xcode so I'm just believing that you do by agreeing that this behaviour is wrong!

MarcoEidinger commented 11 months ago

The issue is also observable for DocC (https://github.com/apple/swift/issues/70489). I don't know enough about USR to report this to Swift properly. If someone can help with that, then this would be great

johnfairh commented 11 months ago

DocC bug found its way to the Swift repo, track there.

johnfairh commented 9 months ago

I'm going to close this because the Swift people seem to think this is working as designed on the Xcode side - at any rate doesn't seem like there is anything to do at our level. It looks like you need to set that flag =NO when generating docs.