Package vektah.rust.psi.mixin.item

Source Code of vektah.rust.psi.mixin.item.RustImplItemMixin

package vektah.rust.psi.mixin.item;

import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiNamedElement;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import vektah.rust.ide.structure.HasStructureViewChildren;
import vektah.rust.psi.RustImplItem;
import vektah.rust.psi.RustType;
import vektah.rust.psi.impl.RustItemImpl;

import java.util.Collections;
import java.util.List;

public abstract class RustImplItemMixin extends RustItemImpl implements RustImplItem, PsiNamedElement, HasStructureViewChildren {
    public RustImplItemMixin(ASTNode node) {
        super(node);
    }

    @Override
    public PsiElement setName(@NonNls @NotNull String s) throws IncorrectOperationException {
        return null;
    }

    @Override
    public String getName() {
        RustType type = getType();

        if (type != null) {
            return type.getText();
        }

        return null;
    }

    @Override
    public List<? extends PsiNamedElement> getChildrenItems() {
        if (getImplBlock() == null) {
            return Collections.emptyList();
        }

        return getImplBlock().getImplBody().getFnItemList();
    }
}
TOP

Related Classes of vektah.rust.psi.mixin.item.RustImplItemMixin

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.