Package ro.redeul.google.go.lang.psi

Examples of ro.redeul.google.go.lang.psi.GoPackage


        ConcurrentMap<String, GoPackage> cache = SoftReference.dereference(packagesCache);
        if (cache == null) {
            packagesCache = new SoftReference<ConcurrentMap<String, GoPackage>>(cache = new ConcurrentHashMap<String, GoPackage>());
        }

        GoPackage aPackage = cache.get(path);
        if (aPackage != null) {
            return aPackage;
        }

        aPackage = resolvePackage(path);
View Full Code Here


    @Nullable public static GoPackage getTargetPackageIfDifferent(PsiElement source, PsiElement target) {
        if ( source == null || target == null)
            return null;

        GoPackage sourcePackage = getPackageFor(source);
        GoPackage targetPackage = getPackageFor(target);

        if ( sourcePackage != null && targetPackage != null && !sourcePackage.equals(targetPackage) ) {
            GoPackage builtin = GoPackages.getInstance(source.getProject()).getBuiltinPackage();

            if ( !builtin.equals(targetPackage))
                return targetPackage;
        }

        return null;
    }
View Full Code Here

    public static GoType makePointer(GoPsiType argumentType) {
        return new GoTypePointer(fromPsi(argumentType));
    }

    public static GoType[] getPackageType(GoImportDeclaration declaration) {
        GoPackage goPackage = declaration.getPackage();
        return goPackage != null ? new GoType[]{new GoTypePackage(goPackage)} : GoType.EMPTY_ARRAY;
    }
View Full Code Here

//        return PsiReference.EMPTY_ARRAY;

        if (NIL_TYPE.accepts(this))
            return PsiReference.EMPTY_ARRAY;

        GoPackage goPackage = null;
        if (findChildByType(GoTokenTypes.oDOT) != null) {
            GoLiteralIdentifier identifiers[] = findChildrenByClass(GoLiteralIdentifier.class);
            GoImportDeclaration importDeclaration = GoPsiUtils.resolveSafely(identifiers[0], GoImportDeclaration.class);
            goPackage = importDeclaration != null ? importDeclaration.getPackage() : null;
        }
View Full Code Here

                                type.getTargetType().accept(visitor);
                            }

                            @Override
                            public void visitPackage(GoTypePackage type, List<Reference> data, TypeVisitor<List<Reference>> visitor) {
                                GoPackage goPackage = type.getPackage();
                                if (goPackage != GoPackages.C)
                                    data.add(new PackageSymbolReference(ident, goPackage));
                            }

                            @Override
View Full Code Here

    @Override
    public void walkSolver(MethodSolver solver) {
        PsiElement toFindPackagePsi;

        GoPackage goPackage = GoPackages.getTargetPackageIfDifferent(getElement(), type.getDefinition());

        if ( goPackage != null) {
            GoPsiScopesUtil.walkPackage(solver, getElement(), goPackage);
        } else {
            GoPsiScopesUtil.treeWalkUp(
View Full Code Here

                String packageName = null;
                if (packageReference != null && !(packageReference.isBlank() || packageReference.isLocal()))
                    packageName = packageReference.getString();
                else {
                    GoPackage goPackage = importDeclaration.getPackage();
                    packageName = goPackage != null ? goPackage.getName() : "";
                }

                return packageName != null && matchNames(reference.name(), packageName);
            }
        });
View Full Code Here

    public boolean isReferenceTo(PsiElement element) {
        return getElement().getManager().areElementsEquivalent(resolve(), element);
    }

    public boolean canSee(GoPsiElement element, String name) {
        GoPackage elementPackage = GoPackages.getPackageFor(element);
        GoPackage referencePackage = GoPackages.getPackageFor(getElement());

        return elementPackage == referencePackage || GoNamesUtil.isExported(name);
    }
View Full Code Here

        }

        if ( ResolveStates.get(state, ResolveStates.Key.IsOriginalFile)) {
            GoPackages packages = GoPackages.getInstance(getProject());

            GoPackage myPackage = packages.getPackage(getPackageImportPath());
            if (myPackage != null &&
                    !myPackage.processDeclarations(processor, ResolveStates.currentPackage(), this.getOriginalFile(), place))
                return false;

            GoPackage builtinPackage = packages.getBuiltinPackage();
            if ( builtinPackage != null )
                return builtinPackage.processDeclarations(processor, ResolveStates.builtins(), lastParent, place);
        }

        return true;
    }
View Full Code Here

        GoLiteralString importPathLiteral = getImportPath();

        if (importPathLiteral == null)
            return "";

        GoPackage goPackage = getPackage();

        if (goPackage == null)
            return "";

        return goPackage.getName();
    }
View Full Code Here

TOP

Related Classes of ro.redeul.google.go.lang.psi.GoPackage

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.