Package org.erlide.engine.model.root

Examples of org.erlide.engine.model.root.IErlProject.open()


            aProject.open(null);
            final Collection<IErlModule> otpIncludes = aProject.getExternalIncludes();
            final IPath absoluteDir = new Path(absolutePath).removeLastSegments(1);
            newIncludeDirs.add(absoluteDir);
            ((ErlProject) aProject).setIncludeDirs(newIncludeDirs);
            aProject.open(null);
            // when
            // fetching all external includes
            final Collection<IErlModule> externalIncludes = aProject
                    .getExternalIncludes();
            // then
View Full Code Here


        try {
            // given
            // an Erlang project and a module
            final IPath srcxPath = new Path("srcx");
            final List<IPath> srcxDirs = Lists.newArrayList(srcxPath);
            aProject.open(null);
            // when
            // setting source dirs so the module is on source path
            final Collection<IErlModule> modules = aProject.getModules();
            ((ErlProject) aProject).setSourceDirs(srcxDirs);
            aProject.open(null);
View Full Code Here

            aProject.open(null);
            // when
            // setting source dirs so the module is on source path
            final Collection<IErlModule> modules = aProject.getModules();
            ((ErlProject) aProject).setSourceDirs(srcxDirs);
            aProject.open(null);
            final Collection<IErlModule> srcxModules = aProject.getModules();
            ((ErlProject) aProject).setSourceDirs(sourceDirs);
            aProject.open(null);
            final Collection<IErlModule> modulesAgain = aProject.getModules();
            // then
View Full Code Here

            final Collection<IErlModule> modules = aProject.getModules();
            ((ErlProject) aProject).setSourceDirs(srcxDirs);
            aProject.open(null);
            final Collection<IErlModule> srcxModules = aProject.getModules();
            ((ErlProject) aProject).setSourceDirs(sourceDirs);
            aProject.open(null);
            final Collection<IErlModule> modulesAgain = aProject.getModules();
            // then
            // the it should be returned, but not otherwise
            assertEquals(0, srcxModules.size());
            assertTrue(modules.size() > 0);
View Full Code Here

            // when
            // looking for the include file
            // String includeFile =
            // ErlangEngine.getInstance().getModelUtilService().findIncludeFile(erlProject,
            // "x.hrl", "");
            project.open(null);
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            final IErlModule module = model.findIncludeFromProject(project, null,
                    includePath, IErlElementLocator.Scope.REFERENCED_PROJECTS);
            final IErlModule module2 = model.findModuleFromProject(project, includeName,
                    null, IErlElementLocator.Scope.REFERENCED_PROJECTS);
View Full Code Here

            final String absolutePath = externalFile.getAbsolutePath();
            final String externalsFileName = "x.erlidex";
            final File externalsFile = createTmpFile(externalsFileName, absolutePath);
            ((ErlProject) project)
                    .setExternalModulesFile(externalsFile.getAbsolutePath());
            project.open(null);
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            // when
            // looking for it
            final IErlModule externalModule = model.findModuleFromProject(project,
                    externalFileName, null, IErlElementLocator.Scope.PROJECT_ONLY);
View Full Code Here

        } else if (element instanceof IErlModule) {
            final IErlModule module = (IErlModule) element;
            result.add(module);
        } else if (element instanceof IErlProject) {
            final IErlProject project = (IErlProject) element;
            project.open(null);
            result.addAll(project.getModules());
        }
        return result;
    }
View Full Code Here

    prefs.setIncludeDirs(includeDirs);
    final Path ebinDir = new Path("ebin");
    ArrayList<IPath> _newArrayList = Lists.<IPath>newArrayList(ebinDir);
    this.buildPaths(project, _newArrayList);
    prefs.setOutputDir(ebinDir);
    erlProject.open(null);
    return erlProject;
  }
 
  public IErlProject getExistingProject(final String name) {
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
View Full Code Here

                project,
                "f.erl",
                "-module(f).\n-include(\"a.hrl\").\n-export([f/0]).\n-record(rec2, {a, b}).\n"
                        + "f() ->\n    lists:reverse([1, 0]),\n    lists:reverse([1, 0], [2]).\n");
        module.open(null);
        project.open(null);
        final IErlPreprocessorDef preprocessorDef1 = modelFindService
                .findPreprocessorDef(module, "rec1", ErlElementKind.RECORD_DEF);
        final IErlPreprocessorDef preprocessorDef2 = modelFindService
                .findPreprocessorDef(include, "rec1", ErlElementKind.RECORD_DEF);
        final IErlPreprocessorDef preprocessorDef3 = modelFindService
View Full Code Here

            final String absolutePath = externalFile.getAbsolutePath();
            final String externalsFileName = "x.erlidex";
            final File externalsFile = createTmpFile(externalsFileName, absolutePath);
            ((ErlProject) project)
                    .setExternalModulesFile(externalsFile.getAbsolutePath());
            project.open(null);
            // when
            // looking via prefix
            final List<String> moduleNames0 = modelUtilService.findUnitsWithPrefix("ex",
                    project, false, false);
            final List<String> modules1 = modelUtilService.findUnitsWithPrefix("ex",
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.