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:
Felix Guo
2019-01-15 15:13:37 -05:00
committed by Mikhail Glukhikh
parent 05c25342ad
commit a71bb70901
4 changed files with 25 additions and 1 deletions
@@ -0,0 +1,6 @@
fun foo(arg: Any): Int {
// 1
return <caret>if (arg is Int) arg
// 2
else 10
}
@@ -0,0 +1,6 @@
fun foo(arg: Any): Int {
// 1
return arg as? Int
// 2
?: 10
}