PsiElement (ASTNode nodeAtCaret, boolean before) { PsiElement wrappable = before ? findBeforeCaret(nodeAtCaret, PyEditorHandlerConfig.WRAPPABLE_CLASSES) : findAfterCaret(nodeAtCaret, PyEditorHandlerConfig.WRAPPABLE_CLASSES); if (wrappable == null) { PsiElement emptyTuple = before ? findBeforeCaret(nodeAtCaret, PyTupleExpression.class) : findAfterCaret(nodeAtCaret, PyTupleExpression.class); if (emptyTuple != null && emptyTuple.getNode().getFirstChildNode().getElementType() == PyTokenTypes.LPAR) { wrappable = emptyTuple; } } return wrappable; }