Support documenting context parameters #4065
Labels
enhancement
An issue for a feature or an overall improvement
kdoc-spec
An issue that requires clarification from the KDoc spec's perspective
Currently it's possible to document function parameters via
@param
and receiver of function/property via@receiver
:The same should be possible for context parameters.
There are two options on how it could work:
@context
- context parameters have a separate tag, similar to receiver. As context parameters have different meaning, and most likely should be represented in different section of documentation - separate fromParameters
section, it might make sense to have separate tag. In this case receiver, function parameters and context parameters will have three different tags.@param
- context parameters are treated similar to ordinary parameters. But it's still make sense to show them separately in documentation.Bonus (questionable) option: use
@param
for referencing both context parameters, function parameters and receiver. In KDoc it's possible to use[this]
to reference receiver of function/property in the way it's possible to reference named parameters in documentation:With this possibility in mind, it could be possible to replace
@receiver
tag with@param this
:Or with brackets:
In this case
@receiver
tag could be deprecated (or gradually phased out) and both referencing and documenting receiver will have same syntaxThe text was updated successfully, but these errors were encountered: