Extract Function: Parenthesize binary expressions if operation reference starts with a new line

This commit is contained in:
Alexey Sedunov
2015-12-10 14:28:37 +03:00
parent 1824f10f07
commit 354e1dc337
11 changed files with 105 additions and 6 deletions
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1
+ 2</selection>)
}
@@ -0,0 +1,8 @@
fun foo(i: Int) { }
fun test() {
foo(i())
}
private fun i() = (1
+ 2)
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1 // abc
/*def*/ + 2</selection>)
}
@@ -0,0 +1,8 @@
fun foo(i: Int) { }
fun test() {
foo(i())
}
private fun i() = (1 // abc
/*def*/ + 2)
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1
+ 2 - 3</selection>)
}
@@ -0,0 +1,8 @@
fun foo(i: Int) { }
fun test() {
foo(i())
}
private fun i() = (1
+ 2 - 3)
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1 + 2
- 3</selection>)
}
@@ -0,0 +1,8 @@
fun foo(i: Int) { }
fun test() {
foo(i())
}
private fun i() = (1 + 2
- 3)