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

Missing annotation values for static imports #2580

Closed
juliamcclellan opened this issue Jul 21, 2022 · 2 comments · Fixed by #2593
Closed

Missing annotation values for static imports #2580

juliamcclellan opened this issue Jul 21, 2022 · 2 comments · Fixed by #2593
Assignees
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

Some annotation values which are statically imported constants are not showing up in docs. For example, this function has the annotation @RequiresPermission(ACCESS_FINE_LOCATION) where the constant comes from import static android.Manifest.permission.ACCESS_FINE_LOCATION;, but the annotation value shows up as the empty string in the docs. Some annotations in the same file use a set of constant values, which are not showing up at all.

It seems this was addressed in #1845 with the JvmAnnotationAttribute.toValue function in DefaultPsiToDocumentableTranslator, but in this case the attributeValue of the JvmAnnotationAttribute is not a JvmAnnotationEnumFieldValue (it is a PsiAnnotationConstantValue), so that solution doesn't work here:

Screen Shot 2022-07-21 at 11 11 59 AM

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 Jul 28, 2022
@IgnatBeresnev IgnatBeresnev self-assigned this Jul 29, 2022
@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Jul 29, 2022

Hi! Thank you so much for debugging it and posting your findings, it has saved a lot of time and enabled me to throw together a fix, knowing it wouldn't take long.

These static imports are resolved to values themselves, so hopefully it's all good now.

@juliamcclellan
Copy link
Contributor Author

Thanks for the fix!

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