List<PsiExpressionStatement> (@NotNull PsiLocalVariable var) { PsiElement block = PsiUtil.getVariableCodeBlock(var, null); if (block == null) return List.of(); List<PsiReferenceExpression> references = VariableAccessUtils.getVariableReferences(var, block); List<PsiExpressionStatement> initializers = new ArrayList<>(); for (PsiReferenceExpression reference : references) { if (!PsiUtil.isAccessedForWriting(reference)) continue; if (!(reference.getParent() instanceof PsiAssignmentExpression assign) || assign.getOperationTokenType() != JavaTokenType.EQ) { return List.of(); } if (!(assign.getParent() instanceof PsiExpressionStatement statement)) return List.of(); initializers.add(statement); } return initializers; }