Reputation: 339
I'm using Android Studio 3.0.1. I can hit fix doc comment
to insert comment of method quickly in Java, but not effective in Kotlin. How can I solve it?
Upvotes: 1
Views: 4980
Reputation: 81889
Kotlin and especially KDoc encourage a different documentation style. As stated in this discussion:
The reason is that we found that referring to parameter names from the documentation text allows to write documentation that is more concise and easier to read compared to the traditional javadoc style where every parameter is documented in a separate tag. Therefore, we do not generate the template with parameter names by default. (D. Jemerov, Kotlin in Action Author)
Here’s an example of let
, which is part of the standard library:
/**
* Calls the specified function [block] with `this` value as its argument and returns its result.
*/
@kotlin.internal.InlineOnly
public inline fun <T, R> T.let(block: (T) -> R): R
Upvotes: 3
Reputation: 6569
When you're typing @
inside a kdoc
, you'll see auto complete for @param
, and after @param
you'll see all parameters, and currently you cannot complete all parameters within one click.
Mention the /** */
comments are called kdoc
in Kotlin, which is not javadoc
.
Upvotes: 2