@Override
    public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) {

        // solve absolute references
        String itName = name;
        while (itName.contains(".")) {
            String typeName = getType(itName);
            String memberName = getMember(itName);
            SymbolReference<ResolvedTypeDeclaration> type = this.solveType(typeName, typeSolver);
            if (type.isSolved()) {
                return new SymbolSolver(typeSolver).solveSymbolInType(type.getCorrespondingDeclaration(), memberName);
            } else {
                itName = typeName;
            }
        }

        // Look among statically imported values
        if (wrappedNode.getImports() != null) {
            for (ImportDeclaration importDecl : wrappedNode.getImports()) {
                if(importDecl.isStatic()){
                    if(importDecl.isAsterisk()) {
                        String qName = importDecl.getNameAsString();
                        ResolvedTypeDeclaration importedType = typeSolver.solveType(qName);
                        SymbolReference<? extends ResolvedValueDeclaration> ref = new SymbolSolver(typeSolver).solveSymbolInType(importedType, name);
                        if (ref.isSolved()) {
                            return ref;
                        }
                    } else{
                        String whole = importDecl.getNameAsString();

                        // split in field/method name and type name
                        String memberName = getMember(whole);
                        String typeName = getType(whole);

                        if (memberName.equals(name)) {
                            ResolvedTypeDeclaration importedType = typeSolver.solveType(typeName);
                            return new SymbolSolver(typeSolver).solveSymbolInType(importedType, memberName);
                        }
                    }
                }
            }
        }

        return SymbolReference.unsolved(ResolvedValueDeclaration.class);
    }
@Override
    public SymbolReference<? extends ResolvedValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) {

        
        String itName = name;
        while (itName.contains(".")) {
            String typeName = getType(itName);
            String memberName = getMember(itName);
            SymbolReference<ResolvedTypeDeclaration> type = this.solveType(typeName, typeSolver);
            if (type.isSolved()) {
                return new SymbolSolver(typeSolver).solveSymbolInType(type.getCorrespondingDeclaration(), memberName);
            } else {
                itName = typeName;
            }
        }

        
        if (wrappedNode.getImports() != null) {
            for (ImportDeclaration importDecl : wrappedNode.getImports()) {
                if(importDecl.isStatic()){
                    if(importDecl.isAsterisk()) {
                        String qName = importDecl.getNameAsString();
                        ResolvedTypeDeclaration importedType = typeSolver.solveType(qName);
                        SymbolReference<? extends ResolvedValueDeclaration> ref = new SymbolSolver(typeSolver).solveSymbolInType(importedType, name);
                        if (ref.isSolved()) {
                            return ref;
                        }
                    } else{
                        String whole = importDecl.getNameAsString();

                        
                        String memberName = getMember(whole);
                        String typeName = getType(whole);

                        if (memberName.equals(name)) {
                            ResolvedTypeDeclaration importedType = typeSolver.solveType(typeName);
                            return new SymbolSolver(typeSolver).solveSymbolInType(importedType, memberName);
                        }
                    }
                }
            }
        }

        return SymbolReference.unsolved(ResolvedValueDeclaration.class);
    }
@ Override public SymbolReference < ? extends ResolvedValueDeclaration > solveSymbol ( String name , TypeSolver typeSolver ) { // solve absolute references String itName = name ; while ( itName . contains ( "." ) ) { String typeName = getType ( itName ) ; String memberName = getMember ( itName ) ; SymbolReference < ResolvedTypeDeclaration > type = this . solveType ( typeName , typeSolver ) ; if ( type . isSolved ( ) ) { return new SymbolSolver ( typeSolver ) . solveSymbolInType ( type . getCorrespondingDeclaration ( ) , memberName ) ; } else { itName = typeName ; } } // Look among statically imported values if ( wrappedNode . getImports ( ) != null ) { for ( ImportDeclaration importDecl : wrappedNode . getImports ( ) ) { if ( importDecl . isStatic ( ) ) { if ( importDecl . isAsterisk ( ) ) { String qName = importDecl . getNameAsString ( ) ; ResolvedTypeDeclaration importedType = typeSolver . solveType ( qName ) ; SymbolReference < ? extends ResolvedValueDeclaration > ref = new SymbolSolver ( typeSolver ) . solveSymbolInType ( importedType , name ) ; if ( ref . isSolved ( ) ) { return ref ; } } else { String whole = importDecl . getNameAsString ( ) ; // split in field/method name and type name String memberName = getMember ( whole ) ; String typeName = getType ( whole ) ; if ( memberName . equals ( name ) ) { ResolvedTypeDeclaration importedType = typeSolver . solveType ( typeName ) ; return new SymbolSolver ( typeSolver ) . solveSymbolInType ( importedType , memberName ) ; } } } } } return SymbolReference . unsolved ( ResolvedValueDeclaration . class ) ; }
/
/