Package com.python.pydev.analysis.visitors.ImportChecker

Examples of com.python.pydev.analysis.visitors.ImportChecker.ImportInfo


        //only report undefined imports if we're not inside a try..except ImportError.
        boolean reportUndefinedImports = withinExceptNode == null;

        boolean requireTokensToBeImports = false;
        ImportInfo importInfo = null;
        if (generator != null) {
            //it will only enter here if it is a wild import (for other imports, the generator is equal to the
            //import)
            if (!generator.isImport()) {
                throw new RuntimeException(
View Full Code Here


     * @param map this is the map that contains the imports Found occurrences (it has to be passed,
     * as there is a map for the imports that are actually in the namespace and another for those
     * that are 'artificially' generated).
     */
    private void addFoundToImportsMap(Found found, Map<String, List<Tuple3<Found, Integer, ASTEntry>>> map) {
        ImportInfo info = found.importInfo;
        String modName = UNRESOLVED_MOD_NAME;
        if (info != null && info.mod != null) {
            modName = info.mod.getName();
        }
        List<Tuple3<Found, Integer, ASTEntry>> prev = map.get(modName);
View Full Code Here

                importTok.beginColumn = tokModName.beginColumn;

                List<IToken> createdTokens = AbstractVisitor.makeImportToken(importTok, null, this.current.getName(),
                        true);
                for (IToken token : createdTokens) {
                    ImportInfo info = this.scope.importChecker.visitImportToken(token, false, this.completionCache);
                    Found found = new Found(token, token, scope.getCurrScopeId(), scope.getCurrScopeItems());
                    found.importInfo = info;

                    checkFound(found, peekParent()); //check if this is actually a match
                    addFoundToImportsMap(found, importsFoundFromModuleName);
View Full Code Here

            return false;
        }
        //now, there's a catch here... the import checker will make the module 'resolved' for any token it found, even
        //if it doesn't end up matching with the token we're looking for... so, we must keep on going with the
        //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

TOP

Related Classes of com.python.pydev.analysis.visitors.ImportChecker.ImportInfo

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.