use of org.elixir_lang.structure_view.element.modular.Implementation 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;
}
use of org.elixir_lang.structure_view.element.modular.Implementation in project intellij-elixir by KronicDeth.
the class GotoSymbolContributor method getItemsFromImplementation.
private void getItemsFromImplementation(@NotNull String name, @NotNull List<NavigationItem> items, @NotNull EnclosingModularByCall enclosingModularByCall, @NotNull Call call) {
Modular modular = enclosingModularByCall.putNew(call);
Collection<String> forNameCollection = Implementation.forNameCollection(modular, call);
if (forNameCollection != null) {
for (String forName : forNameCollection) {
Implementation forNameOverriddenImplementation = new Implementation(modular, call, forName);
String implementationName = forNameOverriddenImplementation.getName();
if (implementationName != null && implementationName.contains(name)) {
items.add(forNameOverriddenImplementation);
}
}
}
if (forNameCollection == null || forNameCollection.size() < 2) {
Implementation implementation = new Implementation(modular, call);
items.add(implementation);
}
}
Aggregations