PsiReturnStatement -> surrounding PsiMethod

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

Tom

2 comments
Comment actions Permalink

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

Please sign in to leave a comment.