Example A:
T result = (T) node.value; // keep return value,
There is a space between ;
and //
Example B:
if (k < 0 || k > size) // out of range,
return false;
There is a space between )
and //
.
Example C:
if (size == 0 || k == size) { // append at end,
append(value);
return true;
}
There is a space between {
and //
.
I searched on Google, and found this post: Is there any way to have the line comment shortcut add a space after // in WebStorm?
The link only tells how to add a space after //
, and that's the default behavior.
I didn't found any solution.
(BTW, I am not saying that it's better, I just personally prefer to that, and trying to get it done.)
A new issue is created on Jetbrains's youtrack for this feature: Provide option to add a space between code and "//" on formatting.
Please up vote it if you also desire for this feature.
There is no option to add the space between the code and the start of the comment in IntelliJ IDEA.
Feature request to track the progress: