-
Notifications
You must be signed in to change notification settings - Fork 407
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
Fix incorrect handling of static members used within @see
tag
#2627
Conversation
@@ -567,8 +568,20 @@ open class MarkdownParser( | |||
} | |||
|
|||
//Horrible hack but since link resolution is passed as a function i am not able to resolve them otherwise | |||
@kotlin.Suppress("DeprecatedCallableAddReplaceWith") | |||
@Deprecated("This function makes wrong assumptions and is missing a lot of corner cases related to generics, " + | |||
"parameters and static members. This is not supposed to be public API and will not be supported in the future") | |||
fun DRI.fqName(): String? = "$packageName.$classNames".takeIf { packageName != null && classNames != null } |
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.
The overall problem is basically here.
For com.example.Object.function()
it would return com.example.Object
, so if you have multiple @see
tags that point to multiple different functions from the same object
- there would be name collisions, and some members would be discarded by groupBy
further down the road.
This function is overall very wrong, and it would take a lot of effort to make it right
val linkText = dri.takeIf { it.target is PointingToDeclaration } | ||
?.let { seeTag.name.removePrefix("${it.packageName}.") } | ||
?: seeTag.name |
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.
Turns out, @see
can also be used with local params (we have tests for it) and generics. And with functions, of course, so using classNames
was wrong here, my bad
@@ -517,76 +517,73 @@ class ContentForSeeAlsoTest : BaseAbstractTest() { | |||
} | |||
|
|||
@Test | |||
fun `undocumented see also from java`(){ |
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.
Moved two tests to JavadocParserTest
as they are not about content, but verify documentables model.
Fixes #2626