If I have the following code and use the "Replace with end-of-line comment" intention action on COMMENT ONE...
public void foo() {
/* COMMENT ONE */
/* COMMENT TWO */
}
...it will be formatted like this:
public void foo() {
// COMMENT ONE
/* COMMENT TWO */
}
All empty lines after the comment are removed. If it is followed by another comment, the indentation of the latter comment will be removed. If it is followed by code, only the empty lines are removed.
The "Replace with C-style comment" intention action does not have this problem - it leaves all whitespace after the comment untouched. However, both of these intention actions remove unnecessary empty lines (2 or more) that are before the comment (maybe because of the coding style settings).
Description
If I have the following code and use the "Replace with end-of-line comment" intention action on COMMENT ONE...
public void foo() {
/* COMMENT ONE */
/* COMMENT TWO */
}
...it will be formatted like this:
public void foo() {
// COMMENT ONE
/* COMMENT TWO */
}
All empty lines after the comment are removed. If it is followed by another comment, the indentation of the latter comment will be removed. If it is followed by code, only the empty lines are removed.
The "Replace with C-style comment" intention action does not have this problem - it leaves all whitespace after the comment untouched. However, both of these intention actions remove unnecessary empty lines (2 or more) that are before the comment (maybe because of the coding style settings).
If "Replace with end-of-line comment" is invoked on the first comment:
..it will create the following code: