Community
Participate
Working Groups
I20050419 The old ASTR rewrite had a feature that wasn't supported on the new (non-modifiying) API anymore: Move a range of nodes and replace them with a node. Usages are: - Surround with - inline method -> additional API on org.eclipse.jdt.core.dom.rewrite.ListRewrite: /** * Creates and returns a placeholder node for a move of a range of nodes of the * current list. The moved nodes can optionally be replaced by a specified node. * * The placeholder node can either be inserted as new or used to replace an * existing node. When the document is rewritten, a copy of the source code * for the given node range is inserted into the output document at the position * corresponding to the placeholder (indentation is adjusted). * * @param first the node that starts the range * @param last the node that ends the range * @param replacingNode a node that is set at the location of the moved nodes * or <code>null</code> to remove all nodes * @param editGroup the edit group in which to collect the corresponding * text edits fro a replace, or <code>null</code> if ungrouped * @return the new placeholder node * @throws IllegalArgumentException An exception is thrown if the first or * last node are <code>null</code>, if a node is not a child of the current list or * if the first node is not before the last node. An <code>IllegalArgumentException * </code> is also thrown if the moved range is overlapping with an other moved * or copied range. * * @since 3.1 */ public final ASTNode createMoveTarget(ASTNode first, ASTNode last, ASTNode replacingNode, TextEditGroup editGroup) {
Created attachment 20064 [details] patch
Martin, both scenarios I have are fixed with the patch. Erich, can you please approve the API addition.
approved - having these problems fixed is important
patch released > 20050427
verified in 20050509-2010