Merge else-if intention (KT-34218)

#KT-34218 Fixed
This commit is contained in:
DmiitriiJarosh
2019-10-05 20:58:31 +03:00
committed by Nikolay Krasko
parent 383239aff6
commit 613fbf7a5d
15 changed files with 172 additions and 0 deletions
@@ -1479,6 +1479,11 @@
<category>Kotlin</category>
</intentionAction>
<intentionAction>
<className>org.jetbrains.kotlin.idea.intentions.MergeElseIfIntention</className>
<category>Kotlin</category>
</intentionAction>
<intentionAction>
<className>org.jetbrains.kotlin.idea.intentions.AddMissingDestructuringIntention</className>
<category>Kotlin</category>
@@ -0,0 +1,5 @@
if (a) {
println("a")
} else if (b) {
println("not a and b")
}
@@ -0,0 +1,7 @@
if (a) {
println("a")
} else {
if (b) {
println("not a and b")
}
}
@@ -0,0 +1,5 @@
<html>
<body>
This intention merges else and nested <b>if</b> statement without <b>else</b> branches into a single <b>else if</b>.
</body>
</html>