Why does the default IntelliJ default class javadoc comment use non-standard syntax? Instead of creating a line with "User: jstauffer" it could create a line with "@author jstauffer". The other lines that it creates (Date and Time) probably don't have javadoc syntax to use but why not use the javadoc syntax when available?
For reference here is an example:
/** * Created by IntelliJ IDEA. * User: jstauffer * Date: Nov 13, 2007 * Time: 11:15:10 AM * To change this template use File | Settings | File Templates. */
Add a new commentType /** before a declaration and press Enter . The IDE auto-completes the doc comment for you. For information on how to disable this feature, refer to Disable automatic comments.
put the cursor on the method name you want to add javadoc ,and then press alt + enter, there will be an add javadoc option in the popup. If the method already has a javadoc,then there will be no add javadoc option.
Use View | Quick Documentation or the corresponding keyboard shortcut (by default: Ctrl + Q on Windows/Linux and Ctrl + J on macOS or F1 in the recent IDE versions).
Create JSDoc commentsPosition the caret before the declaration of the method/function or field to document, type the opening block comment /** , and press Enter . IntelliJ IDEA generates a JSDoc comment with a list of parameters ( @param ) and return values ( @returns ), where applicable.
I'm not sure why Idea doesn't use the @author
tag by default.
But you can change this behavior by going to File -> Settings -> File Templates
and editing the File Header
entry in the Includes
tab.
As of IDEA 14 it's: File -> Settings -> Editor -> File and Code Templates -> Includes -> File Header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With