Examples of GoNamesCache


Examples of ro.redeul.google.go.lang.stubs.GoNamesCache

        return files.length > 0 ? files[0].getPackage().getPackageName() : "";
    }

    @Override
    public GoFile[] getFiles() {
        GoNamesCache namesCache = GoNamesCache.getInstance(getProject());

        List<GoFile> files = new ArrayList<GoFile>(namesCache.getFilesByPackageImportPath(getImportPath()));

        Collections.sort(files, new Comparator<GoFile>() {
            @Override
            public int compare(GoFile o1, GoFile o2) {
                return o1.getVirtualFile().getName().compareTo(o2.getVirtualFile().getName());
View Full Code Here

Examples of ro.redeul.google.go.lang.stubs.GoNamesCache

    }

    @Override
    protected void doCheckFile(@NotNull GoFile file,
                               @NotNull final InspectionResult result) {
        GoNamesCache namecache = GoNamesCache.getInstance(file.getProject());
        String selfPackageName = file.getFullPackageName();

        HashSet<String> hasVisitImportPath = new HashSet<String>();
        for (GoImportDeclarations importDeclarations : file.getImportDeclarations()) {
            for (GoImportDeclaration declaration : importDeclarations.getDeclarations()) {
                String importPathValue = null;
                GoLiteralString importPath = declaration.getImportPath();
                if (importPath != null) {
                    importPathValue = importPath.getValue();
                }

                if (importPathValue == null)
                    continue;

                if (importPathValue.isEmpty()) {
                    result.addProblem(declaration, GoBundle.message("error.import.path.is.empty"));
                    continue;
                }

                if (importPathValue.contains(" ") || importPathValue.contains("\t")) {
                    result.addProblem(declaration, GoBundle.message("error.import.path.contains.space"));
                    continue;
                }

                if (importPathValue.contains("\\")) {
                    result.addProblem(declaration, GoBundle.message("error.import.path.contains.backslash"));
                    continue;
                }

                if (!importPathValue.equals("C") && !namecache.isPackageImportPathExist(importPathValue)){
                    result.addProblem(declaration, GoBundle.message("error.import.path.notfound", importPathValue));
                    continue;
                }

                if (importPathValue.equals(selfPackageName)) {
View Full Code Here

Examples of ro.redeul.google.go.lang.stubs.GoNamesCache

public class GoGoToSymbolContributor implements ChooseByNameContributor {
    @NotNull
    @Override
    public String[] getNames(Project project, boolean includeNonProjectItems) {
        GoNamesCache namesCache = GoNamesCache.getInstance(project);
        Set<String> names = new HashSet<String>();
        namesCache.getAllTypeNames(names);
        namesCache.getAllFunctionNames();
        namesCache.getAllVariableNames();
        return names.toArray(new String[names.size()]);
    }
View Full Code Here

Examples of ro.redeul.google.go.lang.stubs.GoNamesCache

    @NotNull
    @Override
    public NavigationItem[] getItemsByName(String name, String pattern, Project project,
                                           boolean includeNonProjectItems) {
        GoNamesCache namesCache = GoNamesCache.getInstance(project);
        List<NavigationItem> result = new ArrayList<NavigationItem>();
        Collections.addAll(result, namesCache.getTypesByName(name, includeNonProjectItems));
        Collections.addAll(result, namesCache.getFunctionsByName());
        Collections.addAll(result, namesCache.getVariablesByName());
        return result.toArray(new NavigationItem[result.size()]);
    }
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.