mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[java] IDEA-345498 Remove explicit Java 20-preview support and parenthesized patterns
GitOrigin-RevId: 8d646035979e3ec0a7de3c6f58a4e6ec9967bdbd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c56dbec5f8
commit
d0cf7b359a
@@ -965,7 +965,7 @@ public final class JavaStructuralSearchProfile extends StructuralSearchProfile {
|
||||
|
||||
final PsiElement grandParent = parent.getParent();
|
||||
if (parent instanceof PsiPatternVariable && grandParent instanceof PsiTypeTestPattern) {
|
||||
return !(grandParent.getParent() instanceof PsiParenthesizedPattern);
|
||||
return true;
|
||||
}
|
||||
if (grandParent instanceof PsiReferenceList) return true;
|
||||
if (grandParent instanceof PsiPolyadicExpression) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.intellij.psi.impl.light.LightElement;
|
||||
import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import com.intellij.psi.javadoc.PsiDocTag;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.JavaPsiPatternUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.structuralsearch.MatchOptions;
|
||||
@@ -1579,7 +1578,6 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
final PsiPattern pattern = expression.getPattern();
|
||||
PsiPattern otherPattern = other.getPattern();
|
||||
if (pattern instanceof PsiTypeTestPattern typeTestPattern) {
|
||||
otherPattern = skipParenthesesDown(otherPattern);
|
||||
if (otherPattern instanceof PsiTypeTestPattern otherVariable) {
|
||||
myMatchingVisitor.setResult(
|
||||
myMatchingVisitor.matchOptionally(typeTestPattern.getPatternVariable(), otherVariable.getPatternVariable()));
|
||||
@@ -1593,19 +1591,6 @@ public class JavaMatchingVisitor extends JavaElementVisitor {
|
||||
}
|
||||
}
|
||||
|
||||
private PsiPattern skipParenthesesDown(PsiPattern pattern) {
|
||||
if (!myMatchingVisitor.getMatchContext().getOptions().isLooseMatching()) {
|
||||
return pattern;
|
||||
}
|
||||
return JavaPsiPatternUtil.skipParenthesizedPatternDown(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitParenthesizedPattern(@NotNull PsiParenthesizedPattern pattern) {
|
||||
final PsiParenthesizedPattern other = myMatchingVisitor.getElement(PsiParenthesizedPattern.class);
|
||||
myMatchingVisitor.setResult(other != null && myMatchingVisitor.match(pattern.getPattern(), other.getPattern()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitTypeTestPattern(@NotNull PsiTypeTestPattern pattern) {
|
||||
final PsiTypeTestPattern other = myMatchingVisitor.getElement(PsiTypeTestPattern.class);
|
||||
|
||||
Reference in New Issue
Block a user