-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DokkaJavadoc does not respect JVMName #1284
Comments
@Kordyjan : any pointers on how this would be done ? We really need that as our internal Kotlin libs are used by both Java and Kotlin projects so having the right names in the Javadoc is important. I'd be happy to contribute a PR, but I'm not familiar with the Dokka codebase, so if you can point me in the right direction I may be able to help. |
Hi, sorry for the long response time.
You would need to change the displayed name when the annotation is in this extra. Would you like to pick up this issue? And would you mind doing it also for the other formats? |
@MarcinAman I'll try to see if I manage to do it for the Javadoc format, and I'll let you know. When you talk about the other format, you mean GFM and so, when using |
Yes, since Javadoc has it's own signature provider, same goes for the base plugin ( If you have any questions let me know, i'll try to explain how dokka works :D |
@MarcinAman ok, I've managed to wrap my head a little bit around the code, so I have some questions:
Sorry for all the questions, the codebase is a little bit hard to digest and I'm usually an Android developer so most of these concepts are still pretty alien to me (but I'm still keen on trying to do this, if you think it's worth the try for me) |
I'll add just one final question (before going on week-end, so feel free to respond when you have the time, no worries) : in the |
Maybe it is worth adding to this bug or I can file a new one, but |
@asfalcone could you point me to the location you have placed the function? It resolves correctly for me @bishiboosh: i'll answer later since it requires some checking on how jvmName is handled on file-level |
@MarcinAman This example is coming from our integration and unit tests (which extend |
@asfalcone I think that error was displayed due to the lack of stdlib on classpath, for me a test configuration like this works:
Yes, i talked with other team members and you approach is correct. JavaSignatureProvider and JavadocSignatureProvider should be changed to handle this annotation. KotlinSignatureProvider should stay the same and display annotation as usual. The reason for this is: when you use a code with this annotation from kotlin you are using it by the original name, not the annotated one.
AFAIK they are not handled. Handling it on file level would require adding it when creating documentable from
Yes, that is correct. DProperty has a
This depends on your implementation but i think the name of the entry should be updated there to match the one from the annotation. This is minor, don't worry with it, just check if the item is searchable with the JvmName |
@MarcinAman I've begun a little bit with |
(and thanks for all your answers, and sorry for all my questions, I'm slowly progressing on the subject) |
Oh, sorry The named used there will come from |
That's true unless you use |
@MarcinAman @kamildoleglo I'm beginning to have some progress (I've handled the (yes, I know, I began with only (I'm not handling |
It also seems that |
With the (as I'm doing quite a bit of work in |
(I admit it's slowly becoming a "fix issues in KotlinToJavaConverter if I can too" PR, I hope that's not too much of an issue) I'll list all issues I've tried to fix in the PR when I launch it, or I can list them here if needed |
Sorry, I have quite a bit of work right now, I'll try to make the PR next week if I can. In the end, I'm making most of the work in KotlinToJavaConverter, so not only are the names changing but the DRI as well, in order to avoid various linking issues. It's a bit longer but I think it'll be more stable in the end (it probably also avoids changing anything in the search) |
@bishiboosh will you have energy and time to work on this issue? If not i can do it |
@MarcinAman I don't have the time right now unfortunately, but I'll post what I've done as a WIP PR and try to explain all I've started, hoping you'll be able to go from there. I'll send that to you in a few hours if that's okay. (sorry, huge project just began at work and I thought I'd have more time) |
No problem |
@MarcinAman added the WIP PR, I've left you as many comments as I could on it |
JvmName should be right now handled. It is published in build: |
@MarcinAman any idea when this will land in an official release ? I'm okay with waiting a little bit more and avoiding using dev repo in production code |
i think it will be released within 1-2 weeks. I don't have an exact date set right now |
Describe the bug
When using
dokkaJavadoc
, the class names or method names are the Kotlin ones, instead of being the ones specified by@JvmName
Expected behaviour
Use names specified in
@JvmName
when rendering to Javadoc.To Reproduce
Using this sample project https://github.com/bishiboosh/dokka-issue-sample call the
dokkaJavadoc
task and see the generated documentationDokka configuration
No specific configuration
Installation
The text was updated successfully, but these errors were encountered: