GrVariable (@NotNull GrVariableDeclaration declaration) { resolveLocalConflicts(myContext.getScope(), mySettings.getName()); preprocessOccurrences(); int expressionIndex = ArrayUtilRt.find(myOccurrences, myExpression); final PsiElement[] replaced = myProcessUsages ? processOccurrences() : myOccurrences; PsiElement replacedExpression = replaced[expressionIndex]; GrStatement anchor = GrIntroduceHandlerBase.getAnchor(replaced, myContext.getScope()); RefactoringUtil.highlightAllOccurrences(myContext.getProject(), replaced, myContext.getEditor()); return insertVariableDefinition(declaration, anchor, replacedExpression); }