Add Merge ifs intention (#975)

Fixes #KT-9912
This commit is contained in:
Kirill Rakhman
2017-01-27 14:20:11 +01:00
committed by Dmitry Jemerov
parent 456037a30d
commit 956094e062
16 changed files with 179 additions and 10 deletions
+1
View File
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.MergeIfsIntention
+9
View File
@@ -0,0 +1,9 @@
fun foo() {
// comment 1
<caret>if (/* comment 2 */ true /* comment 3 */) {
if (false) {
// comment 4
foo()
}
}
}
+7
View File
@@ -0,0 +1,7 @@
fun foo() {
// comment 1
<caret>if (/* comment 2 */ true && false /* comment 3 */) {
// comment 4
foo()
}
}
+10
View File
@@ -0,0 +1,10 @@
// IS_APPLICABLE: false
fun foo() {
<caret>if (true) {
if (false) {
foo()
}
} else {
}
}
+11
View File
@@ -0,0 +1,11 @@
// IS_APPLICABLE: false
fun foo() {
<caret>if (true) {
if (false) {
foo()
} else {
}
}
}
+5
View File
@@ -0,0 +1,5 @@
fun foo() {
<caret>if (true) if (false) {
foo()
}
}
+5
View File
@@ -0,0 +1,5 @@
fun foo() {
<caret>if (true && false) {
foo()
}
}
+7
View File
@@ -0,0 +1,7 @@
fun foo() {
<caret>if (true) {
if (false) {
foo()
}
}
}
+5
View File
@@ -0,0 +1,5 @@
fun foo() {
<caret>if (true && false) {
foo()
}
}