Introduce "add parameter names to following arguments"
This commit also refactors relevant intentions & inspections, like "add name to argument", "add names to call arguments", "unnamed boolean literal argument" #KT-30622 Fixed
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
// HIGHLIGHT: GENERIC_ERROR_OR_WARNING
|
||||
// FIX: Add names to boolean arguments
|
||||
// FIX: Add names to call arguments
|
||||
fun foo(a: Boolean, b: Boolean, c: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
foo(true, true, true<caret>)
|
||||
foo(true<caret>, true, true)
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// HIGHLIGHT: GENERIC_ERROR_OR_WARNING
|
||||
// FIX: Add names to boolean arguments
|
||||
// FIX: Add names to call arguments
|
||||
fun foo(a: Boolean, b: Boolean, c: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// HIGHLIGHT: GENERIC_ERROR_OR_WARNING
|
||||
// FIX: Add names to boolean arguments
|
||||
// FIX: Add names to call arguments
|
||||
fun foo(a: Boolean, b: Boolean, c: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
foo(true, <caret>true, c = true)
|
||||
foo(<caret>true, true, c = true)
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// HIGHLIGHT: GENERIC_ERROR_OR_WARNING
|
||||
// FIX: Add names to boolean arguments
|
||||
// FIX: Add names to call arguments
|
||||
fun foo(a: Boolean, b: Boolean, c: Boolean) {}
|
||||
|
||||
fun test() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun foo(s: String, b: Boolean){}
|
||||
|
||||
fun bar() {
|
||||
<caret>foo("", true)
|
||||
foo(<caret>"", true)
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fun foo(s: String, b: Boolean){}
|
||||
|
||||
fun bar() {
|
||||
<caret>foo(s = "", b = true)
|
||||
foo(<caret>s = "", b = true)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.AddNamesToFollowingArgumentsIntention
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo(first: Int, second: Boolean, last: String) {}
|
||||
|
||||
fun test() {
|
||||
foo(<caret>1, true, "")
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
fun foo(first: Int, second: Boolean, last: String) {}
|
||||
|
||||
fun test() {
|
||||
foo(1, true, <caret>"")
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(first: Int, second: Boolean, last: String) {}
|
||||
|
||||
fun test() {
|
||||
foo(1, <caret>true, "")
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(first: Int, second: Boolean, last: String) {}
|
||||
|
||||
fun test() {
|
||||
foo(1, second = true, last = "")
|
||||
}
|
||||
Reference in New Issue
Block a user