Hi, is there a way to generate all the documentati...
# intellij
a
Hi, is there a way to generate all the documentation of a file ? I have a file containing a class with a lot of fields & methods and I have to document everything and I'm asking if there is a way to generate for all the members what is generated when we type
/**
and we press ENTER
e
I’m curious, if there was, how would this tool know what to generate? What exactly would it generate?
a
The exact thing generated by default when we type
/**
before a member/class/object/enum/interface/function but for everything in the current file
e
Ah okay I get it. I dont know of any existing plugins but it sounds like an interesting weekend project!
a
I don't know anything about creating plugins so if you want to do it I'm happy to know it :)
c
Playing devil's advocate here, but I would argue that it's better to save yourself all that time/effort and not generate all those comments automatically. What is there to be gained from a bunch of auto-generated documentation comments (other than checking a box of "it has documentation")? Kotlin is strongly-typed, so there's no additional information that could be automatically put in a comment that isn't already part of the function signature itself. And the Kotlin coding conventions strongly recommends not using the standard
@param/@return
tags typical in Javadoc comments, but using prose and including links directly within the comment text (https://kotlinlang.org/docs/coding-conventions.html#documentation-comments). So to properly document those functions, you'd need to go in and manually write descriptions for them anyway. Anything auto-generated would just be redundant and likely to become outdated over time, and so you'd actually be better-off not having those comments at all.
a
I agree with you, but, it's for a Web project in WebStorm, so it's for JavaScript, not Kotlin :< (And I can't choose TypeScript as my teacher want us to keep using HTML/CSS/JS) And documenting everything is just for me to set types for everything so it's less difficult to code