Remove Right Part of Binary Expression Quick-Fix: Split to separate quick fixes for cast- and elvis-expressions

This commit is contained in:
Alexey Sedunov
2016-01-13 14:06:33 +03:00
parent 6be44f59da
commit 2e18ad7160
16 changed files with 108 additions and 81 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun foo(a: String) {
val b = a <caret>as String
}
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun foo(a: String) {
val b = a
}
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun test(x: Any): Int {
if (x is String) {
return (x <caret>as String).length
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun test(x: Any): Int {
if (x is String) {
return x.length
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun test(x: Any): String? {
if (x is String) {
return x <caret>as String
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun test(x: Any): String? {
if (x is String) {
return x
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun foo(a: Any) {
val b = a <caret>as Any
}
@@ -1,4 +1,4 @@
// "Remove cast" "true"
// "Remove useless cast" "true"
fun foo(a: Any) {
val b = a<caret>
}
+1 -1
View File
@@ -1,4 +1,4 @@
// "Remove elvis operator" "true"
// "Remove useless elvis operator" "true"
fun foo(a: String) {
val b : String = a <caret>?: "s"
}
+1 -1
View File
@@ -1,4 +1,4 @@
// "Remove elvis operator" "true"
// "Remove useless elvis operator" "true"
fun foo(a: String) {
val b : String = a<caret>
}