Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit comment template and add type or function comment in JetBrains IntelliJ IDEA?

In JetBrains IntelliJ IDEA, I would like to edit comment which is like

/**  * Created by IntelliJ IDEA.<br/>  * User: ${USER}<br/>  * Date: ${DATE}<br/>  * Time: ${TIME}<br/>  * To change this template use File | Settings | File Templates.  */ 

and generate comment for a type like

public class MyUsernamePasswordAuthenticationFilter extends UsernamePasswordAuthenticationFilter 

or a function like

protected  void checkUsbKeyID(UserObj user,String usbKeyID) 
like image 864
zzxwill Avatar asked May 10 '12 01:05

zzxwill


People also ask

How do I create a comment in IntelliJ?

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.

How do I add automatic comments in IntelliJ?

Type /** 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.

How do I use IntelliJ templates?

Press Ctrl+Alt+S to open the IDE settings and select Editor | File and Code Templates. and specify the template name, file extension, name of the resulting file, and body of the template. Apply the changes and close the dialog.

How do you add a comment in Java?

Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by Java (will not be executed).


Video Answer


1 Answers

Type comments you can edit in menu File -> Settings -> File Templates. Then you look to tab Includes and edit entry File Header

enter image description here

Method comments isn't possible to edit, I think.

like image 110
chalimartines Avatar answered Sep 19 '22 06:09

chalimartines