void (UsageInfo[] usages, GrIntroduceParameterSettings settings) { final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(settings.getProject()); // Replacing expression occurrences for (UsageInfo usage : usages) { if (usage instanceof ChangedMethodCallInfo) { PsiElement element = usage.getElement(); processChangedMethodCall(element, settings); } else if (usage instanceof InternalUsageInfo) { PsiElement element = usage.getElement(); if (element == null) continue; GrExpression newExpr = factory.createExpressionFromText(settings.getName()); if (element instanceof GrExpression) { ((GrExpression)element).replaceWithExpression(newExpr, true); } else { element.replace(newExpr); } } } final StringPartInfo info = settings.getStringPartInfo(); if (info != null) { final GrExpression expr = info.replaceLiteralWithConcatenation(settings.getName()); final Editor editor = PsiEditorUtil.findEditor(expr); if (editor != null) { editor.getSelectionModel().removeSelection(); editor.getCaretModel().moveToOffset(expr.getTextRange().getEndOffset()); } } }