Examples of IErlElementLocator


Examples of org.erlide.engine.model.root.IErlElementLocator

        project.open(null);
        final boolean structureKnown2 = project.isStructureKnown();
        final boolean structureKnown3 = module.isStructureKnown();
        module.open(null);
        final boolean structureKnown4 = module.isStructureKnown();
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule otpFile = model.findModuleFromProject(project, "file.erl", null,
                IErlElementLocator.Scope.PROJECT_ONLY);
        final IErlExternal external = (IErlExternal) otpFile.getParent();
        final boolean structureKnown5 = external.isStructureKnown();
        final IErlModule module2 = createModule(project, "yy.erl",
                "-module(yy).\n% comment\n% same\nf(x) -> y.\n% last");
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            final IErlModule z6 = model.findIncludeFromModule(module, zz, null,
                    IErlElementLocator.Scope.REFERENCED_PROJECTS);
            final String ww = "ww";
            final IErlModule w1 = model.findIncludeFromModule(module, ww, null,
                    IErlElementLocator.Scope.PROJECT_ONLY);
            final IErlElementLocator mymodel = ErlangEngine.getInstance().getModel();
            final IErlModule w2 = mymodel.findIncludeFromProject(myProject, ww, null,
                    IErlElementLocator.Scope.PROJECT_ONLY);
            // then
            // scope should be respected
            assertNotNull(x1);
            assertEquals(xxHrl, x1.getName());
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

        private void addPathFiltersToContentProvider(final IProject project) {
            // FIXME (JC) all this seems too much... is it really necessary?
            // couldn't we just assume all links in external files should be
            // matchable?
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            final IErlProject erlProject = model.findProject(project);
            if (erlProject != null) {
                final ErlangProjectProperties properties = erlProject.getProperties();
                final String extMods = properties.getExternalModules();
                final List<String> files = new ArrayList<String>();
                files.addAll(PreferencesUtils.unpackList(extMods));
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

                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);
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        // when
        // looking for the include
        final IErlModule include1 = model.findIncludeFromModule(module, includeName,
                null, IErlElementLocator.Scope.PROJECT_ONLY);
        final IErlModule include2 = model.findIncludeFromProject(project, "file.hrl",
                null, IErlElementLocator.Scope.PROJECT_ONLY);
        // then
        // it should be found
        assertEquals(include, include1);
        assertNotNull(include2);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            // 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);
            // then
            // it should be found in the model
            assertNotNull(module);
            assertEquals(module, module2);
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            final IPath p = new Path(includePath).removeLastSegments(1);
            ((ErlProject) project).setIncludeDirs(Lists.newArrayList(p));
            // when
            // looking for the include file
            project.open(null);
            final IErlElementLocator model = ErlangEngine.getInstance().getModel();
            final IErlModule module = model.findIncludeFromProject(project, includeName,
                    null, IErlElementLocator.Scope.ALL_PROJECTS);
            // then
            // it should be found in the project defining it
            assertNotNull(module);
            assertEquals(project2, ErlangEngine.getInstance().getModelUtilService()
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

            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);
            // then
            // we should find it
            assertNotNull(externalModule);
            assertTrue(ResourceUtil.samePath(absolutePath, externalModule.getFilePath()));
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    } else {
      _xifexpression = IErlElementLocator.Scope.REFERENCED_PROJECTS;
    }
    final IErlElementLocator.Scope scope = _xifexpression;
    IErlangEngine _instance = ErlangEngine.getInstance();
    final IErlElementLocator model = _instance.getModel();
    return this.findOpenResult(openResult, module, project, element, model, scope, editor);
  }
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    if ((res2 instanceof OtpErlangString)) {
      boolean _tripleNotEquals_2 = (moduleName != null);
      if (_tripleNotEquals_2) {
        final String modulePath = ((OtpErlangString)res2).stringValue();
        IErlangEngine _instance_2 = ErlangEngine.getInstance();
        final IErlElementLocator model_1 = _instance_2.getModel();
        return this.modelFindService.findFunction(model_1, erlProject, module, moduleName, modulePath, erlangFunction, scope);
      }
    }
    IErlangEngine _instance_3 = ErlangEngine.getInstance();
    ModelFindService _modelFindService = _instance_3.getModelFindService();
View Full Code Here

Examples of org.erlide.engine.model.root.IErlElementLocator

    return false;
  }
 
  private IErlElement findExternalCallOrType(final IErlModule module, final ExternalCallOpenResult res, final IErlProject project, final IErlElement element, final IErlElementLocator.Scope scope) throws CoreException {
    IErlangEngine _instance = ErlangEngine.getInstance();
    final IErlElementLocator model = _instance.getModel();
    boolean _isTypeDefOrRecordDef = this.isTypeDefOrRecordDef(res, element);
    if (_isTypeDefOrRecordDef) {
      String _mod = res.getMod();
      String _fun = res.getFun();
      String _path = res.getPath();
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.