How to change Java comment template?

I use / ** + ENTER to generate javadoc, but I found there a space before line 3:

1 /** 2 * Test. 3 * 4 * @author xxx 5 */ 

Every time I try the "source format" in eclipse, a space appears. How can I remove this space in the comment template somewhere?

+4
source share
4 answers

This sat me up from time to time until I found a solution. He mentions that this is work, it does not matter to me - it works like a charm. Do not forget about the plus, he is the savior of life!

0
source

I have the option Blank line in front of Javadoc tags in preference-> Java-> Code Style-> Formater, click the Edit button, open Comments and look at the Javadoc comment options . Maybe this will help you.

+1
source

You may need to completely disable Javadoc comment formatting.

Since Javadoc comments turn into HTML with a default Javadoc generator / fragment, it does not need extra spaces or line breaks. One space character is the same as many.

This is reflected in the Eclipse Javadoc format, which will consider it as part of the markup, which can be completely reformatted as long as the result looks like Javadoc. I don’t see a way to change the settings to keep this gap, without completely disabling the formatting.

-one
source

you can set it in Eclipse-> preference-> Java-> Code style-> Code Templates-> Types, then you can edit it and you can insert variables like date, time ...

-2
source

Source: https://habr.com/ru/post/1394138/


All Articles