Examples of RpcResult


Examples of org.erlide.runtime.rpc.RpcResult

     * Gets logged info (warnings, errors) from Wrangler
     *
     * @return log list
     */
    public RpcResult getLoggedInfo() {
        final RpcResult res = backend.call_noexception("wrangler_error_logger",
                "get_logged_info", "");
        @SuppressWarnings("unused")
        final RpcResult res2 = backend.call_noexception("wrangler_error_logger",
                "remove_all_from_logger", "");
        return res;
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

                    .append(project.getProperties().getOutputDir()).toString();
        } catch (final ErlModelException e) {
            return false;
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("load_callback_mod_eclipse", "ss",
                        refac.getCallbackModule(), callbackPath);
        if (!res.isOk()) {
            return false;
        }
        return true;
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

                .getWranglerSelection();
        if (sel == null) {
            return "";
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("get_var_name_eclipse", "siixi", sel.getFilePath(),
                        sel.getSelectionRange().getStartLine(),
                        sel.getSelectionRange().getStartCol(), sel.getSearchPath(),
                        GlobalParameters.getTabWidth());

        if (res.getValue().getClass().equals(OtpErlangString.class)) {
            return ((OtpErlangString) res.getValue()).stringValue();
        }
        return "";
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

            final String module = next.substring(next.lastIndexOf('/') + 1,
                    next.lastIndexOf('.'));
            erlModules.add(new OtpErlangString(module));
        }

        RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
                "get_user_refactorings", "x",
                new OtpErlangList(erlModules.toArray(new OtpErlangObject[0])));

        if (res.isOk() && res.getValue() instanceof OtpErlangList) {
            final OtpErlangList genRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
                    .getValue()).elementAt(0)).elementAt(1);
            final OtpErlangList genCompositeRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
                    .getValue()).elementAt(1)).elementAt(1);

            for (final OtpErlangObject obj : genRefac) {
                elementaryRefacs.add(new UserRefactoringInfo(obj.toString()));
            }
            for (final OtpErlangObject obj : genCompositeRefac) {
                compositeRefacs.add(new UserRefactoringInfo(obj.toString()));
            }
        }

        ErlLogger.info("Refac modules found " + res.toString());

        // user's own refactoring
        final Enumeration userModules = coreBundle.findEntries(
                "wrangler/ebin/my_gen_refac", "*.beam", false);
        while (userModules != null && userModules.hasMoreElements()) {
            final String next = userModules.nextElement().toString();
            myElementaryRefacs.add(new UserRefactoringInfo(next.substring(
                    next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));

        }
        // user's own composite refactorings
        final Enumeration userCompositeModules = coreBundle.findEntries(
                "wrangler/ebin/my_gen_composite_refac", "*.beam", false);
        while (userCompositeModules != null && userCompositeModules.hasMoreElements()) {
            final String next = userCompositeModules.nextElement().toString();
            myCompositeRefacs.add(new UserRefactoringInfo(next.substring(
                    next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));
        }

        // load refactorings
        res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
                "load_user_refactorings", "s", getEbinPath());
        ErlLogger.debug(res.toString());

    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

     *            parameters array
     * @return parsed RPC message
     */
    public IRpcMessage callWithParser(final IRpcMessage parser,
            final String functionName, final String signature, final Object... parameters) {
        final RpcResult res = callWithoutParser(functionName, signature, parameters);
        parser.parse(res);
        return parser;
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

                .getWranglerSelection();
        if (sel == null) {
            return "";
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("get_fun_name_eclipse", "siixi", sel.getFilePath(),
                        sel.getSelectionRange().getStartLine(),
                        sel.getSelectionRange().getStartCol(), sel.getSearchPath(),
                        GlobalParameters.getTabWidth());

        if (res.getValue().getClass().equals(OtpErlangString.class)) {
            return ((OtpErlangString) res.getValue()).stringValue();
        }
        return "";
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

    public boolean fetchParPrompts() {
        if (fetched) {
            return true;
        }

        final RpcResult res = WranglerBackendManager.getRefactoringBackend()
                .callWithoutParser("input_par_prompts_eclipse", "s", callbackModule);
        final OtpErlangList params = (OtpErlangList) ((OtpErlangTuple) res.getValue())
                .elementAt(1);
        parPrompts.clear();
        for (final OtpErlangObject obj : params.elements()) {
            parPrompts.add(obj.toString().replace("\"", ""));
        }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

        this.backend = backend;
    }

    protected OtpErlangTuple parseFile(final IFile f) {
        final String filePath = f.getLocation().toOSString();
        final RpcResult res = backend
                .call_noexception(MODULE, PARSE_FUNCTION, "sax", filePath, "true",
                        GlobalParameters.getWranglerSelection().getSearchPath());
        return parseParserResult(res.getValue());
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

    protected SyntaxInfo varToPos(final OtpErlangTuple syntaxTree, final int line,
            final int col) {
        final OtpErlangInt[] position = new OtpErlangInt[2];
        position[0] = new OtpErlangInt(line);
        position[1] = new OtpErlangInt(col);
        final RpcResult res = backend.call_noexception(INTERFACE_MODULE, VAR_FUNCTION,
                "xx", syntaxTree, new OtpErlangTuple(position));
        return parseVarInfo(res.getValue());
    }
View Full Code Here

Examples of org.erlide.runtime.rpc.RpcResult

     * @throws CoreException
     *             detailed exception about the loading process errors
     */
    private void initWrangler() throws CoreException {
        final IOtpRpc mb = getBackend();
        RpcResult res = mb.call_noexception("wrangler_refacs", "init_eclipse", "",
                new Object[0]);
        ErlLogger.debug("Wrangler app started:\n" + res);
        res = mb.call_noexception("wrangler_error_logger", "init", "x",
                new OtpErlangList());

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.