Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.41k stars 405 forks source link

[K2] Different PageId in K1 and K2 for nested classes #3388

Closed atyrin closed 5 months ago

atyrin commented 10 months ago

So far, I have two samples for the change with no visible side effects.

For nested classes

class Parent{
    class Nested
}

K1: pageids="module::/Parent.Nested/Nested/#/PointingToDeclaration//-1486420497" K2: pageids="module::/Parent.Nested/Parent.Nested/#/PointingToDeclaration//-1486420497"

For vararg arguments

fun withVararg(i: Int, vararg s: String){}

K1: pageids="module:://withVararg/#kotlin.Int#kotlin.Array[kotlin.String]/PointingToDeclaration//-1486420497" K2: pageids="module:://withVararg/#kotlin.Int#kotlin.String/PointingToDeclaration//-1486420497"

Installation

Parent: https://github.com/Kotlin/dokka/issues/3328

vmishenev commented 10 months ago

For vararg arguments

this can affect #2881

vmishenev commented 9 months ago

Both cases are on Dokka's side.

For vararg arguments

Need to ask Analysis API team about String is the expected type here instead of Array<String>

vmishenev commented 9 months ago

For second case It would be nice to have https://youtrack.jetbrains.com/issue/KT-64340/Analysis-API-no-way-to-get-a-type-of-vararg-parameter

IgnatBeresnev commented 9 months ago

Best case scenario is that it's fixed in Analysis API, but we can add a local workaround.

IgnatBeresnev commented 5 months ago

It was decided to extract the case with varargs into a separate issue (#3558) because it is tricker to fix.

This issue should focus on fixing it for nested classes, which should be fairly easy.