Use CommentSaver instead of manual comment handling

This commit is contained in:
Valentin Kipyatkov
2016-04-18 19:49:43 +03:00
parent e72e6bf7db
commit bf4a376831
4 changed files with 16 additions and 28 deletions
@@ -1,4 +1,5 @@
fun foo(p: List<String?>): Int {
val v = p[0] ?: <caret>return -1 // return -1 if null
val v = p[0] ?: // return -1 if null
<caret>return -1
return v.length
}
+1 -1
View File
@@ -1,5 +1,5 @@
fun foo(p: List<String?>): Int {
val v = p[0] ?: <caret>return -1 /* null */
val v = p[0] ?: /* null */<caret>return -1
// now check if v is null
// return -1
return v.length
+2 -2
View File
@@ -1,7 +1,7 @@
fun foo(p: List<String?>): Int {
val v = p[0] ?: return -1 // v is null
val v = p[0] ?: // v is null
// we should do something with it
// let's return -1
return -1 // let's return -1
// end of if
return v.length
}