Examples of ICodeCompletionASTManager


Examples of org.python.pydev.core.ICodeCompletionASTManager

                }
                final JobProgressComunicator jobProgressComunicator = new JobProgressComunicator(monitor,
                        "Rebuilding modules", IProgressMonitor.UNKNOWN, this);
                final PythonNature nature = PythonNature.this;
                try {
                    ICodeCompletionASTManager tempAstManager = astManager;
                    if (tempAstManager == null) {
                        tempAstManager = new ASTManager();
                    }
                    if (monitor.isCanceled()) {
                        return Status.OK_STATUS;
                    }
                    synchronized (tempAstManager.getLock()) {
                        astManager = tempAstManager;
                        tempAstManager.setProject(getProject(), nature, false); //it is a new manager, so, remove all deltas

                        //begins task automatically
                        tempAstManager.changePythonPath(paths, project, jobProgressComunicator);
                        if (monitor.isCanceled()) {
                            return Status.OK_STATUS;
                        }
                        saveAstManager();
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

     */
    @Override
    public void visitChangedResource(IResource resource, ICallback0<IDocument> document, IProgressMonitor monitor) {
        PythonNature pythonNature = getPythonNature(resource);
        if (pythonNature != null) {
            ICodeCompletionASTManager astManager = pythonNature.getAstManager();

            if (astManager != null) {
                IPath location = resource.getLocation();
                astManager.rebuildModule(new File(location.toOSString()), document, resource.getProject(),
                        new NullProgressMonitor(), pythonNature);
            }
        }
    }
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

    @Override
    public void visitRemovedResource(IResource resource, ICallback0<IDocument> document, IProgressMonitor monitor) {
        PythonNature pythonNature = getPythonNature(resource);
        if (pythonNature != null) {

            ICodeCompletionASTManager astManager = pythonNature.getAstManager();
            if (astManager != null) {
                IPath location = resource.getLocation();

                astManager.removeModule(new File(location.toOSString()), resource.getProject(),
                        new NullProgressMonitor());
            }
        }
    }
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

        IPythonNature nature = fNature;
        if (nature == null) {
            return null;
        }

        ICodeCompletionASTManager astManager = nature.getAstManager();
        if (astManager == null) {
            // AST manager might not be yet available
            // Code completion job is scheduled to be run
            return null;
        }

        return astManager.getModulesManager();
    }
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

        astModificationTimeStamp = ((IDocumentExtension4) doc).getModificationStamp();

        try {
            IPythonNature pythonNature = this.getPythonNature();
            if (pythonNature != null) {
                ICodeCompletionASTManager astManager = pythonNature.getAstManager();
                if (astManager != null) {
                    IModulesManager modulesManager = astManager.getModulesManager();
                    if (modulesManager != null) {
                        File editorFile = this.getEditorFile();
                        if (editorFile != null) {
                            String moduleName = pythonNature.resolveModule(editorFile);
                            if (moduleName != null) {
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

    /**
     * Start a request for an ast manager (start caching things)
     */
    public boolean startRequests() {
        ICodeCompletionASTManager astManager = this.getAstManager();
        if (astManager == null) {
            return false;
        }
        IModulesManager modulesManager = astManager.getModulesManager();
        if (modulesManager == null) {
            return false;
        }
        synchronized (modulesManagerStackLock) {
            modulesManagerStack.push(modulesManager);
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

     */
    private void addModuleManagers(ArrayList<IModulesManager> list, Collection<IProject> projects) {
        for (IProject project : projects) {
            PythonNature nature = PythonNature.getPythonNature(project);
            if (nature != null) {
                ICodeCompletionASTManager otherProjectAstManager = nature.getAstManager();
                if (otherProjectAstManager != null) {
                    IModulesManager projectModulesManager = otherProjectAstManager.getModulesManager();
                    if (projectModulesManager != null) {
                        list.add((IModulesManager) projectModulesManager);
                    }
                } else {
                    String msg = "No ast manager configured for :" + project.getName();
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

        Map<String, IToken> cachedTokens = new HashMap<String, IToken>();

        //if still not found, we have to get all the tokens, including regular and wild imports
        ICompletionState state = CompletionStateFactory.getEmptyCompletionState(nature, completionCache);
        ICodeCompletionASTManager astManager = nature.getAstManager();
        state.setActivationToken(activationToken);

        //we don't want to gather builtins in this case.
        state.setBuiltinsGotten(true);
        IToken[] globalTokens = astManager.getCompletionsForModule(this, state, searchSameLevelMods);
        for (IToken token : globalTokens) {
            String rep = token.getRepresentation();
            IToken t = cachedTokens.get(rep);
            if (t != null) {
                //only override tokens if it's a getattr that's not defined in the builtin module
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

    }

    private void fillCompletions(int requestOffset, ArrayList<ICompletionProposal> completions, String qual,
            IPythonNature nature, int qlen, boolean addAutoImport, IScriptConsoleViewer viewer, boolean getSystem) {

        ICodeCompletionASTManager astManager = nature.getAstManager();
        if (astManager == null) {
            return;
        }

        Image img = PyCodeCompletionImages.getImageForType(IToken.TYPE_PACKAGE);

        IModulesManager modulesManager = astManager.getModulesManager();
        try {
            if (modulesManager == null) {
                nature.getProjectInterpreter(); //Just getting it here is likely to raise an error if it's not well configured.
            }
View Full Code Here

Examples of org.python.pydev.core.ICodeCompletionASTManager

        }

        if (request.qualifier.length() >= CodeCompletionPreferencesPage
                .getCharsForContextInsensitiveModulesCompletion()) { //at least n characters required...

            ICodeCompletionASTManager astManager = request.nature.getAstManager();
            if (astManager == null) {
                return list;
            }
            String initialModule = request.resolveModule();

            Image img = PyCodeCompletionImages.getImageForType(IToken.TYPE_PACKAGE);

            IModulesManager projectModulesManager = astManager.getModulesManager();

            String lowerQual = request.qualifier.toLowerCase();
            Set<String> allModuleNames = projectModulesManager.getAllModuleNames(true, lowerQual);

            FastStringBuffer realImportRep = new FastStringBuffer();
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.