Skip to content
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

Reporting value of constants defined in Java #2524

Closed
juliamcclellan opened this issue Jun 7, 2022 · 1 comment · Fixed by #2609
Closed

Reporting value of constants defined in Java #2524

juliamcclellan opened this issue Jun 7, 2022 · 1 comment · Fixed by #2609
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs

Comments

@juliamcclellan
Copy link
Contributor

Describe the bug
#1489 made it so the DProperty generated for a primitive constant defined in Kotlin contains a DefaultValue with the value of that constant. However, a DProperty generated for a Java constant (e.g. public static final int FOO = 5;) does not have a DefaultValue, so there isn't a way to access the value of the constant.

The change specifically used KotlinSourceElement. Is it possible to change this so it will work with Java as well?

Installation

  • Operating system: macOS
  • Build tool: Gradle v7.3
  • Dokka version: 1.6.20-dev-154
@vmishenev vmishenev added the feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs label Jun 8, 2022
IgnatBeresnev added a commit that referenced this issue Aug 4, 2022
@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Aug 4, 2022

JFYI the "bug" was not because KotlinSourceElement was used in DefaultDescriptorToDocumentableTranslator

We currently have two translators:

  • DefaultDescriptorToDocumentableTranslator is invoked for Kotlin sources only
  • DefaultPsiToDocumentableTranslator is invoked for Java sources only

Parsing Java constant values just wasn't implemented in DefaultPsiToDocumentableTranslator, but it was easy enough to implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feedback: Google An issue/PR submitted by colleagues at Google, most likely related to the Android API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants