void (PsiPattern pattern, boolean ignoreClarifyingParentheses) { if (pattern instanceof PsiParenthesizedPattern parenthesizedPattern) { final PsiPattern innerPattern = parenthesizedPattern.getPattern(); if (innerPattern == null) { return; } CommentTracker commentTracker = new CommentTracker(); commentTracker.markUnchanged(innerPattern); PsiPattern newPattern = (PsiPattern)commentTracker.replaceAndRestoreComments(parenthesizedPattern, innerPattern); removeParentheses(newPattern, ignoreClarifyingParentheses); } else if (pattern instanceof PsiDeconstructionPattern deconstructionPattern) { final PsiPattern[] components = deconstructionPattern.getDeconstructionList().getDeconstructionComponents(); for (PsiPattern component : components) { removeParentheses(component, ignoreClarifyingParentheses); } } }