bind: added protocol documentation to Objective-C generated file

Fixes golang/go#46956

Change-Id: Ifa1b8e7f2a0e46034f0eccc32249f69a064199e3
GitHub-Last-Rev: 175fa08b1696fca4c11b35b691e0df550ed66864
GitHub-Pull-Request: golang/mobile#67
Reviewed-on: https://go-review.googlesource.com/c/mobile/+/331429
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Hilário Coelho 2022-05-17 14:48:02 +00:00 committed by Hyang-Ah Hana Kim
parent 50dca8fc07
commit eae5320c54
2 changed files with 5 additions and 0 deletions

View File

@ -894,6 +894,7 @@ func (g *ObjcGen) genInterfaceInterface(obj *types.TypeName, summary ifaceSummar
}
func (g *ObjcGen) genInterfaceH(obj *types.TypeName, t *types.Interface) {
doc := g.docs[obj.Name()]
summary := makeIfaceSummary(t)
if !summary.implementable {
g.genInterfaceInterface(obj, summary, false)
@ -906,6 +907,7 @@ func (g *ObjcGen) genInterfaceH(obj *types.TypeName, t *types.Interface) {
continue
}
s := g.funcSummary(nil, m)
g.objcdoc(doc.Member(m.Name()))
g.Printf("- %s;\n", s.asMethod(g))
}
g.Printf("@end\n")

View File

@ -18,6 +18,9 @@
@class DocI;
@protocol DocI <NSObject>
/**
* IM is a method.
*/
- (void)im;
@end