preserve kdocs -> kir -> sir -> swift#182
Conversation
|
Thank you for the pull request, I'll review it right after we get a version supporting Kotlin 2.3.20 out. I've also finally gotten around to open-sourcing our acceptance tests, so if you could rebase on top of latest main and try if the tests pass on your machine and perhaps try adding a few new acceptance tests (it might not be possible to verify this feature through the current tests unfortunately). |
|
@TadeasKriz awesome, sounds good! I am traveling next week, so won't be able to get back to this until the following week, but I'll let you know if I have any issues with the tests. |
9398386 to
1cdcfae
Compare
|
Hmm, any chance these tests are a lil flaky? I just ran the failing ones locally (with the |
|
@TadeasKriz following back up to see if you could try rerunning the failed jobs? Thanks! |
|
Hey, I'm sorry for the long wait, I was super busy with work. |
TadeasKriz
left a comment
There was a problem hiding this comment.
This PR seems to be doing a lot. Could you write some acceptance tests for the new functionality? Thanks!
| EntrypointUtils.runKirPhases( | ||
| mainSkieContext = mainSkieContext, | ||
| objCExportedInterfaceProvider = ObjCExportedInterfaceProvider(input), | ||
| ) | ||
|
|
||
| EntrypointUtils.runSirPhases(mainSkieContext) | ||
|
|
There was a problem hiding this comment.
Why did you move these to the SkieIrGenerationExtension?
There was a problem hiding this comment.
Hey, sorry for my delay, things are a little busy on my side, too, but I will definitely look into adding some tests (fair warning, I have an onsite next week, so won't get to it until after that 😄)
As for the question, it's just because of task ordering. CollectKDocFromSourcesPhase runs as part of runKotlinIrPhases (to populate the context map), which needs to happen before these two phases. Originally, they were happening before the KDocs were collected and they ended up reading an empty map.
Fixes #45 / #46
There was already precedent for adding docs using a
documentationproperty on theSirDeclaration, so this just builds off of that.Working backwards (because that's how I thought about this lol):
documentationpropertydocumentationproperty added to the companion KIR elementIDK if there are any relevant tests to write/run because the acceptance-tests module is a private submodule, so this is just a best effort to not break anything 😅 But I at least did a local publish (many of them...) and confirmed it's adding docs in my library, so at least it works.