Examples of IErlFunction


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

                final IErlModule module = ese.getModule();
                try {
                    module.open(null);
                } catch (final ErlModelException e) {
                }
                final IErlFunction function = module.findFunction(new ErlangFunction(ese
                        .getName(), ese.getArity()));
                if (function != null && function.isExported()) {
                    kind = ErlElementKind.EXPORTFUNCTION;
                }
            }
        } else if (element instanceof ErlangFunction) {
            kind = ErlElementKind.FUNCTION;
View Full Code Here

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

    }

    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);
            j = considerPrevious(j, all, comments, function);
            if (!comments.isEmpty()) {
                function.setComments(comments);
            }
        }
    }
View Full Code Here

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

    @Override
    public IErlFunction findFunction(final ErlangFunction function) {
        try {
            for (final IErlElement fun : getChildrenOfKind(ErlElementKind.FUNCTION)) {
                if (fun instanceof IErlFunction) {
                    final IErlFunction f = (IErlFunction) fun;
                    if (f.getName().equals(function.name)
                            && (function.arity < 0 || f.getArity() == function.arity)) {
                        return f;
                    }
                }
            }
        } catch (final ErlModelException e) { // ignore
View Full Code Here

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

        return element.getName();
    }

    @Override
    public int getArity() {
        final IErlFunction f = (IErlFunction) getParent();
        return f.getArity();
    }
View Full Code Here

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

    @Override
    public boolean select(final Viewer viewer, final Object parentElement,
            final Object element) {
        if (element instanceof IErlFunction) {
            final IErlFunction f = (IErlFunction) element;
            if (!f.isExported()) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

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

                element = OpenResult.build(t);
                final Object found = new OpenUtils().findOpenResult(editor,
                        editor.getModule(), erlProject, element,
                        editor.getElementAt(offset, false));
                if (found instanceof IErlFunction) {
                    final IErlFunction function = (IErlFunction) found;
                    final String comment = HoverUtil.getDocumentationString(
                            function.getComments(), function.getTypespec());
                    if (comment.length() == 0) {
                        return null;
                    }
                    result.append(HTMLPrinter.asHtml(comment));
                } else if (found instanceof IErlPreprocessorDef) {
View Full Code Here

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

        if (module == null) {
            return;
        }
        final IErlElement el = editor.getElementAt(
                editor.getViewer().getSelectedRange().x, false);
        IErlFunction f = null;
        if (el instanceof IErlFunction) {
            f = (IErlFunction) el;
        } else if (el instanceof IErlFunctionClause) {
            f = (IErlFunction) el.getParent();
        }
        if (f == null) {
            return;
        }
        String name = module.getName();
        final int i = name.lastIndexOf('.');
        if (i > 0) {
            name = name.substring(0, i);
        }
        final FunctionRef ref = new FunctionRef(name, f.getFunctionName(), f.getArity());

        final IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        final IWorkbenchPage page = dw.getActivePage();

        final AsyncCaller<CallHierarchyView> ac = new AsyncCaller<CallHierarchyView>(100) {
View Full Code Here

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

            final String moduleName = resolveMacroValue(moduleName0, module);
            final IErlModule module2 = findModule(model, project, moduleName, modulePath,
                    scope);
            if (module2 != null) {
                module2.open(null);
                final IErlFunction function = module2.findFunction(erlangFunction);
                if (function != null) {
                    return function;
                }
                return null;
            }
View Full Code Here

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

    static String getErlElementID(final IErlElement e) {
        final StringBuilder sb = new StringBuilder();
        final ErlElementKind kind = e.getKind();
        sb.append(kind);
        if (kind == ErlElementKind.FUNCTION) {
            final IErlFunction f = (IErlFunction) e;
            sb.append(f.getNameWithArity());
        } else if (kind == ErlElementKind.CLAUSE) {
            final IErlFunctionClause fc = (IErlFunctionClause) e;
            sb.append(fc.getHead());
        } else if (kind == ErlElementKind.ATTRIBUTE) {
            final IErlAttribute a = (IErlAttribute) e;
View Full Code Here

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

     * overlays.
     */
    static public ImageDescriptor getBaseImageDescriptor(final IErlElement element,
            final int renderFlags) {
        if (element instanceof IErlFunction) {
            final IErlFunction fun = (IErlFunction) element;
            if (fun.isExported()) {
                return ErlideImage.FUNCTION_EXPORTED.getDescriptor();
            }
        }
        return getImageDescriptionFromKind(element.getKind());
    }
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.