Minor. Reformatted.
This commit is contained in:
+32
-28
@@ -124,38 +124,42 @@ public class KotlinInlineLocalHandler extends InlineActionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<JetExpression> inlinedExpressions = Lists.newArrayList();
|
final List<JetExpression> inlinedExpressions = Lists.newArrayList();
|
||||||
CommandProcessor.getInstance().executeCommand(project, new Runnable() {
|
CommandProcessor.getInstance().executeCommand(
|
||||||
@Override
|
project,
|
||||||
public void run() {
|
new Runnable() {
|
||||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (PsiReference reference : references) {
|
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||||
PsiElement referenceElement = reference.getElement();
|
@Override
|
||||||
if (assignments.contains(referenceElement.getParent())) {
|
public void run() {
|
||||||
continue;
|
for (PsiReference reference : references) {
|
||||||
|
PsiElement referenceElement = reference.getElement();
|
||||||
|
if (assignments.contains(referenceElement.getParent())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlinedExpressions.add(replaceExpression(referenceElement, initializer));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PsiElement assignment : assignments) {
|
||||||
|
assignment.delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
val.delete();
|
||||||
|
|
||||||
|
if (typeArgumentsForCall != null) {
|
||||||
|
addTypeArguments(typeArgumentsForCall, inlinedExpressions);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parametersForFunctionLiteral != null) {
|
||||||
|
addFunctionLiteralParameterTypes(parametersForFunctionLiteral, inlinedExpressions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
inlinedExpressions.add(replaceExpression(referenceElement, initializer));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PsiElement assignment : assignments) {
|
|
||||||
assignment.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
val.delete();
|
|
||||||
|
|
||||||
if (typeArgumentsForCall != null) {
|
|
||||||
addTypeArguments(typeArgumentsForCall, inlinedExpressions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parametersForFunctionLiteral != null) {
|
|
||||||
addFunctionLiteralParameterTypes(parametersForFunctionLiteral, inlinedExpressions);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
}
|
RefactoringBundle.message("inline.command", name),
|
||||||
}, RefactoringBundle.message("inline.command", name), null);
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean showDialog(Project project, String name, Collection<PsiReference> references) {
|
private static boolean showDialog(Project project, String name, Collection<PsiReference> references) {
|
||||||
|
|||||||
Reference in New Issue
Block a user