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

Support Kotlin context parameters #4011

Open
atyrin opened this issue Jan 28, 2025 · 1 comment
Open

Support Kotlin context parameters #4011

atyrin opened this issue Jan 28, 2025 · 1 comment
Labels
enhancement An issue for a feature or an overall improvement language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs

Comments

@atyrin
Copy link
Contributor

atyrin commented Jan 28, 2025

The feature still experimental till Kotlin 2.3.
https://github.com/Kotlin/KEEP/blob/context-parameters/proposals/context-parameters.md

Dokka 2.0.0 in K1 and K2 modes ignores the presence of the context parameters in code.

@atyrin atyrin added enhancement An issue for a feature or an overall improvement language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs labels Jan 28, 2025
@fzhinkin
Copy link

Dokka 2.0.0 in K1 and K2 modes ignores the presence of the context parameters in code.

I'd say things a bit worse: Dokka ignores all the documentation written for functions w/ ctx params and emits an "empty" pages for such functions.

For a declaration like this:

package org.example

/**
 * That's a contextual function!
 *
 * @return nothing.
 */
context(_: Int)
public fun contextual() {
}

you'll get a page like this:
Image

Without a proper support from Dokka, it's unclear how to publish documentation for Stdlib part of the ctx params: https://youtrack.jetbrains.com/issue/KT-72866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue for a feature or an overall improvement language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs
Projects
None yet
Development

No branches or pull requests

2 participants