Introduce Parameter/Lambda Parameter: Parenthesize binary expressions if operation reference starts with a new line

This commit is contained in:
Alexey Sedunov
2015-12-10 14:22:10 +03:00
parent 354e1dc337
commit ae2fc19fe5
22 changed files with 187 additions and 18 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(i: () -> Int = {
(1
+ 2)
}) {
foo(i())
}
@@ -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(i: () -> Int = {
(1 // abc
/*def*/ + 2)
}) {
foo(i())
}
@@ -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(i: () -> Int = {
(1
+ 2 - 3)
}) {
foo(i())
}
@@ -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(i: () -> Int = {
(1 + 2
- 3)
}) {
foo(i())
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1
+ 2</selection>)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test(i: Int = (1
+ 2)) {
foo(i)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1 // abc
/*def*/ + 2</selection>)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test(i: Int = (1 // abc
/*def*/ + 2)) {
foo(i)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1
+ 2 - 3</selection>)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test(i: Int = (1
+ 2 - 3)) {
foo(i)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test() {
foo(<selection>1 + 2
- 3</selection>)
}
@@ -0,0 +1,6 @@
fun foo(i: Int) { }
fun test(i: Int = (1 + 2
- 3)) {
foo(i)
}