Introduce Refactorings: Implement trimming renderer for expression
chooser. Do not suggest parenthesized expressions #KT-9028 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
fun foo() {
|
||||
(<caret>1 + // abc
|
||||
2 /*def*/) * 3
|
||||
}
|
||||
|
||||
/*
|
||||
1
|
||||
1 + 2
|
||||
(1 + 2) * 3
|
||||
*/
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
interface T {
|
||||
fun foo(a: () -> Any): T = this
|
||||
}
|
||||
|
||||
fun foo(t: T) {
|
||||
t.foo { <caret>1 }
|
||||
.foo {2}
|
||||
.foo({ 3 })
|
||||
}
|
||||
|
||||
/*
|
||||
1
|
||||
{ 1 }
|
||||
t.foo{...}
|
||||
t.foo{...}.foo{...}
|
||||
t.foo{...}.foo{...}.foo(...)
|
||||
*/
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
interface T {
|
||||
fun foo(vararg a: Any): T = this
|
||||
}
|
||||
|
||||
fun foo(t: T) {
|
||||
t.foo(
|
||||
1 + 2,
|
||||
<caret>2, 3
|
||||
).foo()
|
||||
.foo(4)
|
||||
}
|
||||
|
||||
/*
|
||||
2
|
||||
t.foo(...)
|
||||
t.foo(...).foo()
|
||||
t.foo(...).foo().foo(...)
|
||||
*/
|
||||
@@ -0,0 +1,13 @@
|
||||
fun foo() {
|
||||
(<caret>1
|
||||
+ 2 -
|
||||
3)*(-
|
||||
4)
|
||||
}
|
||||
|
||||
/*
|
||||
1
|
||||
1 + 2
|
||||
1 + 2 - 3
|
||||
(1 + 2 - 3) * (-4)
|
||||
*/
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
interface T {
|
||||
fun foo(t: T) = t
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
object : T {
|
||||
val x = 1
|
||||
}.foo(<caret>object : T {
|
||||
val x = 2
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
object : T {...}
|
||||
object : T {...}.foo(...)
|
||||
*/
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun foo() {
|
||||
val t = ((<caret>1 + 2) + 3) * 4
|
||||
}
|
||||
|
||||
/*
|
||||
1
|
||||
1 + 2
|
||||
(1 + 2) + 3
|
||||
((1 + 2) + 3) * 4
|
||||
*/
|
||||
+2
-2
@@ -4,6 +4,6 @@ fun main(args: Array<String>) {
|
||||
/*
|
||||
1.0
|
||||
1.0 + 1
|
||||
Math.pow(1.0 + 1, Math.abs(-42.0))
|
||||
print(Math.pow(1.0 + 1, Math.abs(-42.0)))
|
||||
Math.pow(...)
|
||||
print(...)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user