Java: Support more variants with switch expressions in '.switch' template (IDEA-204010)

This commit is contained in:
Pavel Dolgov
2019-02-07 18:20:56 +03:00
parent dcb9d4a5c3
commit 729f8b1328
10 changed files with 76 additions and 1 deletions
@@ -0,0 +1,5 @@
public class Foo {
void f(char x) {
System.out.println(x.switch<caret>);
}
}
@@ -0,0 +1,7 @@
public class Foo {
void f(char x) {
System.out.println(switch (x) {
<caret>
});
}
}
@@ -0,0 +1,5 @@
public class Foo {
String f(char x) {
return x.switch<caret>
}
}
@@ -0,0 +1,7 @@
public class Foo {
String f(char x) {
return switch (x) {
<caret>
}
}
}
@@ -0,0 +1,5 @@
public class Foo {
void f(short x) {
System.out.println(1 + x.switch<caret>);
}
}
@@ -0,0 +1,7 @@
public class Foo {
void f(short x) {
System.out.println(switch (1 + x) {
<caret>
});
}
}
@@ -0,0 +1,5 @@
public class Foo {
String f(short x) {
return 1 + x.switch<caret>
}
}
@@ -0,0 +1,7 @@
public class Foo {
String f(short x) {
return switch (1 + x) {
<caret>
}
}
}