Package org.erlide.wrangler.refactoring.backend.internal

Examples of org.erlide.wrangler.refactoring.backend.internal.ExpressionPosRpcMessage


            throws CoreException, OperationCanceledException {
        if (functionClause == null) {
            return RefactoringStatus
                    .createFatalErrorStatus("No function clause was given!");
        }
        ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
        final String path = selection.getFilePath();
        final String moduleName = ErlangEngine.getInstance().getModelUtilService()
                .getModule(functionClause).getModuleName();
        final String functionName = functionClause.getFunctionName();
        final int arity = functionClause.getArity();

        int clauseIndex = 1;
        if (!(functionClause instanceof IErlFunction)) {
            clauseIndex = Integer.valueOf(functionClause.getName().substring(1));
        }

        m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend()
                .callWithParser(m, "fold_expr_by_name_eclipse", "sssiixi", path,
                        moduleName, functionName, arity, clauseIndex,
                        selection.getSearchPath(), GlobalParameters.getTabWidth());

        if (m.isSuccessful()) {
            syntaxTree = m.getSyntaxTree();
            // TODO: store positions, selectedpositions
            positions = m.getPositionDefinitions(selection.getDocument());
            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }

        return new RefactoringStatus();
    }
View Full Code Here


         * SelectionKind.FUNCTION_CLAUSE))) return RefactoringStatus
         * .createFatalErrorStatus("Please select an expression!");
         */

        final IErlMemberSelection sel = (IErlMemberSelection) selection;
        ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
        m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend()
                .callWithParser(m, "merge_forall_eclipse", "sxi", sel.getFilePath(),
                        sel.getSearchPath(), GlobalParameters.getTabWidth());
        if (m.isSuccessful()) {
            positions = m.getPositionDefinitions(sel.getDocument());
            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }
        return new RefactoringStatus();
    }
View Full Code Here

            return RefactoringStatus
                    .createFatalErrorStatus("Please select an expression!");
        }

        final IErlMemberSelection sel = (IErlMemberSelection) selection;
        ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
        m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend()
                .callWithParser(m, "fold_expr_by_loc_eclipse", "siixi",
                        sel.getFilePath(), sel.getMemberRange().getStartLine(),
                        sel.getMemberRange().getStartCol(), sel.getSearchPath(),
                        GlobalParameters.getTabWidth());
        if (m.isSuccessful()) {
            syntaxTree = m.getSyntaxTree();
            positions = m.getPositionDefinitions(sel.getDocument());
            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }
        return new RefactoringStatus();

    }
View Full Code Here

         * SelectionKind.FUNCTION_CLAUSE))) return RefactoringStatus
         * .createFatalErrorStatus("Please select an expression!");
         */

        final IErlMemberSelection sel = (IErlMemberSelection) selection;
        ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
        m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend()
                .callWithParser(m, "merge_let_eclipse", "sxi", sel.getFilePath(),
                        sel.getSearchPath(), GlobalParameters.getTabWidth());
        if (m.isSuccessful()) {
            positions = m.getPositionDefinitions(sel.getDocument());
            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }
        return new RefactoringStatus();
    }
View Full Code Here

         * SelectionKind.FUNCTION_CLAUSE))) return RefactoringStatus
         * .createFatalErrorStatus("Please select an expression!");
         */

        final IErlMemberSelection sel = (IErlMemberSelection) selection;
        ExpressionPosRpcMessage m = new ExpressionPosRpcMessage();
        m = (ExpressionPosRpcMessage) WranglerBackendManager.getRefactoringBackend()
                .callWithParser(m, "fold_against_macro_eclipse", "siixi",
                        sel.getFilePath(), sel.getMemberRange().getStartLine(),
                        sel.getMemberRange().getStartCol(), sel.getSearchPath(),
                        GlobalParameters.getTabWidth());
        if (m.isSuccessful()) {
            syntaxTree = m.getSyntaxTree();
            positions = m.getPositionDefinitions(sel.getDocument());
            selectedPositions = new ArrayList<IErlRange>();
        } else {
            return RefactoringStatus.createFatalErrorStatus(m.getMessageString());
        }
        return new RefactoringStatus();
    }
View Full Code Here

TOP

Related Classes of org.erlide.wrangler.refactoring.backend.internal.ExpressionPosRpcMessage

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.