KT-17970 Intention actions to format parameter/argument list placing each on separate line

#KT-17970 Fixed
This commit is contained in:
Valentin Kipyatkov
2017-04-04 17:10:54 +03:00
parent 47fec6c9d5
commit 92a763552c
28 changed files with 293 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ChopArgumentListIntention
@@ -0,0 +1,5 @@
fun f() {
foo(<caret>1, "a", 2)
}
fun foo(p1: Int, p2: String, p3: Int){}
@@ -0,0 +1,9 @@
fun f() {
foo(
1,
"a",
2
)
}
fun foo(p1: Int, p2: String, p3: Int){}
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ChopParameterListIntention
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo(
<caret>c: Char,
b: Boolean
) {
}
@@ -0,0 +1,3 @@
fun foo(p: Int, c: Char,
b: <caret>Boolean) {
}
@@ -0,0 +1,6 @@
fun foo(
p: Int,
c: Char,
b: <caret>Boolean
) {
}
@@ -0,0 +1,4 @@
fun foo(
p: Int, c: Char, b: <caret>Boolean
) {
}
@@ -0,0 +1,6 @@
fun foo(
p: Int,
c: Char,
b: <caret>Boolean
) {
}
@@ -0,0 +1,4 @@
// IS_APPLICABLE: false
fun foo(<caret>c: Char) {
}
@@ -0,0 +1,2 @@
fun foo(p: Int, c: Char, b: <caret>Boolean) {
}
@@ -0,0 +1,6 @@
fun foo(
p: Int,
c: Char,
b: <caret>Boolean
) {
}
@@ -0,0 +1,2 @@
fun foo(p: Int, <caret>c: Char) {
}
@@ -0,0 +1,5 @@
fun foo(
p: Int,
<caret> c: Char
) {
}
@@ -3,6 +3,7 @@
// ACTION: Add parameter to constructor 'Foo'
// ACTION: Create secondary constructor
// ERROR: Too many arguments for public constructor Foo(a: Int) defined in Foo
// ACTION: Put arguments on separate lines
// ACTION: To raw string literal
class Foo(a: Int)
@@ -3,6 +3,7 @@
// ACTION: Make internal
// ACTION: Make private
// ACTION: Rename reference
// ACTION: Put arguments on separate lines
// ACTION: Convert to expression body
// ERROR: Unresolved reference: foo
// ERROR: Unresolved reference: bar
@@ -3,6 +3,7 @@
// ACTION: Convert parameter to receiver
// ACTION: Rename to _
// ACTION: Specify return type explicitly
// ACTION: Put parameters on separate lines
fun foo(block: (String, Int) -> Unit) {
block("", 1)
@@ -4,6 +4,7 @@
// ACTION: Create function 'join'
// ACTION: Flip ','
// ACTION: Introduce local variable
// ACTION: Put arguments on separate lines
//this test checks that there is no ArrayIndexOutOfBoundsException when there are more arguments than parameters
fun <T> array1(vararg a : T) = a