KT-5927 Join Lines could merge nested if's

#KT-5927 Fixed
This commit is contained in:
Valentin Kipyatkov
2014-12-16 14:28:56 +01:00
parent bc631d7aee
commit 3db51cfcd8
11 changed files with 91 additions and 7 deletions
@@ -300,12 +300,11 @@ public class JetPsiFactory(private val project: Project) {
return createExpression("$" + fieldName)
}
public fun createBinaryExpression(lhs: String, op: String, rhs: String): JetBinaryExpression {
return createExpression(lhs + " " + op + " " + rhs) as JetBinaryExpression
}
public fun createBinaryExpression(lhs: JetExpression?, op: String, rhs: JetExpression?): JetBinaryExpression {
return createBinaryExpression(JetPsiUtil.getText(lhs), op, JetPsiUtil.getText(rhs))
public fun createBinaryExpression(lhs: JetExpression, op: String, rhs: JetExpression): JetBinaryExpression {
val expression = createExpression("a $op b") as JetBinaryExpression
expression.getLeft().replace(lhs)
expression.getRight().replace(rhs)
return expression
}
public fun createTypeCodeFragment(text: String, context: PsiElement?): JetTypeCodeFragment {