ASTRewrite astRewrite = ASTRewrite.create(ast);
String[] names = possibleNames(expression);
for (int i = 0; i < names.length; i++) {
linkedModel.getPositionGroup(KEY_NAME, true).addProposal(names[0], null, 10);
}
Variable variable = ast.newVariable(names[0]);
Assignment assign = ast.newAssignment(variable, Assignment.OP_EQUAL, (Expression) astRewrite.createCopyTarget(expression));
astRewrite.replace(expression, assign, editGroup);
linkedModel.getPositionGroup(KEY_NAME, true).addPosition(astRewrite.track(variable.getName()), true);
linkedModel.setEndPosition(astRewrite.track(statement));
return astRewrite;
}