Add intention for replacing explicit function literal parameter with 'it'
Kotlin's function literals have a shortcut for one-argument literals:
the single argument doesn't need to be explicitly named, but can be
referred via the 'it' contextual keyword.
For example, 'array(1, 2, 3).filter { x -> x % 2 == 0 }'
-> 'array(1, 2, 3).filter { it % 2 == 0 }'
Add an intention action for this transformation.
This commit is contained in:
committed by
Nikolay Krasko
parent
1dd57b5f6e
commit
c6d6a32314
@@ -369,6 +369,7 @@ fun main(args: Array<String>) {
|
||||
model("intentions/insertCurlyBracestsToTemplate", testMethod = "doTestInsertCurlyToTemplate")
|
||||
model("intentions/moveLambdaInsideParentheses", testMethod = "doTestMoveLambdaInsideParentheses")
|
||||
model("intentions/moveLambdaOutsideParentheses", testMethod = "doTestMoveLambdaOutsideParentheses")
|
||||
model("intentions/replaceExplicitFunctionLiteralParamWithIt", testMethod = "doTestReplaceExplicitFunctionLiteralParamWithIt")
|
||||
}
|
||||
|
||||
testClass(javaClass<AbstractHierarchyTest>()) {
|
||||
|
||||
Reference in New Issue
Block a user