From aec2051aa98ebb54dc5d73d8f061f55d4200244e Mon Sep 17 00:00:00 2001 From: Vladimir Koshelev Date: Thu, 18 Jan 2024 14:51:54 +0100 Subject: [PATCH] [python] get rid of IStubElementType and move logic about working with stubs to impl classes PY-61639 GitOrigin-RevId: 062dead109c25d944d4f61e901dc3c64c00b392e --- .../com/jetbrains/python/ast/PyAstClass.java | 14 ------- .../python/ast/PyAstFromImportStatement.java | 6 +-- .../jetbrains/python/ast/PyAstFunction.java | 22 +++------- .../python/ast/PyAstNamedParameter.java | 8 ++-- .../python/ast/PyAstTypeAliasStatement.java | 7 ++-- .../ast/PyAstTypeParameterListOwner.java | 4 +- .../com/jetbrains/python/PyElementTypes.java | 40 +++++++++--------- .../jetbrains/python/PyElementTypesFacade.kt | 42 ++++++++++--------- .../src/com/jetbrains/python/psi/PyClass.java | 12 ------ .../python/psi/PyFromImportStatement.java | 4 +- .../com/jetbrains/python/psi/PyFunction.java | 24 ----------- .../python/psi/PyNamedParameter.java | 6 --- .../python/psi/PyTypeAliasStatement.java | 6 --- .../python/psi/PyTypeParameterListOwner.java | 5 +-- .../python/PyElementTypesFacadeImpl.kt | 1 + .../python/psi/impl/PyAnnotationImpl.java | 3 +- .../python/psi/impl/PyClassImpl.java | 14 ++++++- .../python/psi/impl/PyDecoratorImpl.java | 3 +- .../python/psi/impl/PyDecoratorListImpl.java | 5 ++- .../python/psi/impl/PyExceptPartImpl.java | 3 +- .../psi/impl/PyFromImportStatementImpl.java | 8 +++- .../python/psi/impl/PyFunctionImpl.java | 24 ++++++++++- .../python/psi/impl/PyImportElementImpl.java | 3 +- .../psi/impl/PyImportStatementImpl.java | 3 +- .../python/psi/impl/PyNamedParameterImpl.java | 9 +++- .../python/psi/impl/PyParameterListImpl.java | 3 +- .../psi/impl/PySingleStarParameterImpl.java | 3 +- .../python/psi/impl/PySlashParameterImpl.java | 3 +- .../psi/impl/PyStarImportElementImpl.java | 3 +- .../psi/impl/PyTargetExpressionImpl.java | 3 +- .../python/psi/impl/PyTupleParameterImpl.java | 3 +- .../psi/impl/PyTypeAliasStatementImpl.java | 9 +++- .../python/psi/impl/PyTypeParameterImpl.java | 3 +- .../psi/impl/PyTypeParameterListImpl.java | 5 ++- .../impl/stubs/PyAnnotationElementType.java | 5 ++- .../psi/impl/stubs/PyClassElementType.java | 3 +- .../impl/stubs/PyDecoratorListStubImpl.java | 3 +- .../psi/impl/stubs/PyDecoratorStubImpl.java | 3 +- .../psi/impl/stubs/PyExceptPartStubImpl.java | 3 +- .../PyFromImportStatementElementType.java | 3 +- .../psi/impl/stubs/PyFunctionElementType.java | 3 +- .../stubs/PyImportElementElementType.java | 3 +- .../stubs/PyImportStatementElementType.java | 3 +- .../stubs/PyNamedParameterElementType.java | 3 +- .../stubs/PyParameterListElementType.java | 3 +- .../stubs/PySingleStarParameterStubImpl.java | 3 +- .../impl/stubs/PySlashParameterStubImpl.java | 3 +- .../stubs/PyStarImportElementStubImpl.java | 3 +- .../stubs/PyTargetExpressionStubImpl.java | 5 ++- .../impl/stubs/PyTupleParameterStubImpl.java | 3 +- .../PyTypeAliasStatementElementType.java | 3 +- .../stubs/PyTypeParameterElementType.java | 3 +- .../stubs/PyTypeParameterListElementType.java | 3 +- .../com/jetbrains/python/PyStubsTest.java | 2 +- 54 files changed, 190 insertions(+), 184 deletions(-) diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstClass.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstClass.java index 2f5365896bb6..47ca032802a9 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstClass.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstClass.java @@ -150,20 +150,6 @@ public interface PyAstClass extends PsiNameIdentifierOwner, PyAstCompoundStateme return DocStringUtilCore.getDocStringValue(this); } - @Override - @Nullable - default PyAstTypeParameterList getTypeParameterList() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.TYPE_PARAMETER_LIST); - } - - @Override - @Nullable - default PyAstDecoratorList getDecoratorList() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.DECORATOR_LIST); - } - @Override @Nullable default PyAstStringLiteralExpression getDocStringExpression() { diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstFromImportStatement.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstFromImportStatement.java index 1351cbc3e4b9..66f8edeadf55 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstFromImportStatement.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstFromImportStatement.java @@ -64,10 +64,8 @@ public interface PyAstFromImportStatement extends PyAstImportStatementBase, /** * @return the star in "from ... import *" */ - default @Nullable PyAstStarImportElement getStarImportElement() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.STAR_IMPORT_ELEMENT); - } + @Nullable + PyAstStarImportElement getStarImportElement(); /** * @return number of dots in relative "from" clause, or 0 in absolute import. diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstFunction.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstFunction.java index a03710fe49d8..3b4f312fffce 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstFunction.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstFunction.java @@ -145,11 +145,7 @@ public interface PyAstFunction extends PsiNameIdentifierOwner, PyAstCompoundStat @Override @Nullable - default PyAstTypeParameterList getTypeParameterList() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.TYPE_PARAMETER_LIST); - } - + PyAstTypeParameterList getTypeParameterList(); /** * Looks for two standard decorators to a function, or a wrapping assignment that closely follows it. * @@ -263,22 +259,14 @@ public interface PyAstFunction extends PsiNameIdentifierOwner, PyAstCompoundStat @Override @Nullable - default PyAstDecoratorList getDecoratorList() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.DECORATOR_LIST); // PsiTreeUtil.getChildOfType(this, PyDecoratorList.class); - } + PyAstDecoratorList getDecoratorList(); @Override - default PyAstAnnotation getAnnotation() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.ANNOTATION); - } + PyAstAnnotation getAnnotation(); @Override - default @NotNull PyAstParameterList getParameterList() { - //noinspection unchecked,rawtypes - return this.getRequiredStubOrPsiChild(PyElementTypes.PARAMETER_LIST); - } + @NotNull + PyAstParameterList getParameterList(); @Override @Nullable diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstNamedParameter.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstNamedParameter.java index d5855442ad32..77723278aab5 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstNamedParameter.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstNamedParameter.java @@ -19,6 +19,8 @@ import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiNameIdentifierOwner; import com.intellij.psi.PsiNamedElement; +import com.intellij.psi.stubs.IStubElementType; +import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; import com.jetbrains.python.PyTokenTypes; import com.jetbrains.python.PythonDialectsTokenSetProvider; @@ -101,11 +103,7 @@ public interface PyAstNamedParameter extends PyAstParameter, PsiNamedElement, Ps @Nullable @Override - default PyAstAnnotation getAnnotation() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.ANNOTATION); - } - + PyAstAnnotation getAnnotation(); /** * Parameter is considered "keyword-only" if it appears after named or unnamed positional vararg parameter. * See PEP-3102 for more details. diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeAliasStatement.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeAliasStatement.java index 9739107f7460..ccf961941bbc 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeAliasStatement.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeAliasStatement.java @@ -5,6 +5,8 @@ import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiNameIdentifierOwner; +import com.intellij.psi.stubs.IStubElementType; +import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; import com.jetbrains.python.PyTokenTypes; import com.jetbrains.python.ast.controlFlow.AstScopeOwner; @@ -27,10 +29,7 @@ public interface PyAstTypeAliasStatement extends PyAstStatement, PsiNameIdentifi @Override @Nullable - default PyAstTypeParameterList getTypeParameterList() { - //noinspection unchecked - return this.getStubOrPsiChild(PyElementTypes.TYPE_PARAMETER_LIST); - } + PyAstTypeParameterList getTypeParameterList(); @Nullable default PyAstExpression getTypeExpression() { diff --git a/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeParameterListOwner.java b/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeParameterListOwner.java index 1895ec91cd7a..c643af555238 100644 --- a/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeParameterListOwner.java +++ b/python/python-ast/src/com/jetbrains/python/ast/PyAstTypeParameterListOwner.java @@ -13,7 +13,5 @@ import org.jetbrains.annotations.Nullable; public interface PyAstTypeParameterListOwner extends PsiElement { @Nullable - default PyAstTypeParameterList getTypeParameterList() { - return null; - } + PyAstTypeParameterList getTypeParameterList(); } diff --git a/python/python-parser/src/com/jetbrains/python/PyElementTypes.java b/python/python-parser/src/com/jetbrains/python/PyElementTypes.java index 759abd3b53bc..3883fb30394c 100644 --- a/python/python-parser/src/com/jetbrains/python/PyElementTypes.java +++ b/python/python-parser/src/com/jetbrains/python/PyElementTypes.java @@ -2,32 +2,32 @@ package com.jetbrains.python; import com.intellij.psi.stubs.IStubElementType; +import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.TokenSet; import com.jetbrains.python.psi.*; import static com.jetbrains.python.PyElementTypesFacade.Companion; public interface PyElementTypes { - IStubElementType FUNCTION_DECLARATION = Companion.getINSTANCE().getFunctionDeclaration(); - IStubElementType CLASS_DECLARATION = Companion.getINSTANCE().getClassDeclaration(); - IStubElementType PARAMETER_LIST = Companion.getINSTANCE().getParameterList(); - IStubElementType DECORATOR_LIST = Companion.getINSTANCE().getDecoratorList(); - - IStubElementType NAMED_PARAMETER = Companion.getINSTANCE().getNamedParameter(); - IStubElementType TUPLE_PARAMETER = Companion.getINSTANCE().getTupleParameter(); - IStubElementType SLASH_PARAMETER = Companion.getINSTANCE().getSlashParameter(); - IStubElementType SINGLE_STAR_PARAMETER = Companion.getINSTANCE().getSingleStarParameter(); - IStubElementType DECORATOR_CALL = Companion.getINSTANCE().getDecoratorCall(); - IStubElementType IMPORT_ELEMENT = Companion.getINSTANCE().getImportElement(); - IStubElementType ANNOTATION = Companion.getINSTANCE().getAnnotation(); - IStubElementType STAR_IMPORT_ELEMENT = Companion.getINSTANCE().getStarImportElement(); - IStubElementType EXCEPT_PART = Companion.getINSTANCE().getExceptPart(); - IStubElementType FROM_IMPORT_STATEMENT = Companion.getINSTANCE().getFromImportStatement(); - IStubElementType IMPORT_STATEMENT = Companion.getINSTANCE().getImportStatement(); - IStubElementType TARGET_EXPRESSION = Companion.getINSTANCE().getTargetExpression(); - IStubElementType TYPE_PARAMETER = Companion.getINSTANCE().getTypeParameter(); - IStubElementType TYPE_PARAMETER_LIST = Companion.getINSTANCE().getTypeParameterList(); - IStubElementType TYPE_ALIAS_STATEMENT = Companion.getINSTANCE().getTypeAliasStatement(); + IElementType FUNCTION_DECLARATION = Companion.getINSTANCE().getFunctionDeclaration(); + IElementType CLASS_DECLARATION = Companion.getINSTANCE().getClassDeclaration(); + IElementType PARAMETER_LIST = Companion.getINSTANCE().getParameterList(); + IElementType DECORATOR_LIST = Companion.getINSTANCE().getDecoratorList(); + IElementType NAMED_PARAMETER = Companion.getINSTANCE().getNamedParameter(); + IElementType TUPLE_PARAMETER = Companion.getINSTANCE().getTupleParameter(); + IElementType SLASH_PARAMETER = Companion.getINSTANCE().getSlashParameter(); + IElementType SINGLE_STAR_PARAMETER = Companion.getINSTANCE().getSingleStarParameter(); + IElementType DECORATOR_CALL = Companion.getINSTANCE().getDecoratorCall(); + IElementType IMPORT_ELEMENT = Companion.getINSTANCE().getImportElement(); + IElementType ANNOTATION = Companion.getINSTANCE().getAnnotation(); + IElementType STAR_IMPORT_ELEMENT = Companion.getINSTANCE().getStarImportElement(); + IElementType EXCEPT_PART = Companion.getINSTANCE().getExceptPart(); + IElementType FROM_IMPORT_STATEMENT = Companion.getINSTANCE().getFromImportStatement(); + IElementType IMPORT_STATEMENT = Companion.getINSTANCE().getImportStatement(); + IElementType TARGET_EXPRESSION = Companion.getINSTANCE().getTargetExpression(); + IElementType TYPE_PARAMETER = Companion.getINSTANCE().getTypeParameter(); + IElementType TYPE_PARAMETER_LIST = Companion.getINSTANCE().getTypeParameterList(); + IElementType TYPE_ALIAS_STATEMENT = Companion.getINSTANCE().getTypeAliasStatement(); TokenSet PARAMETER_LIST_SET = TokenSet.create(PARAMETER_LIST); diff --git a/python/python-parser/src/com/jetbrains/python/PyElementTypesFacade.kt b/python/python-parser/src/com/jetbrains/python/PyElementTypesFacade.kt index 8a675c026b76..ff323133d1e5 100644 --- a/python/python-parser/src/com/jetbrains/python/PyElementTypesFacade.kt +++ b/python/python-parser/src/com/jetbrains/python/PyElementTypesFacade.kt @@ -6,31 +6,35 @@ import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.components.service import com.intellij.psi.PsiElement import com.intellij.psi.stubs.IStubElementType +import com.intellij.psi.tree.IElementType +import com.jetbrains.python.psi.PyElementType import java.util.function.Function abstract class PyElementTypesFacade { - abstract val functionDeclaration: IStubElementType<*, *> - abstract val classDeclaration: IStubElementType<*, *> - abstract val parameterList: IStubElementType<*, *> - abstract val decoratorList: IStubElementType<*, *> - abstract val namedParameter: IStubElementType<*, *> - abstract val tupleParameter: IStubElementType<*, *> - abstract val slashParameter: IStubElementType<*, *> - abstract val singleStarParameter: IStubElementType<*, *> - abstract val decoratorCall: IStubElementType<*, *> - abstract val importElement: IStubElementType<*, *> - abstract val annotation: IStubElementType<*, *> - abstract val starImportElement: IStubElementType<*, *> - abstract val exceptPart: IStubElementType<*, *> - abstract val fromImportStatement: IStubElementType<*, *> - abstract val importStatement: IStubElementType<*, *> - abstract val targetExpression: IStubElementType<*, *> - abstract val typeParameter: IStubElementType<*, *> - abstract val typeParameterList: IStubElementType<*, *> - abstract val typeAliasStatement: IStubElementType<*, *> + // stubs on backend side + abstract val functionDeclaration: IElementType + abstract val classDeclaration: IElementType + abstract val parameterList: IElementType + abstract val decoratorList: IElementType + abstract val namedParameter: IElementType + abstract val tupleParameter: IElementType + abstract val slashParameter: IElementType + abstract val singleStarParameter: IElementType + abstract val decoratorCall: IElementType + abstract val importElement: IElementType + abstract val annotation: IElementType + abstract val starImportElement: IElementType + abstract val exceptPart: IElementType + abstract val fromImportStatement: IElementType + abstract val importStatement: IElementType + abstract val targetExpression: IElementType + abstract val typeParameter: IElementType + abstract val typeParameterList: IElementType + abstract val typeAliasStatement: IElementType + // constructors for non-stub elements abstract val argumentListConstructor: Function abstract val printTargetConstructor: Function abstract val decoratorConstructor: Function diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/PyClass.java b/python/python-psi-api/src/com/jetbrains/python/psi/PyClass.java index 9f0291d3f059..6fd93d8a0c29 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/PyClass.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/PyClass.java @@ -352,18 +352,6 @@ public interface PyClass extends PyAstClass, PsiNameIdentifierOwner, PyCompoundS @Nullable PyClassLikeType getType(@NotNull TypeEvalContext context); - @Override - @Nullable - default PyTypeParameterList getTypeParameterList() { - return (PyTypeParameterList)PyAstClass.super.getTypeParameterList(); - } - - @Override - @Nullable - default PyDecoratorList getDecoratorList() { - return (PyDecoratorList)PyAstClass.super.getDecoratorList(); - } - @Override @Nullable default PyStringLiteralExpression getDocStringExpression() { diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/PyFromImportStatement.java b/python/python-psi-api/src/com/jetbrains/python/psi/PyFromImportStatement.java index 3e948d9734fb..4c347bba7298 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/PyFromImportStatement.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/PyFromImportStatement.java @@ -45,9 +45,7 @@ public interface PyFromImportStatement extends PyAstFromImportStatement, PyImpor */ @Override @Nullable - default PyStarImportElement getStarImportElement() { - return (PyStarImportElement)PyAstFromImportStatement.super.getStarImportElement(); - } + PyStarImportElement getStarImportElement(); /** * Resolves the import source qualified name to a file or directory. Note: performs a Python only resolve, diff --git a/python/python-psi-api/src/com/jetbrains/python/psi/PyFunction.java b/python/python-psi-api/src/com/jetbrains/python/psi/PyFunction.java index 199b2a49e31d..21a907296ff5 100644 --- a/python/python-psi-api/src/com/jetbrains/python/psi/PyFunction.java +++ b/python/python-psi-api/src/com/jetbrains/python/psi/PyFunction.java @@ -54,12 +54,6 @@ public interface PyFunction extends PyAstFunction, StubBasedPsiElementPEP 695 */ public interface PyTypeParameterListOwner extends PyAstTypeParameterListOwner, PsiElement { - @Override @Nullable - default PyTypeParameterList getTypeParameterList() { - return null; - } + PyTypeParameterList getTypeParameterList(); } diff --git a/python/python-psi-impl/src/com/jetbrains/python/PyElementTypesFacadeImpl.kt b/python/python-psi-impl/src/com/jetbrains/python/PyElementTypesFacadeImpl.kt index 8976c2d0cb5b..e09588704318 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/PyElementTypesFacadeImpl.kt +++ b/python/python-psi-impl/src/com/jetbrains/python/PyElementTypesFacadeImpl.kt @@ -7,6 +7,7 @@ import com.intellij.psi.PsiElement import com.intellij.psi.stubs.IStubElementType import com.jetbrains.python.psi.impl.* import com.jetbrains.python.PyElementTypesFacade +import com.jetbrains.python.psi.PyElementType import java.util.function.Function diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java index 878c78050e43..67dc18d42e64 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyAnnotationImpl.java @@ -17,6 +17,7 @@ package com.jetbrains.python.psi.impl; import com.intellij.lang.ASTNode; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyAnnotation; import com.jetbrains.python.psi.PyElementVisitor; import com.jetbrains.python.psi.stubs.PyAnnotationStub; @@ -28,7 +29,7 @@ public class PyAnnotationImpl extends PyBaseElementImpl implem } public PyAnnotationImpl(PyAnnotationStub stub) { - super(stub, PyElementTypes.ANNOTATION); + super(stub, PyStubElementTypes.ANNOTATION); } @Override diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyClassImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyClassImpl.java index f20dd1f0371c..1cef192403f0 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyClassImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyClassImpl.java @@ -78,7 +78,7 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla } public PyClassImpl(@NotNull final PyClassStub stub) { - this(stub, PyElementTypes.CLASS_DECLARATION); + this(stub, PyStubElementTypes.CLASS_DECLARATION); } public PyClassImpl(@NotNull final PyClassStub stub, @NotNull IStubElementType nodeType) { @@ -1675,6 +1675,18 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla return as(context.getType(this), PyClassLikeType.class); } + @Override + @Nullable + public PyTypeParameterList getTypeParameterList() { + return getStubOrPsiChild(PyStubElementTypes.TYPE_PARAMETER_LIST); + } + + @Nullable + @Override + public PyDecoratorList getDecoratorList() { + return getStubOrPsiChild(PyStubElementTypes.DECORATOR_LIST); + } + @NotNull private TypeEvalContext notNullizeContext(@Nullable TypeEvalContext context) { return context == null ? TypeEvalContext.codeInsightFallback(getProject()) : context; diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorImpl.java index a2a76b040f59..e22e1e2b3fbd 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorImpl.java @@ -10,6 +10,7 @@ import com.intellij.util.Function; import com.intellij.util.IncorrectOperationException; import com.intellij.util.containers.ContainerUtil; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.PyTokenTypes; import com.jetbrains.python.PythonDialectsTokenSetProvider; import com.jetbrains.python.psi.*; @@ -32,7 +33,7 @@ public class PyDecoratorImpl extends PyBaseElementImpl implemen } public PyDecoratorImpl(PyDecoratorStub stub) { - super(stub, PyElementTypes.DECORATOR_CALL); + super(stub, PyStubElementTypes.DECORATOR_CALL); } @Override diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorListImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorListImpl.java index c12f0ebef659..cb45f49ff31d 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorListImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyDecoratorListImpl.java @@ -4,6 +4,7 @@ package com.jetbrains.python.psi.impl; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyDecorator; import com.jetbrains.python.psi.PyDecoratorList; import com.jetbrains.python.psi.PyElementVisitor; @@ -22,13 +23,13 @@ public class PyDecoratorListImpl extends PyBaseElementImpl } public PyDecoratorListImpl(final PyDecoratorListStub stub) { - super(stub, PyElementTypes.DECORATOR_LIST); + super(stub, PyStubElementTypes.DECORATOR_LIST); } @Override public PyDecorator @NotNull [] getDecorators() { final PyDecorator[] decoarray = new PyDecorator[0]; - return getStubOrPsiChildren(PyElementTypes.DECORATOR_CALL, decoarray); + return getStubOrPsiChildren(PyStubElementTypes.DECORATOR_CALL, decoarray); //return decoarray; } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyExceptPartImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyExceptPartImpl.java index 7e579ea5740e..29953256824a 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyExceptPartImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyExceptPartImpl.java @@ -4,6 +4,7 @@ package com.jetbrains.python.psi.impl; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiNamedElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyElementVisitor; import com.jetbrains.python.psi.PyExceptPart; import com.jetbrains.python.psi.PyUtil; @@ -18,7 +19,7 @@ public class PyExceptPartImpl extends PyBaseElementImpl implem } public PyExceptPartImpl(PyExceptPartStub stub) { - super(stub, PyElementTypes.EXCEPT_PART); + super(stub, PyStubElementTypes.EXCEPT_PART); } @Override diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyFromImportStatementImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyFromImportStatementImpl.java index a1bad2c17a84..43deefbd1fee 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyFromImportStatementImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyFromImportStatementImpl.java @@ -14,6 +14,7 @@ import com.intellij.psi.util.QualifiedName; import com.intellij.util.ArrayUtil; import com.intellij.util.containers.ContainerUtil; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.PyTokenTypes; import com.jetbrains.python.psi.*; import com.jetbrains.python.psi.resolve.RatedResolveResult; @@ -36,7 +37,7 @@ public class PyFromImportStatementImpl extends PyBaseElementImpl implements } public PyFunctionImpl(final PyFunctionStub stub) { - this(stub, PyElementTypes.FUNCTION_DECLARATION); + this(stub, PyStubElementTypes.FUNCTION_DECLARATION); } public PyFunctionImpl(PyFunctionStub stub, IStubElementType nodeType) { @@ -713,6 +714,27 @@ public class PyFunctionImpl extends PyBaseElementImpl implements }, false); } + @Override + public @NotNull PyParameterList getParameterList() { + return getRequiredStubOrPsiChild(PyStubElementTypes.PARAMETER_LIST); + } + + @Override + public @Nullable PyTypeParameterList getTypeParameterList() { + return getStubOrPsiChild(PyStubElementTypes.TYPE_PARAMETER_LIST); + } + + @Override + public @Nullable PyDecoratorList getDecoratorList() { + return getStubOrPsiChild(PyStubElementTypes.DECORATOR_LIST); + } + + @Override + public @Nullable PyAnnotation getAnnotation() { + return getStubOrPsiChild(PyStubElementTypes.ANNOTATION); + } + + /** * @param self should be this */ diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java index a130c65ec407..3e6f8c7b3b50 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportElementImpl.java @@ -10,6 +10,7 @@ import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.QualifiedName; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.*; import com.jetbrains.python.psi.resolve.RatedResolveResult; import com.jetbrains.python.psi.resolve.ResolveImportUtil; @@ -31,7 +32,7 @@ public class PyImportElementImpl extends PyBaseElementImpl } public PyImportElementImpl(PyImportElementStub stub) { - this(stub, PyElementTypes.IMPORT_ELEMENT); + this(stub, PyStubElementTypes.IMPORT_ELEMENT); } public PyImportElementImpl(PyImportElementStub stub, IStubElementType nodeType) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportStatementImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportStatementImpl.java index 5d2c442e2a4a..cbb130867ba2 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportStatementImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyImportStatementImpl.java @@ -11,6 +11,7 @@ import com.intellij.psi.tree.TokenSet; import com.intellij.psi.util.QualifiedName; import com.intellij.util.ArrayUtil; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.*; import com.jetbrains.python.psi.resolve.RatedResolveResult; import com.jetbrains.python.psi.resolve.ResolveImportUtil; @@ -31,7 +32,7 @@ public class PyImportStatementImpl extends PyBaseElementImpl } public PyParameterListImpl(final PyParameterListStub stub) { - this(stub, PyElementTypes.PARAMETER_LIST); + this(stub, PyStubElementTypes.PARAMETER_LIST); } public PyParameterListImpl(final PyParameterListStub stub, IStubElementType nodeType) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PySingleStarParameterImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PySingleStarParameterImpl.java index 4e655c41da28..49191058c2f6 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PySingleStarParameterImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PySingleStarParameterImpl.java @@ -18,6 +18,7 @@ package com.jetbrains.python.psi.impl; import com.intellij.lang.ASTNode; import com.intellij.navigation.ItemPresentation; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyElementVisitor; import com.jetbrains.python.psi.PySingleStarParameter; import com.jetbrains.python.psi.stubs.PySingleStarParameterStub; @@ -29,7 +30,7 @@ public class PySingleStarParameterImpl extends PyBaseElementImpl } public PyTypeParameterImpl(PyTypeParameterStub stub) { - this(stub, PyElementTypes.TYPE_PARAMETER); + this(stub, PyStubElementTypes.TYPE_PARAMETER); } public PyTypeParameterImpl(PyTypeParameterStub stub, IStubElementType nodeType) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyTypeParameterListImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyTypeParameterListImpl.java index 2787e93c117c..93e8d10772d8 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyTypeParameterListImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PyTypeParameterListImpl.java @@ -3,6 +3,7 @@ package com.jetbrains.python.psi.impl; import com.intellij.lang.ASTNode; import com.intellij.psi.stubs.IStubElementType; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyElementVisitor; import com.jetbrains.python.psi.PyTypeParameter; import com.jetbrains.python.psi.PyTypeParameterList; @@ -17,7 +18,7 @@ public class PyTypeParameterListImpl extends PyBaseElementImpl getTypeParameters() { - return List.of(getStubOrPsiChildren(PyElementTypes.TYPE_PARAMETER, new PyTypeParameter[0])); + return List.of(getStubOrPsiChildren(PyStubElementTypes.TYPE_PARAMETER, new PyTypeParameter[0])); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java index 84c582802da2..f39bd0b02215 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java @@ -8,6 +8,7 @@ import com.intellij.psi.stubs.StubInputStream; import com.intellij.psi.stubs.StubOutputStream; import com.intellij.psi.tree.IElementType; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.PythonDialectsTokenSetProvider; import com.jetbrains.python.psi.PyAnnotation; import com.jetbrains.python.psi.PyStubElementType; @@ -35,7 +36,7 @@ public class PyAnnotationElementType extends PyStubElementType @NotNull protected IStubElementType getStubElementType() { - return PyElementTypes.CLASS_DECLARATION; + return PyStubElementTypes.CLASS_DECLARATION; } @NotNull diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorListStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorListStubImpl.java index c8f438e5efd8..0b7444412366 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorListStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorListStubImpl.java @@ -18,11 +18,12 @@ package com.jetbrains.python.psi.impl.stubs; import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyDecoratorList; import com.jetbrains.python.psi.stubs.PyDecoratorListStub; public class PyDecoratorListStubImpl extends StubBase implements PyDecoratorListStub { public PyDecoratorListStubImpl(final StubElement parent) { - super(parent, PyElementTypes.DECORATOR_LIST); + super(parent, PyStubElementTypes.DECORATOR_LIST); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorStubImpl.java index a77efc03834a..df4947122348 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorStubImpl.java @@ -5,6 +5,7 @@ import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.psi.util.QualifiedName; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyDecorator; import com.jetbrains.python.psi.stubs.PyDecoratorStub; import org.jetbrains.annotations.NotNull; @@ -27,7 +28,7 @@ public class PyDecoratorStubImpl extends StubBase implements PyDeco final StubElement parent, final @NotNull List positionalArguments, final @NotNull Map namedArguments) { - super(parent, PyElementTypes.DECORATOR_CALL); + super(parent, PyStubElementTypes.DECORATOR_CALL); myQualifiedName = qualname; myHasArgumentList = hasArgumentList; myPositionalArguments = positionalArguments; diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyExceptPartStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyExceptPartStubImpl.java index 4abdc702ba2c..a85f01a48143 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyExceptPartStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyExceptPartStubImpl.java @@ -18,12 +18,13 @@ package com.jetbrains.python.psi.impl.stubs; import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyExceptPart; import com.jetbrains.python.psi.stubs.PyExceptPartStub; public class PyExceptPartStubImpl extends StubBase implements PyExceptPartStub { protected PyExceptPartStubImpl(final StubElement parent) { - super(parent, PyElementTypes.EXCEPT_PART); + super(parent, PyStubElementTypes.EXCEPT_PART); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyFromImportStatementElementType.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyFromImportStatementElementType.java index a558830c7fd1..ca9a17dbda8c 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyFromImportStatementElementType.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyFromImportStatementElementType.java @@ -9,6 +9,7 @@ import com.intellij.psi.stubs.StubInputStream; import com.intellij.psi.stubs.StubOutputStream; import com.intellij.psi.util.QualifiedName; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyFromImportStatement; import com.jetbrains.python.psi.PyStubElementType; import com.jetbrains.python.psi.impl.PyFromImportStatementImpl; @@ -64,6 +65,6 @@ public class PyFromImportStatementElementType extends PyStubElementType implements PySingleStarParameterStub { protected PySingleStarParameterStubImpl(final StubElement parent) { - super(parent, PyElementTypes.SINGLE_STAR_PARAMETER); + super(parent, PyStubElementTypes.SINGLE_STAR_PARAMETER); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PySlashParameterStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PySlashParameterStubImpl.java index c5d317e1227c..efc8d530177f 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PySlashParameterStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PySlashParameterStubImpl.java @@ -4,6 +4,7 @@ package com.jetbrains.python.psi.impl.stubs; import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PySlashParameter; import com.jetbrains.python.psi.stubs.PySlashParameterStub; import org.jetbrains.annotations.ApiStatus; @@ -12,6 +13,6 @@ import org.jetbrains.annotations.ApiStatus; public class PySlashParameterStubImpl extends StubBase implements PySlashParameterStub { public PySlashParameterStubImpl(StubElement parent) { - super(parent, PyElementTypes.SLASH_PARAMETER); + super(parent, PyStubElementTypes.SLASH_PARAMETER); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyStarImportElementStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyStarImportElementStubImpl.java index 8ec7a4aa9812..037e4b27a50b 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyStarImportElementStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyStarImportElementStubImpl.java @@ -18,11 +18,12 @@ package com.jetbrains.python.psi.impl.stubs; import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyStarImportElement; import com.jetbrains.python.psi.stubs.PyStarImportElementStub; public class PyStarImportElementStubImpl extends StubBase implements PyStarImportElementStub { protected PyStarImportElementStubImpl(final StubElement parent) { - super(parent, PyElementTypes.STAR_IMPORT_ELEMENT); + super(parent, PyStubElementTypes.STAR_IMPORT_ELEMENT); } } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTargetExpressionStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTargetExpressionStubImpl.java index 96fa9287cbc5..9724f2a20e67 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTargetExpressionStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTargetExpressionStubImpl.java @@ -20,6 +20,7 @@ import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.intellij.psi.util.QualifiedName; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyTargetExpression; import com.jetbrains.python.psi.stubs.PyTargetExpressionStub; import org.jetbrains.annotations.Nullable; @@ -44,7 +45,7 @@ public class PyTargetExpressionStubImpl extends StubBase imp boolean hasAssignedValue, CustomTargetExpressionStub customStub, StubElement parent) { - super(parent, PyElementTypes.TARGET_EXPRESSION); + super(parent, PyStubElementTypes.TARGET_EXPRESSION); myName = name; myTypeComment = typeComment; myAnnotation = annotation; @@ -65,7 +66,7 @@ public class PyTargetExpressionStubImpl extends StubBase imp @Nullable String annotation, boolean hasAssignedValue, final StubElement parentStub) { - super(parentStub, PyElementTypes.TARGET_EXPRESSION); + super(parentStub, PyStubElementTypes.TARGET_EXPRESSION); myName = name; myTypeComment = typeComment; myAnnotation = annotation; diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTupleParameterStubImpl.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTupleParameterStubImpl.java index 55fbcef3ba03..94693d524429 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTupleParameterStubImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTupleParameterStubImpl.java @@ -4,6 +4,7 @@ package com.jetbrains.python.psi.impl.stubs; import com.intellij.psi.stubs.StubBase; import com.intellij.psi.stubs.StubElement; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyTupleParameter; import com.jetbrains.python.psi.stubs.PyTupleParameterStub; import org.jetbrains.annotations.Nullable; @@ -16,7 +17,7 @@ public class PyTupleParameterStubImpl extends StubBase implem private final String myDefaultValueText; protected PyTupleParameterStubImpl(@Nullable String defaultValueText, StubElement parent) { - super(parent, PyElementTypes.TUPLE_PARAMETER); + super(parent, PyStubElementTypes.TUPLE_PARAMETER); myDefaultValueText = defaultValueText; } diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTypeAliasStatementElementType.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTypeAliasStatementElementType.java index 59648560db96..dd61c9ff2ee1 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTypeAliasStatementElementType.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/stubs/PyTypeAliasStatementElementType.java @@ -7,6 +7,7 @@ import com.intellij.psi.stubs.StubElement; import com.intellij.psi.stubs.StubInputStream; import com.intellij.psi.stubs.StubOutputStream; import com.jetbrains.python.PyElementTypes; +import com.jetbrains.python.PyStubElementTypes; import com.jetbrains.python.psi.PyStubElementType; import com.jetbrains.python.psi.PyTypeAliasStatement; import com.jetbrains.python.psi.impl.PyTypeAliasStatementImpl; @@ -57,6 +58,6 @@ public class PyTypeAliasStatementElementType extends PyStubElementType getStubElementType() { - return PyElementTypes.TYPE_PARAMETER_LIST; + return PyStubElementTypes.TYPE_PARAMETER_LIST; } } diff --git a/python/testSrc/com/jetbrains/python/PyStubsTest.java b/python/testSrc/com/jetbrains/python/PyStubsTest.java index c5effe2e4bf3..9cf12122d81f 100644 --- a/python/testSrc/com/jetbrains/python/PyStubsTest.java +++ b/python/testSrc/com/jetbrains/python/PyStubsTest.java @@ -872,7 +872,7 @@ public class PyStubsTest extends PyTestCase { final PyFile file = getTestFile(); final PyFunction func = file.findTopLevelFunction("func"); final PyFunctionStub funcStub = func.getStub(); - assertNull(funcStub.findChildStubByType(PyElementTypes.ANNOTATION)); + assertNull(funcStub.findChildStubByType(PyStubElementTypes.ANNOTATION)); } // PY-26163