mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[live-templates] else-if: add CONDITION variable
GitOrigin-RevId: 00e4800c96682bded8589a54efade59572f73d2b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f70f46661f
commit
5af152b20c
@@ -2,7 +2,8 @@ import java.util.*;
|
||||
|
||||
class Foo {
|
||||
void test(int x){
|
||||
if(x > 0) {} else if (<caret>) {
|
||||
if(x > 0) {} else if () {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,8 @@ import java.util.*;
|
||||
|
||||
class Foo {
|
||||
void test(int x){
|
||||
if(x > 0) {} else if (<caret>) {
|
||||
if(x > 0) {} else if () {
|
||||
<caret>
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,8 @@ import java.util.*;
|
||||
class Foo {
|
||||
void test(int x){
|
||||
if(x > 0) {}
|
||||
else if(x == 0) {} else if (<caret>) {
|
||||
else if(x == 0) {} else if () {
|
||||
<caret>
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
+3
@@ -161,18 +161,21 @@ class Outer {
|
||||
void testElseIf() throws Throwable {
|
||||
configure()
|
||||
startTemplate("else-if", "Java")
|
||||
WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) }
|
||||
checkResult()
|
||||
}
|
||||
|
||||
void testElseIf2() throws Throwable {
|
||||
configure()
|
||||
startTemplate("else-if", "Java")
|
||||
WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) }
|
||||
checkResult()
|
||||
}
|
||||
|
||||
void testElseIf3() throws Throwable {
|
||||
configure()
|
||||
startTemplate("else-if", "Java")
|
||||
WriteCommandAction.runWriteCommandAction(project) { state.gotoEnd(false) }
|
||||
checkResult()
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<option name="JAVA_STATEMENT" value="true" />
|
||||
</context>
|
||||
</template>
|
||||
<template name="else-if" value="else if($END$){} " description="Add else-if branch" toReformat="true" toShortenFQNames="false">
|
||||
<template name="else-if" value="else if($CONDITION$){ $END$ } " description="Add else-if branch" toReformat="true" toShortenFQNames="false">
|
||||
<variable name="CONDITION" expression="" defaultValue="" alwaysStopAt="true" />
|
||||
<context>
|
||||
<option name="JAVA_ELSE_PLACE" value="true" />
|
||||
</context>
|
||||
|
||||
Reference in New Issue
Block a user