Implement if/else/null/notnull/when/try postfix templates
#KT-4710 In Progress
This commit is contained in:
committed by
Nikolay Krasko
parent
09266b222b
commit
4d28199cc2
@@ -0,0 +1,5 @@
|
||||
fun foo(x: Boolean) {
|
||||
if (!x) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Boolean) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Checks boolean expression to be false.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(x: Boolean) {
|
||||
if (x) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Boolean) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Checks boolean expression to be true.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(x: Any?) {
|
||||
if (x == null) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Any?) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Checks expression to be null.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(x: Any?) {
|
||||
if (x != null) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Any?) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Checks expression to be not null.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(x: Any?) {
|
||||
try {
|
||||
x
|
||||
} catch (e: Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: Any?) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Surrounds expression with try-catch block.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
fun foo(x: String) {
|
||||
when (x) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun foo(x: String) {
|
||||
<spot>x</spot>$key
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
Wrap expression with 'when' statement
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user