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