Inspection to detect block marker comments (//end if, // end while etc. ) and quickfix to delete them
I created a new feature request IDEA-71997 (http://youtrack.jetbrains.net/issue/IDEA-71997) . Please add your vote or comments if you are interested.
Thanks,
-Alex
----
Some coding styles advocate putting a marker comment at the end of each code block. I find these comments very annoying as they add zero information, esp. when any modern IDE will show you the matching paren and/or highlight the scope.
For example,
private static void myMethod(int endPoint) {
int m;
for (int k = 1; k <= endPoint; k++)
{
if (k < (endPoint / 2))
{
m = 1;
while (m <= (endPoint / 2))
{
m++;
} // end while
} // end if
else
{
m = 1;
while (m <= endPoint)
{
m++;
} // end while
} // end else
} // end for
} // end myMethod
I would like IDEA to provide an inspection to detect these comments, and offer a quickfix to remove them.
IDEA should reformat any lines which have comments removed accordingly to user's code style.
After the quickfix, I should have
private static void myMethod(int endPoint) {
int m;
for (int k = 1; k <= endPoint; k++) {
if (k < (endPoint / 2)) {
m = 1;
while (m <= (endPoint / 2)) {
m++;
}
} else {
m = 1;
while (m <= endPoint) {
m++;
}
}
}
}
请先登录再写评论。