boolean (PsiVariable variable) { if (!HighlightingFeature.UNNAMED_PATTERNS_AND_VARIABLES.isAvailable(variable)) return false; if (variable instanceof PsiPatternVariable || variable instanceof PsiResourceVariable) return true; if (variable instanceof PsiLocalVariable) { return variable.getParent() instanceof PsiDeclarationStatement decl && decl.getParent() instanceof PsiCodeBlock; } if (variable instanceof PsiParameter parameter) { return !(parameter.getDeclarationScope() instanceof PsiMethod); } return false; }