PsiElement () { final PyBinaryExpression binaryExpression = PsiTreeUtil.getParentOfType(getElement(), PyBinaryExpression.class); if (binaryExpression != null) { final PyExpression rightExpression = binaryExpression.getRightExpression(); if (rightExpression == null) { return null; } boolean isKeyWordSubstitution = myChunk.getMappingKey() != null; return isKeyWordSubstitution ? resolveKeywordPercent(rightExpression, myChunk.getMappingKey()) : resolvePositionalPercent(rightExpression); } return null; }