mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Simplify a check in CompatibilityVisitor
GitOrigin-RevId: 14bc99af4e89c443bba2f8569fdfad0053459fe4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bdb243bb58
commit
c6a15fa65b
+3
-2
@@ -7,6 +7,7 @@ import com.intellij.codeInspection.ProblemDescriptor;
|
||||
import com.intellij.codeInspection.util.InspectionMessage;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -330,10 +331,10 @@ public abstract class CompatibilityVisitor extends PyAnnotator {
|
||||
super.visitPyPrintStatement(node);
|
||||
|
||||
final PsiElement[] arguments = node.getChildren();
|
||||
final Predicate<PsiElement> nonParenthesesPredicate =
|
||||
final Condition<PsiElement> nonParenthesesPredicate =
|
||||
element -> !(element instanceof PyParenthesizedExpression || element instanceof PyTupleExpression);
|
||||
|
||||
if (arguments.length == 0 || Arrays.stream(arguments).anyMatch(nonParenthesesPredicate)) {
|
||||
if (arguments.length == 0 || ContainerUtil.exists(arguments, nonParenthesesPredicate)) {
|
||||
registerForAllMatchingVersions(level -> level.isPy3K() && registerForLanguageLevel(level),
|
||||
PyPsiBundle.message("INSP.compatibility.feature.support.print.statement"),
|
||||
node,
|
||||
|
||||
Reference in New Issue
Block a user