Package com.python.pydev.analysis.builder

Examples of com.python.pydev.analysis.builder.AnalysisBuilderVisitor


        } else if (next instanceof IFile) {
            filesToVisit.add((IFile) next);
        }

        PythonNature nature = PythonNature.getPythonNature(next);
        AnalysisBuilderVisitor visitor = new AnalysisBuilderVisitor();
        visitor.visitingWillStart(new NullProgressMonitor(), false, null);
        FastStringBuffer buf = new FastStringBuffer();
        for (IFile f : filesToVisit) {
            if (monitor.isCanceled()) {
                break;
            }
            if (filesVisited.contains(f)) {
                continue;
            }
            filesVisited.add(f);
            monitor.setTaskName(buf.clear().append("Scheduling: ").append(f.getName()).toString());
            IDocument doc = FileUtilsFileBuffer.getDocFromResource(f);
            visitor.memo = new HashMap<String, Object>();
            visitor.memo.put(PyDevBuilderVisitor.IS_FULL_BUILD, false);
            long documentTime = f.getModificationStamp();
            visitor.memo.put(PyDevBuilderVisitor.DOCUMENT_TIME, documentTime);
            String moduleName;
            try {
                moduleName = nature.resolveModule(f);
            } catch (MisconfigurationException e) {
                Log.log(e);
                continue;
            }
            if (moduleName == null) {
                continue;
            }
            AnalysisBuilderVisitor.setModuleNameInCache(visitor.memo, f, moduleName);
            IModule module = nature.getAstManager().getModule(moduleName, nature, true);
            if (module == null) {
                Log.log(IStatus.WARNING, "Unable to get module: " + moduleName + " for resource: " + f, null);
                continue;
            }
            visitor.doVisitChangedResource(nature, f, doc, null, module, new NullProgressMonitor(), true,
                    AnalysisBuilderRunnable.ANALYSIS_CAUSE_PARSER, documentTime);
        }
        visitor.visitingEnded(new NullProgressMonitor());
        return 1;
    }
View Full Code Here

TOP

Related Classes of com.python.pydev.analysis.builder.AnalysisBuilderVisitor

Copyright © 2018 www.massapicom. 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.