Add Intention to replace a..b-1 with a until b and vice versa #KT-13483 Fixed

This commit is contained in:
Kirill Rakhman
2016-08-17 21:13:10 +02:00
committed by Mikhail Glukhikh
parent d9358d44e7
commit 354d047533
23 changed files with 261 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ReplaceRangeToWithUntilIntention
@@ -0,0 +1,6 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(a: Float) {
1f..a - 1
}
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(a: Int) {
for (i in 0..a - 2<caret>) {
}
}
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(a: Int) {
for (i in 0..a<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0..a - 1<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0 until a<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Long) {
for (i in 1L..a - 1L<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Long) {
for (i in 1L until a<caret>) {
}
}
@@ -0,0 +1,8 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(a: Int) {
for (i in 0..a + 1<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0.rangeTo(a - 1)<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0 until a<caret>) {
}
}
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ReplaceUntilWithRangeToIntention
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0 until a<caret>) {
}
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo(a: Int) {
for (i in 0..a - 1<caret>) {
}
}