Search in sources :

Example 1 with Protocol

use of org.elixir_lang.structure_view.element.modular.Protocol in project intellij-elixir by KronicDeth.

the class File method getChildren.

/*
     * Public Instance Methods
     */
@NotNull
@Override
public TreeElement[] getChildren() {
    Call[] calls = PsiTreeUtil.getChildrenOfType(navigationItem, Call.class);
    TreeElement[] children;
    if (calls != null) {
        List<TreeElement> treeElementList = new ArrayList<TreeElement>(calls.length);
        for (Call call : calls) {
            if (Implementation.is(call)) {
                treeElementList.add(new Implementation(call));
            } else if (Module.is(call)) {
                treeElementList.add(new Module(call));
            } else if (Protocol.is(call)) {
                treeElementList.add(new Protocol(call));
            } else if (Quote.is(call)) {
                treeElementList.add(new Quote(call));
            } else if (Unknown.is(call)) {
                // should always be last because it will match all macro calls
                treeElementList.add(new Unknown(call));
            }
        }
        children = treeElementList.toArray(new TreeElement[treeElementList.size()]);
    } else {
        children = new TreeElement[0];
    }
    return children;
}
Also used : Call(org.elixir_lang.psi.call.Call) Unknown(org.elixir_lang.structure_view.element.modular.Unknown) ArrayList(java.util.ArrayList) Module(org.elixir_lang.structure_view.element.modular.Module) Protocol(org.elixir_lang.structure_view.element.modular.Protocol) Implementation(org.elixir_lang.structure_view.element.modular.Implementation) TreeElement(com.intellij.ide.util.treeView.smartTree.TreeElement) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with Protocol

use of org.elixir_lang.structure_view.element.modular.Protocol in project intellij-elixir by KronicDeth.

the class GotoSymbolContributor method getItemsFromProtocol.

private void getItemsFromProtocol(@NotNull List<NavigationItem> items, @NotNull EnclosingModularByCall enclosingModularByCall, @NotNull Call call) {
    Modular modular = enclosingModularByCall.putNew(call);
    Protocol protocol = new Protocol(modular, call);
    items.add(protocol);
}
Also used : Modular(org.elixir_lang.structure_view.element.modular.Modular) Protocol(org.elixir_lang.structure_view.element.modular.Protocol)

Aggregations

Protocol (org.elixir_lang.structure_view.element.modular.Protocol)2 TreeElement (com.intellij.ide.util.treeView.smartTree.TreeElement)1 ArrayList (java.util.ArrayList)1 Call (org.elixir_lang.psi.call.Call)1 Implementation (org.elixir_lang.structure_view.element.modular.Implementation)1 Modular (org.elixir_lang.structure_view.element.modular.Modular)1 Module (org.elixir_lang.structure_view.element.modular.Module)1 Unknown (org.elixir_lang.structure_view.element.modular.Unknown)1 NotNull (org.jetbrains.annotations.NotNull)1