Last active
July 16, 2023 21:33
-
-
Save kitlangton/3b8f2063ce2bc72467bc3d86aea91d2f to your computer and use it in GitHub Desktop.
IDEA Live Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="fr" value="for { $VARIABLE$ <- $VALUE$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VALUE" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> | |
<variable name="FINISH" expression="" defaultValue="VARIABLE" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA" value="true" /> | |
</context> | |
</template> | |
<template name="FR" value="for { $VARIABLE$ <- $SELECTION$ } yield $FINISH$" description="for comprehension" toReformat="false" toShortenFQNames="true"> | |
<variable name="VARIABLE" expression="" defaultValue=""x"" alwaysStopAt="true" /> | |
<variable name="FINISH" expression="" defaultValue="VARIABLE" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA" value="true" /> | |
</context> | |
</template> | |
<template name="imc" value="implicit final class $CLASS_NAME$$SUFFIX$(private val self: $TYPE_NAME$) extends AnyVal { $END$ }" description="Template for extension methods container" toReformat="true" toShortenFQNames="true"> | |
<variable name="TYPE_NAME" expression="" defaultValue=""Any"" alwaysStopAt="true" /> | |
<variable name="SUFFIX" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="CLASS_NAME" expression="scala_implicitValueClassName(TYPE_NAME)" defaultValue="" alwaysStopAt="false" /> | |
<context /> | |
</template> | |
<template name="st" value="sealed trait $TYPE_NAME$ extends Product with Serializable object $CLASS_NAME$ { $END$ }" description="Template for scala sealed trait" toReformat="true" toShortenFQNames="true"> | |
<variable name="TYPE_NAME" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="CLASS_NAME" expression="substringBefore(scala_implicitValueClassName(TYPE_NAME), "Ops")" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="SCALA_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="co" value="case object $NAME$" description="Template for scala case object" toReformat="true" toShortenFQNames="true"> | |
<variable name="NAME" expression="suggestScalaVariableName("foreach", FOR)" defaultValue="x" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="coe" value="case object $NAME$ extends $TRAIT$" description="Template for scala case object extending trait" toReformat="true" toShortenFQNames="true"> | |
<variable name="NAME" expression="suggestScalaVariableName("foreach", FOR)" defaultValue="x" alwaysStopAt="true" /> | |
<variable name="TRAIT" expression="substringBefore(className(), "$")" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="cce" value="final case class $NAME$($PARAMS$) extends $TRAIT$" description="Template for scala case class extends" toReformat="true" toShortenFQNames="true"> | |
<variable name="NAME" expression="suggestScalaVariableName("foreach", FOR)" defaultValue="x" alwaysStopAt="true" /> | |
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="TRAIT" expression="scala_className" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="cc" value="final case class $NAME$($PARAMS$)" description="Template for scala case class" toReformat="true" toShortenFQNames="true"> | |
<variable name="NAME" expression="suggestScalaVariableName("foreach", FOR)" defaultValue="x" alwaysStopAt="true" /> | |
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="SCALA_CODE" value="true" /> | |
</context> | |
</template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Live Templates
in IntelliJ Preferencesscala