PsiElement (PsiElement element) { if (myMatchingVisitor.getMatchContext().getOptions().isLooseMatching()) { if (element instanceof PsiCodeBlock) { final List<PsiElement> list = PsiTreeUtil.getChildrenOfAnyType(element, PsiStatement.class, PsiComment.class); if (list.isEmpty()) return null; element = list.get(0); if (list.size() > 1) return element; } if (element instanceof PsiExpressionStatement expressionStatement) { element = expressionStatement.getExpression(); } if (element instanceof PsiReturnStatement returnStatement) { element = returnStatement.getReturnValue(); } } return element; }