Lining up comments in code arragement
Answered
I really like the ability in Idea to arrange code and have got it all set up exactly how I'd like - except that the comments it produces aren't lined up with each other.
For example, If I have a block of variables, they will be started with a "//Variables Start" comment and ended with a "//Variables End" comment, but, while the start comment will line up with the block of variables, the end up will start right at the beginning of the line. Same with blocks of Methods etc.
For example:

Is there any way to get them to line up properly?
Also, is there a way to prevent these comments in anonymous inner classes?
Please sign in to leave a comment.
Hello Paul,
Does it help if you disable "Comment at first column" option in Java Code Style settings ?
Only in the sense that they do now line up - but (bizarrely) at the beginning of the line, instead of in line with the relevant code...
To clarify that we're both referring to the same setting - It's in Settings > Code Style > Java > Code Generation (tab) > Comment Code (section) > Line Comment at first column - unchecked.
This is still an issue - any further thoughts?
Hi. Please try Settings > Code Style > Java > Wrapping and braces > Comment at first column
As you can see above, I have already tried that and it hasn't solved the issue.
>Is there any way to get them to line up properly?
Can you describe the the expected/actual result you get and the steps to reproduce? I'm attaching a gif of how it works for me. Note: Wrapping and braces > Comment at first column - works for already existing code (when you reformat it) and the Generation (tab) > Comment Code (section) > Line Comment at first column - when you are creating a new comment.
For some reason, it's not behaving as before. It now generates all comments at the beginning of the line, but, if I edit them to move them inline with the code they refer to (what I want) re-arranging makes no difference. This is the behaviour regardless of what setting I have regarding comment position etc.
What I was getting is outlined in the image in my first post. What I want is both sets of comments (start and end) to line up with the code in the way that the first comment does in that same image in my first post.
Cannot reproduce. Please provide your File | Export settings... jar and idea.log after IDE restart.
Also try disabling 3rd plugins if you use any.