PsiReturnStatement -> surrounding PsiMethod

Is there an more elegant way of getting the surrounding PsiMethod for a
PsiReturnStatement than just walking up the parents?

Tom

0
2 comments
Avatar
Permanently deleted user

Thomas Singer (MoTJ) wrote:

Is there an more elegant way of getting the surrounding PsiMethod for a
PsiReturnStatement than just walking up the parents?


I can't think of any other than something like
PsiTreeUtil.getParentOfType(returnStatement, PsiMethod.class)

Sascha

0
Avatar
Permanently deleted user

Thanks.

0

Please sign in to leave a comment.