Package org.erlide.engine.model.erlang

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


    private List<IErlElement> createForms(final IErlModule module,
            final OtpErlangList forms) {
        final List<IErlElement> children = Lists.newArrayListWithCapacity(forms.arity());
        for (final OtpErlangObject form : forms) {
            final IErlMember elem = create(module, (OtpErlangTuple) form);
            if (elem != null) {
                children.add(elem);
            }
        }
        return children;
View Full Code Here


            ErlLogger.warn(e);
        }
    }

    private void checkForComment(final List<IErlMember> all, final int i) {
        final IErlMember m = all.get(i);
        if (m instanceof IErlFunction) {
            final IErlFunction function = (IErlFunction) m;
            final LinkedList<IErlComment> comments = Lists.newLinkedList();
            int j = considerPrevious(i, all, comments, function);
            j = considerPrevious(j, all, comments, function);
View Full Code Here

    private int considerPrevious(final int i, final List<IErlMember> all,
            final LinkedList<IErlComment> comments, final IErlFunction function) {
        final int j = i - 1;
        if (j > 0) {
            final IErlMember member = all.get(i);
            final IErlMember prevMember = all.get(j);
            if (prevMember instanceof IErlComment) {
                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 {
                return -1;
View Full Code Here

        }
        final int offset = c.offset;
        String txt = null;
        editor.reconcileNow();
        final IErlElement element = editor.getElementAt(offset, false);
        final IErlMember member = (IErlMember) element;
        if (member != null) {
            final int start = member.getSourceRange().getOffset();
            if (offset >= start) {
                txt = d.get(start, offset - start);
            }
        }
        if (txt == null) {
View Full Code Here

    @Override
    public IErlRange getMemberRange() {
        if (getErlElement() instanceof IErlMember) {
            IErlRange range = null;
            final IErlMember member = (IErlMember) getErlElement();
            int sL, sC, eL, eC;
            sL = member.getLineStart() + 1;
            eL = member.getLineEnd() + 1;

            sC = WranglerUtils.calculateColumnFromOffset(member.getSourceRange()
                    .getOffset(), sL - 1, document);
            eC = WranglerUtils.calculateColumnFromOffset(member.getSourceRange()
                    .getOffset() + member.getSourceRange().getLength(), eL - 1, document);
            range = new ErlRange(sL, sC, eL, eC, member.getSourceRange().getOffset(),
                    member.getSourceRange().getLength());

            return range;
        }
        return getSelectionRange();
    }
View Full Code Here

TOP

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

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.