Fix intention descriptions and templates
This commit is contained in:
+6
-10
@@ -1,11 +1,7 @@
|
||||
public class MyClass {
|
||||
public fun f(a: Int): String {
|
||||
var res: String
|
||||
|
||||
res = if (a == 1) "one";
|
||||
else if (a == 2) "two";
|
||||
else "too many";
|
||||
|
||||
return res;
|
||||
}
|
||||
res = if (n == 1) {
|
||||
println("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
"two"
|
||||
}
|
||||
+6
-10
@@ -1,11 +1,7 @@
|
||||
public class MyClass {
|
||||
public fun f(a: Int): String {
|
||||
var res: String
|
||||
|
||||
if (a == 1) res = "one";
|
||||
else if (a == 2) res = "two";
|
||||
else res = "too many";
|
||||
|
||||
return res;
|
||||
}
|
||||
if (n == 1) {
|
||||
println("***")
|
||||
res = "one"
|
||||
} else {
|
||||
println("***")
|
||||
res = "two"
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention converts 'if' statement where each branch is terminated with assignment to the same variable
|
||||
into single assignment with 'if' expression
|
||||
This intention converts branched (if/when) expression where each branch is terminated with assignment/return/method call into single
|
||||
assignment/return/method call with branched expression as argument
|
||||
</body>
|
||||
</html>
|
||||
+6
-10
@@ -1,11 +1,7 @@
|
||||
public class MyClass {
|
||||
public fun f(a: Int): String {
|
||||
var res: String
|
||||
|
||||
if (a == 1) res = "one";
|
||||
else if (a == 2) res = "two";
|
||||
else res = "too many";
|
||||
|
||||
return res;
|
||||
}
|
||||
if (n == 1) {
|
||||
println("***")
|
||||
res = "one"
|
||||
} else {
|
||||
println("***")
|
||||
res = "two"
|
||||
}
|
||||
+6
-10
@@ -1,11 +1,7 @@
|
||||
public class MyClass {
|
||||
public fun f(a: Int): String {
|
||||
var res: String
|
||||
|
||||
res = if (a == 1) "one";
|
||||
else if (a == 2) "two";
|
||||
else "too many";
|
||||
|
||||
return res;
|
||||
}
|
||||
res = if (n == 1) {
|
||||
println("***")
|
||||
"one"
|
||||
} else {
|
||||
println("***")
|
||||
"two"
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
This intention converts assignment with 'if' expression as right-hand side
|
||||
into 'if' statement where each branch is terminated with assignment to the original variable
|
||||
This intention converts assignment/return/method call with branched (if/when) expression as argument
|
||||
to branched expression where each branch is terminated with assignment/return/method call
|
||||
</body>
|
||||
</html>
|
||||
-2
@@ -21,13 +21,11 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetElement;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetIfExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.plugin.JetBundle;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user