void (@NotNull PsiVariable var) { if (myEditor != null) { PsiElement[] occurrences = ContainerUtil.map2Array(ReferencesSearch.search(var, new LocalSearchScope(myContainingFile)).findAll(), PsiElement.class, ref -> ref.getElement()); IntroduceVariableBase.highlightReplacedOccurrences(myProject, myEditor, occurrences); } }