Examples of IPyRefactoring2


Examples of com.python.pydev.refactoring.IPyRefactoring2

    public static final boolean DEBUG_FIND_REFERENCES = false;

    @Override
    protected String perform(IAction action, IProgressMonitor monitor) throws Exception {
        IPyRefactoring2 r = (IPyRefactoring2) AbstractPyRefactoring.getPyRefactoring();
        RefactoringRequest req = getRefactoringRequest(new NullProgressMonitor()); //as we're doing it in the background
        req.fillInitialNameAndOffset();
        if (req.initialName != null && req.initialName.trim().length() > 0) {
            NewSearchUI.runQueryInBackground(newQuery(r, req));
        }
View Full Code Here

Examples of com.python.pydev.refactoring.IPyRefactoring2

      // hopefully it won't be a bottleneck for others.
      PythonNature pythonNature = PythonNature.getPythonNature(project);
      pythonNature.rebuildPath();

      request.fillInitialNameAndOffset();
      IPyRefactoring2 pyRefactoring = (IPyRefactoring2)
        AbstractPyRefactoring.getPyRefactoring();
      Map<Tuple<String,File>, HashSet<ASTEntry>> refs =
        pyRefactoring.findAllOccurrences(request);
      for (Tuple<String,File> tuple : refs.keySet()){
        for (ASTEntry entry : refs.get(tuple)){
          Position position = Position.fromLineColumn(
            tuple.o2.toString().replace('\\', '/'),
            entry.getName(),
            entry.node.beginLine,
            entry.node.beginColumn);
          if (!results.contains(position)){
            results.add(position);
          }
        }
      }

    // find declaration
    }else{
      IPyRefactoring pyRefactoring = AbstractPyRefactoring.getPyRefactoring();
      ItemPointer[] defs = pyRefactoring.findDefinition(request);

      for (ItemPointer item : defs){
        if (item.file == null || item.file.toString().endsWith(".so")){
          continue;
        }
View Full Code Here

Examples of com.python.pydev.refactoring.IPyRefactoring2

                            //set whatever is needed for the hierarchy
                            IPyRefactoring pyRefactoring = AbstractPyRefactoring.getPyRefactoring();
                            if (pyRefactoring instanceof IPyRefactoring2) {
                                RefactoringRequest refactoringRequest = getRefactoringRequest(monitor);
                                IPyRefactoring2 r2 = (IPyRefactoring2) pyRefactoring;
                                model = r2.findClassHierarchy(refactoringRequest, false);

                                if (monitor.isCanceled()) {
                                    return;
                                }
                                Runnable r = new Runnable() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.