Added 'exfun', 'exval' and 'exvar' live templates.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templateSet group="Kotlin">
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.main"
|
||||
name="main" toReformat="true" toShortenFQNames="true" value="fun main(args : Array<String>) { $END$ }">
|
||||
name="main" toReformat="true" toShortenFQNames="true"
|
||||
value="fun main(args : Array<String>) { $END$ }">
|
||||
<context>
|
||||
<option name="KOTLIN_NAMESPACE" value="true" />
|
||||
</context>
|
||||
@@ -21,7 +22,8 @@
|
||||
</context>
|
||||
</template>
|
||||
<template resource-bundle="messages.CodeInsightBundle" key="livetemplate.description.soutv"
|
||||
name="soutv" toReformat="true" toShortenFQNames="true" value="println("$EXPR_COPY$ = $DOLLAR${$EXPR$}")">
|
||||
name="soutv" toReformat="true" toShortenFQNames="true"
|
||||
value="println("$EXPR_COPY$ = $DOLLAR${$EXPR$}")">
|
||||
<variable alwaysStopAt="false" defaultValue=""$"" expression="" name="DOLLAR" />
|
||||
<variable alwaysStopAt="true" defaultValue=""expr"" expression="kotlinVariableOfType("")" name="EXPR" />
|
||||
<variable alwaysStopAt="false" defaultValue="" expression="EXPR" name="EXPR_COPY" />
|
||||
@@ -31,7 +33,8 @@
|
||||
</template>
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.soutp"
|
||||
name="soutp" toReformat="true" toShortenFQNames="true" value="println($FORMAT$)">
|
||||
<variable alwaysStopAt="false" defaultValue="" expression="groovyScript("'\"' + _1.collect { it + ' = [${' + it + '}]'}.join(', ') + '\"'", functionParameters())" name="FORMAT" />
|
||||
<variable alwaysStopAt="false" defaultValue="" expression="groovyScript("'\"' + _1.collect { it + ' = [${' + it + '}]'}.join(', ') + '\"'", functionParameters())"
|
||||
name="FORMAT" />
|
||||
<context>
|
||||
<option name="KOTLIN_STATEMENT" value="true"/>
|
||||
</context>
|
||||
@@ -58,7 +61,8 @@
|
||||
</context>
|
||||
</template>
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.fun1"
|
||||
name="fun1" toReformat="true" toShortenFQNames="true" value="fun $NAME$($PARAM1$ : $PARAM1TYPE$) : $RETURN$ { $END$ }">
|
||||
name="fun1" toReformat="true" toShortenFQNames="true"
|
||||
value="fun $NAME$($PARAM1$ : $PARAM1TYPE$) : $RETURN$ { $END$ }">
|
||||
<variable alwaysStopAt="true" defaultValue="" expression="" name="NAME" />
|
||||
<variable alwaysStopAt="true" defaultValue=""x"" expression="" name="PARAM1" />
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="PARAM1TYPE" />
|
||||
@@ -70,7 +74,8 @@
|
||||
</context>
|
||||
</template>
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.fun2"
|
||||
name="fun2" toReformat="true" toShortenFQNames="true" value="fun $NAME$($PARAM1$ : $PARAM1TYPE$, $PARAM2$ : $PARAM2TYPE$) : $RETURN$ { $END$ }">
|
||||
name="fun2" toReformat="true" toShortenFQNames="true"
|
||||
value="fun $NAME$($PARAM1$ : $PARAM1TYPE$, $PARAM2$ : $PARAM2TYPE$) : $RETURN$ { $END$ }">
|
||||
<variable alwaysStopAt="true" defaultValue="" expression="" name="NAME" />
|
||||
<variable alwaysStopAt="true" defaultValue=""x"" expression="" name="PARAM1" />
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="PARAM1TYPE" />
|
||||
@@ -112,4 +117,39 @@
|
||||
<option name="KOTLIN_EXPRESSION" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.exfun"
|
||||
name="exfun" toReformat="true" toShortenFQNames="true"
|
||||
value="fun $RECEIVER$.$NAME$($PARAMS$) : $RETURN$ { $END$ }">
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="RECEIVER" />
|
||||
<variable alwaysStopAt="true" defaultValue=""f"" expression="" name="NAME" />
|
||||
<variable alwaysStopAt="true" defaultValue="" expression="" name="PARAMS" />
|
||||
<variable alwaysStopAt="true" defaultValue=""Unit"" expression="" name="RETURN" />
|
||||
<context>
|
||||
<option name="KOTLIN_CLASS" value="true"/>
|
||||
<option name="KOTLIN_NAMESPACE" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.exval"
|
||||
name="exval" toReformat="true" toShortenFQNames="true"
|
||||
value="val $RECEIVER$.$NAME$ : $TYPE$ get() { $END$ }">
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="RECEIVER" />
|
||||
<variable alwaysStopAt="true" defaultValue=""v"" expression="" name="NAME" />
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="TYPE" />
|
||||
<context>
|
||||
<option name="KOTLIN_CLASS" value="true"/>
|
||||
<option name="KOTLIN_NAMESPACE" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
<template resource-bundle="org.jetbrains.jet.plugin.JetBundle" key="livetemplate.description.exvar"
|
||||
name="exvar" toReformat="true" toShortenFQNames="true"
|
||||
value="var $RECEIVER$.$NAME$ : $TYPE$ get() { $END$ } set(value) { }">
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="RECEIVER" />
|
||||
<variable alwaysStopAt="true" defaultValue=""v"" expression="" name="NAME" />
|
||||
<variable alwaysStopAt="true" defaultValue=""Any"" expression="" name="TYPE" />
|
||||
<context>
|
||||
<option name="KOTLIN_CLASS" value="true"/>
|
||||
<option name="KOTLIN_NAMESPACE" value="true"/>
|
||||
</context>
|
||||
</template>
|
||||
</templateSet>
|
||||
|
||||
@@ -36,5 +36,8 @@ livetemplate.description.fun2=Function with two parameters
|
||||
livetemplate.description.interface=Trait
|
||||
livetemplate.description.singleton=Singleton
|
||||
livetemplate.description.closure=Closure (function without name)
|
||||
livetemplate.description.exfun=Extension function
|
||||
livetemplate.description.exval=Extension read-only property
|
||||
livetemplate.description.exvar=Extension read-write property
|
||||
macro.variable.of.type=kotlinVariableOfType(Type)
|
||||
macro.fun.parameters=functionParameters()
|
||||
Reference in New Issue
Block a user