Self (final PsiMethodPattern pattern) { return with(new PatternCondition<T>("insideMethod") { @Override public boolean accepts(@NotNull final T t, final ProcessingContext context) { PsiMethod method = PsiTreeUtil.getParentOfType(t, PsiMethod.class, false, PsiMember.class); return method != null && pattern.accepts(method, context); } }); }