Package org.erlide.engine.model.erlang

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


        final IErlModule module = erlangEditor.getModule();
        if (module == null) {
            return false;
        }
        module.open(null);
        final IErlTypespec typespec = ErlangEngine.getInstance().getModelFindService()
                .findTypespec(module, typeName);
        if (typespec == null) {
            return false;
        }
        EditorUtility.revealInEditor(editor, typespec);
View Full Code Here


                if (prevMember.getLineEnd() + FUNCTION_COMMENT_THRESHOLD >= member
                        .getLineStart()) {
                    comments.addFirst((IErlComment) prevMember);
                }
            } else if (prevMember instanceof IErlTypespec) {
                final IErlTypespec spec = (IErlTypespec) prevMember;

                if (spec.getName().equals(function.getName())
                        && spec.getArity() == function.getArity()
                        && prevMember.getLineEnd() + FUNCTION_COMMENT_THRESHOLD >= member
                                .getLineStart()) {
                    function.setTypespec(spec);
                }
            } else {
View Full Code Here

    @Override
    public IErlTypespec findTypespec(final String typeName) {
        try {
            for (final IErlElement child : getChildrenOfKind(ErlElementKind.TYPESPEC)) {
                if (child instanceof IErlTypespec) {
                    final IErlTypespec typespec = (IErlTypespec) child;
                    if (typespec.getName().equals(typeName)) {
                        return typespec;
                    }
                }
            }
        } catch (final ErlModelException e) { // ignore
View Full Code Here

    }

    @Override
    public IErlTypespec findTypespec(final IErlModule module, final String name)
            throws CoreException {
        IErlTypespec typespec = module.findTypespec(name);
        if (typespec != null) {
            return typespec;
        }
        final Collection<IErlModule> includedFiles = ErlangEngine.getInstance()
                .getModelFindService().findAllIncludedFiles(module);
View Full Code Here

                out.println(export.getFunctions().size());
            } else if (form instanceof IErlPreprocessorDef) {
                final IErlPreprocessorDef def = (IErlPreprocessorDef) form;
                out.println(fix(def.getDefinedName()));
            } else if (form instanceof IErlTypespec) {
                final IErlTypespec attribute = (IErlTypespec) form;
                out.println("TYPESPEC " + fix(attribute.getName()));
            } else if (form instanceof IErlAttribute) {
                final IErlAttribute attribute = (IErlAttribute) form;
                out.println(fix(attribute.getName()));
            } else if (form instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) form;
                int numClauses = function.getChildCount();
                numClauses = numClauses == 0 ? 1 : numClauses;
                out.println(fix(function.getName()) + " " + function.getArity() + " "
View Full Code Here

                "-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);
        // when
        // looking for the typespec
        final IErlTypespec typespec = modelFindService.findTypespec(module, "date");
        // then
        // it should be found
        assertNotNull(typespec);
        assertEquals(typespec.getParent(), include);
    }
View Full Code Here

TOP

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

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.