简体   繁体   中英

Specific comment blocks in Eclipse

I often see comment blocks like:

// ===========================================================
// Methods
// ===========================================================

Is there any way to add them in Eclipse fast?

您可以尝试创建代码模板:-> Window -> Preferences -> Java > Editor -> Templates

You can add your own comment template in Eclipse. I think you can do this under: Main Menu -> Window -> Preferences -> Java -> Code Style -> Code Templates -> Configure generated code and comments .

Take a look at these instructions here and this answer i think it is exactly what you need.

Ctrl-/ to toggle "//" comments and Ctrl-Shift-/ to toggle "/* */" comments. At least for Java, anyway - other tooling may have different shortcuts.

Ctrl-\\ will remove a block of either comment, but won't add comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM