Community
Participate
Working Groups
This is next step after bug 66026 fix. In DefaultCommentMapper, node extended start position algorithm can be optimized by using same mechanism than for end position (-1 when node starts at same position of its parent). We want also refine extended positions computation for nodes which gets their extended start or end position from their parent. I will provide some examples to illustrate what we want to refine in this heuristic and the impact on existing behavior...
Post 3.0
First example: /*c1*/ org.eclipse.jdt.core.dom.DefaultCommentMapper /*c2*/ dcm; In this statement currently /*c1*/ is attached only to full qualified name and /*c2*/ is attached both to full qualified name and simple name DefaultCommentMapper There's no reason that attachement was different for leading than for trailing comments. We think that it should be the same for both comments. So either /*c1*/ should also be attached to org, org.eclipse, etc... or /*c2*/ should not be attached to simple name DefaultCommentMapper
Second example: int x /*c1*/; int y /*c2*/ ; Currently /*c1*/ and /*c2*/ are respectively attached to simple names x and y. It looks not really natural for child node to be attached to a comment which is on a different line. So, we would like heuristic behaves as followed: /*c1a*/ int x /*c1b*/; /*c2a*/ int y /* c2b*/ ; /*c1a*/ attached both field declaration x and type int /*c2b*/ attached to simple name x /*c2a*/ attached to field declaration y but not to type int (not on same line) /*c2b*/ not attached to simple name y
Third example: void foo() { } /*c1*/ /*c2*/ Currently /*c1*/ and /*c2*/ are both attached to method declaration *and* body. If this ok for method declaration this is not correct for body which should not have any comment attached. A variation of this example is: void foo() { } /*c1*/ /*c2*/ Then we should always expect /*c1*/ and /*c2*/ attached to method declaration and only /*c1*/ attached to the body...
For the ASTRewrite it is important that a comment node is only assigned to one AST node. What would be problematic is if in the case of /*c1*/ org.eclipse.jdt.core.dom.DefaultCommentMapper /*c2*/ dcm; 'c2' would belong 'org.eclipse.jdt.core.dom.DefaultCommentMapper' and to 'dcm' as well: This would result in overlapping edits when e.g. you replace both. But I think that's not what you meant. In the case of /*c1*/ org.eclipse.jdt.core.dom.DefaultCommentMapper I think a comment should map to the largest element, so here the full qualified type.
Reopen as LATER is deprecated...
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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.