boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!(file instanceof PyFile)) { return false; } final PySequenceExpression literal = findCollectionLiteralUnderCaret(editor, file); if (myTargetCollectionClass.isInstance(literal)) { return false; } if (literal instanceof PyTupleExpression) { if (PyTypingTypeProvider.isInsideTypeHint(literal, TypeEvalContext.codeAnalysis(literal.getProject(), file))) return false; setText(PyPsiBundle.message("INTN.convert.collection.literal", "tuple", myTargetCollectionName)); } else if (literal instanceof PyListLiteralExpression) { setText(PyPsiBundle.message("INTN.convert.collection.literal", "list", myTargetCollectionName)); } else if (literal instanceof PySetLiteralExpression) { setText(PyPsiBundle.message("INTN.convert.collection.literal", "set", myTargetCollectionName)); } else { return false; } return isAvailableForCollection(literal); }