void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { if (!(element instanceof PsiInstanceOfExpression expression)) { return; } PsiPrimaryPattern pattern = expression.getPattern(); if (!(pattern instanceof PsiTypeTestPattern typeTestPattern)) { return; } PsiPatternVariable variable = typeTestPattern.getPatternVariable(); if (variable == null) { return; } List<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(variable, variable.getDeclarationScope()); processReferences(references, variable, expression); deletePatternFromInstanceOf(expression); }