Search in sources :

Example 1 with PyFunctionImpl

use of com.jetbrains.python.psi.impl.PyFunctionImpl in project intellij-community by JetBrains.

the class PyFunctionElementType method createStub.

@NotNull
public PyFunctionStub createStub(@NotNull final PyFunction psi, final StubElement parentStub) {
    PyFunctionImpl function = (PyFunctionImpl) psi;
    String message = function.extractDeprecationMessage();
    final PyStringLiteralExpression docStringExpression = function.getDocStringExpression();
    final String typeComment = function.getTypeCommentAnnotation();
    return new PyFunctionStubImpl(psi.getName(), PyPsiUtils.strValue(docStringExpression), message, function.isAsync(), typeComment, parentStub, getStubElementType());
}
Also used : PyStringLiteralExpression(com.jetbrains.python.psi.PyStringLiteralExpression) PyFunctionImpl(com.jetbrains.python.psi.impl.PyFunctionImpl) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

PyStringLiteralExpression (com.jetbrains.python.psi.PyStringLiteralExpression)1 PyFunctionImpl (com.jetbrains.python.psi.impl.PyFunctionImpl)1 NotNull (org.jetbrains.annotations.NotNull)1