public final class VisitorFactory {
private VisitorFactory() {
}
public static ITextSelection createSelectionExtension(AbstractScopeNode<?> scope, ITextSelection selection) {
SelectionExtenderVisitor visitor = null;
try {
visitor = new SelectionExtenderVisitor(scope.getModule(), selection);
scope.getASTNode().accept(visitor);
} catch (Exception e) {
throw new RuntimeException(e);
}
return visitor.getSelection();
}