/** * @return <code>true</code> if the given {@link VariableElement} is referenced after the {@link * #selectionRange}. */ private boolean isUsedAfterSelection(final VariableElement element) { final AtomicBoolean result = new AtomicBoolean(); parentMember.accept( new ASTVisitor<Void>() { @Override public Void visitIdentifier(DartIdentifier node) { VariableElement nodeElement = ASTNodes.getVariableElement(node); if (nodeElement == element) { int nodeOffset = node.getSourceInfo().getOffset(); if (nodeOffset > selectionStart + selectionLength) { result.set(true); } } return null; } }); return result.get(); }