KT-18715: don't swallow comments for if->elvis
Adds a CommentSaver to the IfThenToElvis intention that will save and restore comments when converting an if expression to elvis expression.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
05c25342ad
commit
a71bb70901
@@ -0,0 +1,6 @@
|
||||
fun foo(arg: Any): Int {
|
||||
// 1
|
||||
return <caret>if (arg is Int) arg
|
||||
// 2
|
||||
else 10
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun foo(arg: Any): Int {
|
||||
// 1
|
||||
return arg as? Int
|
||||
// 2
|
||||
?: 10
|
||||
}
|
||||
Reference in New Issue
Block a user