Community
Participate
Working Groups
I commonly experience this annoyance: I want to add a javadoc comment to some member of a class - field, method, embedded class, whatever. So I position myself on the line where the member is declared and hit Alt-Shift-J to insert the appropriate template. But nothing seems to happen. That's when I realize that eclipse went and added a class-level javadoc comment near the top of the file, which is not at all what I wanted. Of course I can easily undo that change, but even that's annoying because after undo I find myself positioned at the point where the spurious comment was just removed. So I have to again position myself where I really want to be working. I understand that eclipse uses my insertion point to figure out where I am in the code structure, and then chooses where to add the javadoc accordingly. But I think its decision in this instance is wrong - or at least very unintuitive. If I'm on the line where a new member declaration begins, that member should be the target of the javadoc. I think this could be addressed quite easily by ignoring any line indentation that surrounds or immediately follows the insertion point.
(In reply to Andy Lowry from comment #0) > I want to add a javadoc comment to some member of a class - field, method, > embedded class, whatever. So I position myself on the line where the member > is declared and hit Alt-Shift-J to insert the appropriate template. If you place the caret anywhere at the line where a member is declared and press Alt-Shift-J, it adds the Javadoc comment to the member correctly. ("|" represents the caret): public class C { |void m1(boolean b) { return; } } Only if you place the caret at an empty line, the Javadoc comment is added to the class.
My apologies... I omitted a crucial point in my write-up. The behavior I described occurs if I am in front of or anywhere inside the line's indentation. Hence my proposed solution that Eclipse should ignore indentation when choosing what sort of javadoc to produce.
(In reply to Andy Lowry from comment #2) > My apologies... I omitted a crucial point in my write-up. > > The behavior I described occurs if I am in front of or anywhere inside the > line's indentation. Hence my proposed solution that Eclipse should ignore > indentation when choosing what sort of javadoc to produce. Yes, we could be more tolerant here.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.