Search in sources :

Example 1 with SymbolPsiProcessor

use of org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.v2.SymbolPsiProcessor in project intellij-plugins by JetBrains.

the class MotionClassSymbol method getChildren.

@NotNull
@Override
public Children getChildren() {
    return new ChildrenImpl() {

        @Override
        public boolean processChildren(SymbolPsiProcessor processor, final PsiElement invocationPoint) {
            final MotionClassSymbol parent = MotionClassSymbol.this;
            for (Class clazz : myClasses) {
                for (Function function : clazz.getFunctions()) {
                    for (RTypedSyntheticSymbol functionSymbol : MotionSymbolUtil.createSelectorSymbols(myModule, parent, function)) {
                        if (!processor.process(functionSymbol)) {
                            return false;
                        }
                    }
                }
                for (Class subClass : clazz.getSubClasses()) {
                    final MotionClassSymbol symbol = new MotionClassSymbol(myModule, Collections.singletonList(subClass));
                    if (!processor.process(symbol)) {
                        return false;
                    }
                }
            }
            final Symbol superClass = getSuperClassSymbol(invocationPoint);
            if (superClass != null) {
                final Children children = superClass.getChildren();
                if (!children.processChildren(processor, invocationPoint)) {
                    return false;
                }
            }
            return true;
        }
    };
}
Also used : Function(org.jetbrains.plugins.ruby.motion.bridgesupport.Function) SymbolPsiProcessor(org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.v2.SymbolPsiProcessor) Class(org.jetbrains.plugins.ruby.motion.bridgesupport.Class) PsiElement(com.intellij.psi.PsiElement) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PsiElement (com.intellij.psi.PsiElement)1 NotNull (org.jetbrains.annotations.NotNull)1 Class (org.jetbrains.plugins.ruby.motion.bridgesupport.Class)1 Function (org.jetbrains.plugins.ruby.motion.bridgesupport.Function)1 SymbolPsiProcessor (org.jetbrains.plugins.ruby.ruby.codeInsight.symbols.v2.SymbolPsiProcessor)1