My Eclipse formatter invoked on the save command is set to wrap lines of comments, as this is what I desire most of the time. However, I occasionally want Eclipse NOT to wrap some lines of comments. Here is an example.
If I write:
/**
* My Eclipse formatter is set to wrap lines of comments, as this is what I
* desire most of the time. However, I occasionally want Eclipse NOT to wrap
* some lines of comments such as when I provide a simple example of an
* output format like here:
*
* Example output:
* <comments>
* <comment>This should be on one line</comment>
* <comment>And this on the next</comment>
* </comments>
*
*/
the Eclipse formatter will turn this into:
/**
* My Eclipse formatter is set to wrap lines of comments, as this is what I
* desire most of the time. However, I occasionally want Eclipse NOT to wrap
* some lines of comments such as when I provide a simple example of an
* output format like here:
*
* Example output: <comments> <comment>This should be on one line</comment>
* <comment>And this on the next</comment> </comments>
*
*/
which I don't want. I know I can prevent each line to wrap with <li>
as below but that gets cumbersome very quickly, makes the comments more confusing, and still does not prevent Eclipse from changing the indentation:
/**
* My Eclipse formatter is set to wrap lines of comments, as this is what I
* desire most of the time. However, I occasionally want Eclipse NOT to wrap
* some lines of comments such as when I provide a simple example of an
* output format like here:
*
* Example output:<li>
* <comments><li>
* <comment>This should be on one line</comment><li>
* <comment>And this on the next</comment><li>
* </comments><li>
*
*/
Is there something I could put before "Example output" to tell Eclipse to ignore the formatter so that it preserves the indentation and line wrapping I chose for a portion of my comments only?