Package org.erlide.engine.services.codeassist

Examples of org.erlide.engine.services.codeassist.RecordCompletion


            final OtpErlangObject res = buildBackend.call("erlide_content_assist",
                    "check_record", "s", prefix);
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangTuple r = (OtpErlangTuple) t.elementAt(1);
                return new RecordCompletion(r);
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
        } catch (final OtpErlangRangeException e) {
            ErlLogger.error(e);
View Full Code Here


        final int parenPos = text.lastIndexOf('(');
        final int leftBracketPos = text.lastIndexOf('{');
        final int interrogationMarkPos = text.lastIndexOf('?');
        final int arrowPos = text.lastIndexOf("->");

        RecordCompletion rc = null;
        if (hashMarkPos >= 0) {
            final IErlProject aproject = project;
            if (aproject != null) {
                rc = ErlangEngine
                        .getInstance()
                        .getContextAssistService()
                        .checkRecordCompletion(BackendCore.getBuildBackend(aproject),
                                text);
            }
        }
        if (rc != null && rc.isNameWanted()) {
            options.flags = EnumSet.of(Kinds.RECORD_DEFS);
            options.pos = hashMarkPos;
            options.text = rc.getPrefix();
        } else if (rc != null && rc.isFieldWanted()) {
            options.flags = EnumSet.of(Kinds.RECORD_FIELDS);
            options.pos = hashMarkPos;
            if (dotPos > hashMarkPos) {
                options.pos = dotPos;
            } else if (leftBracketPos > hashMarkPos) {
                options.pos = leftBracketPos;
            } else {
                assert false;
            }
            options.text = rc.getPrefix();
            options.moduleOrRecord = rc.getName();
            options.fieldsSoFar = rc.getFields();
        } else if (colonPos > commaPos && colonPos > parenPos) {
            if (doubleColon) {
                options.flags = EnumSet.of(Kinds.TYPES);
                options.pos = colonPos;
                options.text = text.substring(colonPos + 1);
View Full Code Here

TOP

Related Classes of org.erlide.engine.services.codeassist.RecordCompletion

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.