Beispiel #1
0
 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();
 }
  private void deduce() {
    ModuleAdapter module = scopeAdapter.getModule();
    List<SimpleAdapter> selected =
        module.getWithinSelection(selection, scopeAdapter.getUsedVariables());

    List<SimpleAdapter> before = new ArrayList<SimpleAdapter>();
    List<SimpleAdapter> after = new ArrayList<SimpleAdapter>();
    extractBeforeAfterVariables(selected, before, after);

    deduceParameters(before, selected);
    deduceReturns(after, selected);
  }