Skip to content

Instantly share code, notes, and snippets.

@zeromancer
Created October 4, 2017 19:29
Show Gist options
  • Save zeromancer/a2a5e37f9ba98fa6d1354db7b0f1f943 to your computer and use it in GitHub Desktop.
Save zeromancer/a2a5e37f9ba98fa6d1354db7b0f1f943 to your computer and use it in GitHub Desktop.
Intellij settings/templates/scala.xml
<templateSet group="scala">
<template name="T" value="&lt;$TAG$&gt;$SELECTION$&lt;/$TAGNAME$&gt;&#10;" description="Surround with &lt;tag&gt;&lt;/tag&gt;" toReformat="true" toShortenFQNames="true">
<variable name="TAG" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="TAGNAME" expression="firstWord(TAG)" defaultValue="&quot;&quot;" alwaysStopAt="false" />
<context />
</template>
<template name="logger" value="val log: Logger = Logger[$CLASS_NAME$]" description="Template to import Logger" toReformat="false" toShortenFQNames="true">
<variable name="CLASS_NAME" expression="fileName()" defaultValue="" alwaysStopAt="true" />
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
<template name="info" value="log.info(&quot;$EXPR_COPY$ = {}&quot;, $EXPR$)" description="log.info" toReformat="false" toShortenFQNames="true">
<variable name="EXPR" expression="scalaVariableOfType(&quot;&quot;)" defaultValue="false" alwaysStopAt="true" />
<variable name="EXPR_COPY" expression="EXPR" defaultValue="" alwaysStopAt="false" />
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
<template name="debug" value="log.debug(&quot;$EXPR_COPY$ = {}&quot;, $EXPR$)" description="log.debug" toReformat="false" toShortenFQNames="true">
<variable name="EXPR" expression="scalaVariableOfType(&quot;&quot;)" defaultValue="false" alwaysStopAt="true" />
<variable name="EXPR_COPY" expression="EXPR" defaultValue="" alwaysStopAt="false" />
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
<template name="logger2" value="val log: Logger = LoggerFactory.getLogger(this.getClass)" description="Template to import Logger" toReformat="false" toShortenFQNames="true" deactivated="true">
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
<template name="privi" value="println(s&quot;$EXPR_COPY$ = $$$EXPR$&quot;)" description="Template for println unwrapped" toReformat="true" toShortenFQNames="true">
<variable name="EXPR" expression="scalaVariableOfType(&quot;&quot;)" defaultValue="false" alwaysStopAt="true" />
<variable name="EXPR_COPY" expression="EXPR" defaultValue="" alwaysStopAt="false" />
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
<template name="intenum" value="sealed abstract class Stuff(val value: Int) extends IntEnumEntry&#10;object Stuff extends IntEnum[Stuff] {&#10; case object Entry1 extends Stuff(-1000)&#10; val values: IndexedSeq[Stuff] = findValues&#10;}" description="Template for enumeratum enum" toReformat="true" toShortenFQNames="true">
<context>
<option name="SCALA_CODE" value="true" />
</context>
</template>
</templateSet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment