@Nullable @Override public PsiComment getTypeComment() { final PsiComment inlineComment = PyUtil.getCommentOnHeaderLine(this); if (inlineComment != null && PyTypingTypeProvider.getTypeCommentValue(inlineComment.getText()) != null) { return inlineComment; } final PyStatementList statements = getStatementList(); if (statements.getStatements().length != 0) { final PsiComment comment = as(statements.getFirstChild(), PsiComment.class); if (comment != null && PyTypingTypeProvider.getTypeCommentValue(comment.getText()) != null) { return comment; } } return null; }
@Nullable @Override public String getTypeCommentAnnotation() { final PyFunctionStub stub = getStub(); if (stub != null) { return stub.getTypeComment(); } final PsiComment comment = getTypeComment(); if (comment != null) { return PyTypingTypeProvider.getTypeCommentValue(comment.getText()); } return null; }