Introduce "Add remaining when branches" intention #KT-23306 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-05-11 06:57:25 +03:00
committed by Mikhail Glukhikh
parent bde9a57c9e
commit 2c59f96ca4
17 changed files with 212 additions and 41 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.AddWhenRemainingBranchesIntention
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
enum class Entry {
FOO, BAR, BAZ
}
fun test(e: Entry) {
<caret>when (e) {
Entry.FOO -> {}
}
}
@@ -0,0 +1,13 @@
// IS_APPLICABLE: false
enum class Entry {
FOO, BAR, BAZ
}
fun test(e: Entry) {
<caret>when (e) {
Entry.FOO -> {}
Entry.BAR -> {}
Entry.BAZ -> {}
}
}
@@ -0,0 +1,12 @@
// WITH_RUNTIME
enum class Entry {
FOO, BAR, BAZ
}
fun test(e: Entry) {
<caret>when (e) {
Entry.FOO -> {}
else -> {}
}
}
@@ -0,0 +1,14 @@
// WITH_RUNTIME
enum class Entry {
FOO, BAR, BAZ
}
fun test(e: Entry) {
<caret>when (e) {
Entry.FOO -> {}
Entry.BAR -> TODO()
Entry.BAZ -> TODO()
else -> {}
}
}