void (@NotNull Project project, @NotNull PsiElement nameElement, @NotNull ModPsiUpdater updater) { final PsiLocalVariable variable = (PsiLocalVariable)nameElement.getParent(); final PsiExpression initializer = variable.getInitializer(); if (initializer == null) { return; } final Collection<PsiReference> references = ReferencesSearch.search(variable).findAll(); final Collection<PsiElement> replacedElements = new ArrayList<>(); for (PsiReference reference : references) { var inlineUtil = CommonJavaInlineUtil.getInstance(); final PsiExpression expression = inlineUtil.inlineVariable(variable, initializer, (PsiJavaCodeReferenceElement)reference, null); replacedElements.add(expression); } for (PsiElement element : replacedElements) { updater.highlight(element); } variable.delete(); }