Convert ReplaceSubstringIntention to ReplaceSubstringInspection
Relates to #KT-31502
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.substring.ReplaceSubstringWithDropLastInspection
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A(val x: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
a.x.substring<caret>(0, a.x.length - 5)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A(val x: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
a.x.dropLast(5)
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// PROBLEM: none
|
||||
|
||||
class A() {
|
||||
fun bar(): String = null!!
|
||||
}
|
||||
|
||||
fun foo(a: A) {
|
||||
a.bar().substring<caret>(0, a.bar().length - 5)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substring<caret>(3, s.length - 5)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substring<caret>(0, s.length - 5)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.dropLast(5)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.substring<caret>(0, s.length - 5);
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(s: String) {
|
||||
s.dropLast(5);
|
||||
}
|
||||
Reference in New Issue
Block a user