Package org.python.pydev.editor.codecompletion.revisited.visitors

Examples of org.python.pydev.editor.codecompletion.revisited.visitors.Definition


                    request.communicateWork(com.aptana.shared_core.string.StringUtils.format("Found: %s parents for: %s", definitions.size(), d.value));

                    //and add a parent for each definition found (this will make up what the next search we will do)
                    for (IDefinition def : definitions) {
                        Definition definition = (Definition) def;
                        HierarchyNodeModel model2 = createHierarhyNodeFromClassDef(definition);
                        if (model2 != null) {
                            if (allFound.containsKey(model2) == false) {
                                allFound.put(model2, model2);
                                toFindOnRound.parents.add(model2);
View Full Code Here


                request.popMonitor().done();
            }

            if (pointers.length == 1) {
                //ok, this is the default one.
                Definition d = pointers[0].definition;
                HierarchyNodeModel model;
                try {
                    request.pushMonitor(new SubProgressMonitor(request.getMonitor(), 5));
                    model = createHierarhyNodeFromClassDef(d);
                } finally {
View Full Code Here

        //import definitions until we actually find what we're looking for.
        ImportInfo info = found.importInfo;
        if (info != null && info.wasResolved) {
            if (info.rep.length() != 0 && info.token.isImport()) {
                //we only actually had a match with a module if the representation found is empty
                Definition definition = info.getModuleDefinitionFromImportInfo(nature, this.completionCache);
                if (definition != null && definition.module.getName().equals(this.moduleToFind.getName())) {
                    return true;
                }

            } else if (info.mod.getName().equals(this.moduleToFind.getName())) {
View Full Code Here

                if (definitions2.length == 1) {
                    //and if it is a function, we're actually unable to find
                    //out about its return value
                    if (definitions2[0] instanceof Definition) {
                        Definition definition = (Definition) definitions2[0];
                        if (definition.ast instanceof FunctionDef) {
                            return true;

                        } else if (definition.ast instanceof ClassDef) {
                            ClassDef def = (ClassDef) definition.ast;
                            if (isDynamicClass(def)) {
                                return true;
                            }
                        }
                    }
                }
            } else if (foundDefinition instanceof Definition) { //not Assign definition
                Definition definition = (Definition) foundDefinition;
                if (definition.ast instanceof ClassDef) {
                    //direct class access
                    ClassDef classDef = (ClassDef) definition.ast;
                    if (isDynamicClass(classDef)) {
                        return true;
View Full Code Here

        if (definition.ast instanceof FunctionDef) {
            node = (FunctionDef) definition.ast;
        } else {
            node = (FunctionDef) definition.scope.getScopeStack().peek();
        }
        super.definition = new Definition(node.beginLine, node.beginColumn, ((NameTok) node.name).id, node,
                definition.scope, definition.module);
        this.functionName = ((NameTok) node.name).id;
    }
View Full Code Here

            }
            if (found.importInfo == null) {
                throw new RuntimeException("Expecting import info from the found entry.");
            }
            if (found.importInfo.wasResolved) {
                Definition d = found.importInfo
                        .getModuleDefinitionFromImportInfo(request.nature, new CompletionCache());
                if (d == null || d.module == null) {
                    status.addFatalError(com.aptana.shared_core.string.StringUtils.format("Unable to find the definition for the module."));
                    return;
                }
View Full Code Here

TOP

Related Classes of org.python.pydev.editor.codecompletion.revisited.visitors.Definition

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.