Kotlin / dokka

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

[K2] Unresolved declarations are resolved in KDoc #3681

Open atyrin opened 2 months ago

atyrin commented 2 months ago
/**
 * Resolve value: [value]
 */
fun useValue() = value

value in the function body is unresolved in IDE. K2: value in KDoc is resolved and refers to kotlin-stdlib-2.0.0-sources.jar!/commonMain/kotlin/util/Lazy.kt:44 for IDE and to https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/ for Dokka

K1: value in kdoc is unresolved

Installation

atyrin commented 2 months ago

Ticket for Analysis API: https://youtrack.jetbrains.com/issue/KT-69736/K2-IDE-False-positive-resolution-from-KDoc-for-value

vmishenev commented 2 months ago

The general case:

fun getProperty() = 0
/**
 * [property] is resolved in K2, but - not in K1
 */
fun usage() = 0

Related issue: https://github.com/Kotlin/dokka/issues/3586