PyStringLiteralExpression (@NotNull PsiElement element) { final PyDocStringOwner docStringOwner = PsiTreeUtil.getParentOfType(element, PyDocStringOwner.class); if (docStringOwner != null) { final PyStringLiteralExpression docString = docStringOwner.getDocStringExpression(); if (PsiTreeUtil.isAncestor(docString, element, false)) { return docString; } } return null; }