jazzy icon indicating copy to clipboard operation
jazzy copied to clipboard

objc method produces multiple methods in generated swift interface but jazzy ignores some of them

Open gerchicovy opened this issue 2 years ago • 1 comments

Example:

NS_ASSUME_NONNULL_BEGIN
typedef void(^SomeCompletion)(NSString * _Nullable str);

@interface SomeClass: NSObject
- (void)loadTokenWithCompletionHandler:(SomeCompletion)completionHandler;
@end
NS_ASSUME_NONNULL_END

Generated swift file:

public typealias SomeCompletion = (String?) -> Void

open class SomeClass : NSObject {
open func loadToken(completionHandler: @escaping SomeCompletion)
open func loadToken() async -> String?
}

Generated documentation contains description of open func loadToken() async -> String? only which is even less intuitive.

gerchicovy avatar May 30 '22 13:05 gerchicovy

This is a Swift issue -- they give both methods the same 'unique' USR. It might be possible to work around in sourcekitten.

johnfairh avatar May 30 '22 13:05 johnfairh