Ejemplo n.º 1
0
 @Nullable
 public String extractDeprecationMessage() {
   PyStatementList statementList = getStatementList();
   if (statementList == null) {
     return null;
   }
   return extractDeprecationMessage(Arrays.asList(statementList.getStatements()));
 }
  @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;
  }