-
Notifications
You must be signed in to change notification settings - Fork 410
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
[K2] Support kotlin-as-java and javadoc plugins and update version of Analysis API #3227
[K2] Support kotlin-as-java and javadoc plugins and update version of Analysis API #3227
Conversation
88f4b62
to
d30770d
Compare
/** | ||
* This is copy-pasted from org.jetbrains.dokka.analysis.kotlin.descriptors.compiler.impl.DescriptorInheritanceBuilder and adapted for symbols | ||
*/ | ||
internal class SymbolInheritanceBuilder(context: DokkaContext) : InheritanceBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to verify it due to #3232
// In K2 name of accessors parameter is `value` | ||
assert( | ||
setOf( | ||
"getIssuesFetched()", | ||
"setIssuesFetched(Integer issuesFetched)", | ||
"isFoo()", | ||
"setFoo(String isFoo)", | ||
) == props || setOf( | ||
"getIssuesFetched()", | ||
"setIssuesFetched(Integer value)", | ||
"isFoo()", | ||
"setFoo(String value)", | ||
) == props | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to stick to asserts from kotlin.test
And what do you think about introducing a tag/annotation similar to OnlyDescriptors
, but for Symbols? Then we could copy-paste this test with two different expected values, and mark one as only for descriptors and the other as only for symbols. This way, it will be easier to find such cases in the future and remove them once K1 is dropped, otherwise this assert will stay like this forever :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try to stick to asserts from kotlin.test
Sorry, I have missed it(
And what do you think about introducing a tag/annotation similar to OnlyDescriptors, but for Symbols?
I thought about it. But
- I do not want to encourage to make the difference in documentable model between K1 and K2.
- Currently, we have only 2 such tests (this test and another 'catch exception'), where we have 2 possibilities. K1 works correctly for all out tests except [K1] Incorrect Java synthetic properties #3128 If we have new tests where K1 works incorrectly, it will make sense to add 'OnlyDescriptors'. Or we will decide it during Fix inconsistencies between K1 and K2 #3115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make sure you don't forget about it, as this test is not marked with any annotation and there's no TODO. In a year or so, it will be difficult for other people to understand why this assert is written this way
plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt
Outdated
Show resolved
Hide resolved
internal val descriptorInheritanceBuilder by extending { | ||
plugin<InternalKotlinAnalysisPlugin>().inheritanceBuilder providing ::SymbolInheritanceBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal val descriptorInheritanceBuilder by extending { | |
plugin<InternalKotlinAnalysisPlugin>().inheritanceBuilder providing ::SymbolInheritanceBuilder | |
internal val symbolInheritanceBuilder by extending { | |
plugin<InternalKotlinAnalysisPlugin>().inheritanceBuilder providing ::SymbolInheritanceBuilder |
6399b1d
to
f6f45ca
Compare
f6f45ca
to
545d921
Compare
Also, it contains some fixes to make unit tests of kotlin-as-java and javadoc plugins green.