void (PsiSwitchBlock block) { PsiExpression expression = myAssignment.getLExpression(); if (!(expression instanceof PsiReferenceExpression)) return; CommentTracker ct = new CommentTracker(); String sign = myAssignment.getOperationSign().getText(); PsiSwitchStatement switchStatement = new VarSavingSwitchGenerator(block, expression.getText(), sign).generate(ct); ct.replaceAndRestoreComments(myAssignment.getParent(), switchStatement); }