Refactoring: "introduce when subject" is now an inspection

This commit is contained in:
Mikhail Glukhikh
2017-12-19 16:58:04 +03:00
parent a8b01a6b00
commit 6d4b5bc48f
29 changed files with 136 additions and 151 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.branchedTransformations.IntroduceWhenSubjectInspection
@@ -1,4 +1,4 @@
//IS_APPLICABLE: false
// PROBLEM: none
fun test(n: Int): String {
return <caret>when {
n in 0..10 -> "small"
@@ -1,4 +1,4 @@
//IS_APPLICABLE: false
// PROBLEM: none
fun test(n: Int): String {
return <caret>when(n) {
in 0..10 -> "small"
@@ -1,4 +1,4 @@
//IS_APPLICABLE: false
// PROBLEM: none
fun test(n: Int): String {
return <caret>when {
n in 0..10 -> "n is small"
@@ -1 +0,0 @@
org.jetbrains.kotlin.idea.intentions.branchedTransformations.intentions.IntroduceWhenSubjectIntention