// Path: src/main/java/org/elmlang/intellijplugin/ElmIcons.java
// public class ElmIcons {
//     private static final String ELM_ICONS_PATH = "/org/elmlang/intellijplugin/icons/";
// 
//     @NotNull
//     private static Icon getIcon(String path) {
//         return IconLoader.getIcon(ELM_ICONS_PATH + path);
//     }
// 
//     public static final Icon FILE = getIcon("elm-file.png");
//     public static final Icon FUNCTION = getIcon("function.png");
//     public static final Icon VALUE = getIcon("value.png");
//     public static final Icon UNION_TYPE = getIcon("type.png");
//     public static final Icon TYPE_ALIAS = getIcon("type.png");
// }
// 
// Path: src/main/java/org/elmlang/intellijplugin/psi/ElmValueDeclarationBase.java
// public interface ElmValueDeclarationBase extends PsiElement, ElmWithExpression, ElmWithDisplayName {
//     @Nullable
//     ElmFunctionDeclarationLeft getFunctionDeclarationLeft();
// 
//     @Nullable
//     ElmOperatorDeclarationLeft getOperatorDeclarationLeft();
// 
//     @Nullable
//     ElmPattern getPattern();
// 
//     ValueDeclarationRole getRole();
// }


import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
import org.elmlang.intellijplugin.ElmIcons;
import org.elmlang.intellijplugin.psi.ElmValueDeclarationBase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
package org.elmlang.intellijplugin.features.structure;



public class ElmValueDeclarationTreeElement extends PsiTreeElementBase<ElmValueDeclarationBase> {
    ElmValueDeclarationTreeElement(ElmValueDeclarationBase psiElement) {
        super(psiElement);
    }

    @Override
    public Icon getIcon(boolean open) {
        return Optional.ofNullable(this.getElement())
                .map(e -> {
                    switch (e.getRole()) {
                        case VALUE: return ElmIcons.VALUE;
                        case FUNCTION: return ElmIcons.FUNCTION;
// Path: src/main/java/org/elmlang/intellijplugin/ElmIcons.java
// public class ElmIcons {
//     private static final String ELM_ICONS_PATH = "/org/elmlang/intellijplugin/icons/";
// 
//     @NotNull
//     private static Icon getIcon(String path) {
//         return IconLoader.getIcon(ELM_ICONS_PATH + path);
//     }
// 
//     public static final Icon FILE = getIcon("elm-file.png");
//     public static final Icon FUNCTION = getIcon("function.png");
//     public static final Icon VALUE = getIcon("value.png");
//     public static final Icon UNION_TYPE = getIcon("type.png");
//     public static final Icon TYPE_ALIAS = getIcon("type.png");
// }
// 
// Path: src/main/java/org/elmlang/intellijplugin/psi/ElmValueDeclarationBase.java
// public interface ElmValueDeclarationBase extends PsiElement, ElmWithExpression, ElmWithDisplayName {
//     @Nullable
//     ElmFunctionDeclarationLeft getFunctionDeclarationLeft();
// 
//     @Nullable
//     ElmOperatorDeclarationLeft getOperatorDeclarationLeft();
// 
//     @Nullable
//     ElmPattern getPattern();
// 
//     ValueDeclarationRole getRole();
// }


// Path: src/main/java/org/elmlang/intellijplugin/features/structure/ElmValueDeclarationTreeElement.java
import com.intellij.ide.structureView.StructureViewTreeElement;
import com.intellij.ide.structureView.impl.common.PsiTreeElementBase;
import org.elmlang.intellijplugin.ElmIcons;
import org.elmlang.intellijplugin.psi.ElmValueDeclarationBase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.Icon;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

package org.elmlang.intellijplugin.features.structure;



public class ElmValueDeclarationTreeElement extends PsiTreeElementBase<ElmValueDeclarationBase> {
    ElmValueDeclarationTreeElement(ElmValueDeclarationBase psiElement) {
        super(psiElement);
    }

    @Override
    public Icon getIcon(boolean open) {
        return Optional.ofNullable(this.getElement())
                .map(e -> {
                    switch (e.getRole()) {
                        case VALUE: return ElmIcons.VALUE;
                        case FUNCTION: return ElmIcons.FUNCTION;
                        case OPERATOR: return ElmIcons.FUNCTION;