Package org.erlide.engine.model.erlang

Examples of org.erlide.engine.model.erlang.IErlPreprocessorDef


  protected Object _findOpenResult(final FieldOpenResult openResult, final IErlModule module, final IErlProject project, final IErlElement element, final IErlElementLocator model, final IErlElementLocator.Scope scope, final ITextEditor editor) {
    try {
      Object _xblockexpression = null;
      {
        String _record = openResult.getRecord();
        IErlPreprocessorDef _findPreprocessorDef = this.modelFindService.findPreprocessorDef(module, _record,
          ErlElementKind.RECORD_DEF);
        final IErlRecordDef def = ((IErlRecordDef) _findPreprocessorDef);
        boolean _tripleNotEquals = (def != null);
        if (_tripleNotEquals) {
          String _name = openResult.getName();
View Full Code Here


            final int offset, final String prefix, final int hashMarkPos,
            final List<String> fieldsSoFar) {
        if (module == null) {
            return EMPTY_COMPLETIONS;
        }
        IErlPreprocessorDef pd;
        try {
            pd = ErlangEngine.getInstance().getModelFindService()
                    .findPreprocessorDef(module, recordName, ErlElementKind.RECORD_DEF);
        } catch (final CoreException e) {
            return EMPTY_COMPLETIONS;
        }
        if (pd instanceof IErlRecordDef) {
            final List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
            try {
                for (final IErlElement i : pd.getChildren()) {
                    final IErlRecordField field = (IErlRecordField) i;
                    final String fieldName = field.getFieldName();
                    if (!fieldsSoFar.contains(fieldName)) {
                        addIfMatches(fieldName, prefix, offset, result);
                    }
View Full Code Here

            final OtpErlangTuple t = (OtpErlangTuple) o;
            final OtpErlangObject h = t.elementAt(0);
            if (h instanceof OtpErlangAtom) {
                final OtpErlangAtom a = (OtpErlangAtom) h;
                final ErlangDebugTarget target = getErlangDebugTarget();
                IErlPreprocessorDef pd;
                try {
                    pd = ErlangEngine
                            .getInstance()
                            .getModelFindService()
                            .findPreprocessorDef(getErlProjects(target.getProjects()),
View Full Code Here

                "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
                .findPreprocessorDef(Lists.newArrayList(project1, project2), "f.erl",
                        "rec2", ErlElementKind.RECORD_DEF);
        // then
        // the record should be returned
        assertNotNull(module);
        assertNotNull(preprocessorDef1);
        assertTrue(preprocessorDef1 instanceof IErlRecordDef);
        assertEquals(preprocessorDef1, preprocessorDef2);
        assertEquals(preprocessorDef1.getParent(), include);
        assertNotNull(preprocessorDef3);
        assertEquals(preprocessorDef3.getParent(), module);
    }
View Full Code Here

                "-module(g).\n-include_lib(\"kernel/include/file.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);
        // when
        // looking for the record
        final IErlPreprocessorDef preprocessorDef = modelFindService.findPreprocessorDef(
                module, "file_info", ErlElementKind.RECORD_DEF);
        // then
        // the record should be returned
        assertNotNull(module);
        assertNotNull(preprocessorDef);
View Full Code Here

            final IPath p = new Path(includePath).removeLastSegments(1);
            ((ErlProject) project).setIncludeDirs(Lists.newArrayList(p));
            project.open(null);
            // when
            // looking for the record def
            final IErlPreprocessorDef preprocessorDef = modelFindService
                    .findPreprocessorDef(module, "rec2", ErlElementKind.RECORD_DEF);
            final Collection<IErlProject> myprojects = Lists.newArrayList(project);
            ErlangEngine
                    .getInstance()
                    .getModelFindService()
View Full Code Here

            ((ErlProject) project).setExternalIncludesFile(externalsFile
                    .getAbsolutePath());
            project.open(null);
            // when
            // looking for the record def
            final IErlPreprocessorDef preprocessorDef = modelFindService
                    .findPreprocessorDef(module, "rec2", ErlElementKind.RECORD_DEF);
            final Collection<IErlProject> myprojects = Lists.newArrayList(project);
            modelFindService.findPreprocessorDef(myprojects, "a.erl", "rec2",
                    ErlElementKind.RECORD_DEF);
            // then
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.erlang.IErlPreprocessorDef

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.