JetDelegationSpecifierList#getDelegationSpecifiers() by stub
This commit is contained in:
@@ -18,12 +18,24 @@ package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.util.ArrayFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
|
||||
|
||||
public class JetDelegationSpecifier extends JetElementImplStub<PsiJetPlaceHolderStub<? extends JetDelegationSpecifier>> {
|
||||
|
||||
private static final JetDelegationSpecifier[] EMPTY_ARRAY = new JetDelegationSpecifier[0];
|
||||
|
||||
public static ArrayFactory<JetDelegationSpecifier> ARRAY_FACTORY = new ArrayFactory<JetDelegationSpecifier>() {
|
||||
@NotNull
|
||||
@Override
|
||||
public JetDelegationSpecifier[] create(int count) {
|
||||
return count == 0 ? EMPTY_ARRAY : new JetDelegationSpecifier[count];
|
||||
}
|
||||
};
|
||||
|
||||
public JetDelegationSpecifier(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
package org.jetbrains.jet.lang.psi;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.stubs.IStubElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.psi.stubs.PsiJetPlaceHolderStub;
|
||||
import org.jetbrains.jet.lang.psi.stubs.elements.JetStubElementTypes;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class JetDelegationSpecifierList extends JetElementImplStub<PsiJetPlaceHolderStub<JetDelegationSpecifierList>> {
|
||||
@@ -40,6 +39,6 @@ public class JetDelegationSpecifierList extends JetElementImplStub<PsiJetPlaceHo
|
||||
}
|
||||
|
||||
public List<JetDelegationSpecifier> getDelegationSpecifiers() {
|
||||
return PsiTreeUtil.getChildrenOfTypeAsList(this, JetDelegationSpecifier.class);
|
||||
return Arrays.asList(getStubOrPsiChildren(JetStubElementTypes.DELEGATION_SPECIFIER_TYPES, JetDelegationSpecifier.ARRAY_FACTORY));
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -98,4 +98,6 @@ public interface JetStubElementTypes {
|
||||
|
||||
TokenSet DECLARATION_TYPES =
|
||||
TokenSet.create(CLASS, OBJECT_DECLARATION, CLASS_OBJECT, FUNCTION, PROPERTY, ANONYMOUS_INITIALIZER, ENUM_ENTRY);
|
||||
|
||||
TokenSet DELEGATION_SPECIFIER_TYPES = TokenSet.create(DELEGATOR_BY, DELEGATOR_SUPER_CALL, DELEGATOR_SUPER_CLASS, THIS_CALL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user