Is there a way to make Eclipse's built-in Java code formatter ignore comments? Whenever I run it, it turns this:
/*
* PSEUDOCODE
* Read in user's string/paragraph
*
* Three cases are possible
* Case 1: foobar
* do case 1 things
* Case 2: fred hacker
* do case 2 things
* Case 3: cowboyneal
* do case 3 things
*
* In all cases, do some other thing
*/
into this:
/*
* PSEUDOCODE Read in user's string/paragraph
*
* Three cases are possible Case 1: foobar do case 1 things Case 2: fred
* hacker do case 2 things Case 3: cowboyneal do case 3 things
*
* In all cases, do some other thing
*/
I have already played around with the Windows > Preferences > Java > Code Style > Formatter settings but can't find one for keeping comment formatting. I'm using Eclipse 3.4.0.
There is another solution that you can use to suppress the formatting of specific block comments. Use /*-
(note the hyphen) at the beginning of the block comment, and the formatting
won't be affected if you format the rest of the file.
/*- * Here is a block comment with some very special * formatting that I want indent(1) to ignore. * * one * two * three */
Source: http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141999.html#350