Initial implementation of loop-to-call-chain intention
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fun foo(list: List<String>): String? {
|
||||
<spot>return list.firstOrNull { s -> s.length > 0 }</spot>
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo(list: List<String>): String? {
|
||||
<spot>for (s in list) {
|
||||
if (s.length > 0) {
|
||||
return s
|
||||
}
|
||||
}
|
||||
return null</spot>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention converts a for-loop into a sequence of stdlib-operations (like "map", "filter" etc)
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user