Instale esse plugin: Meteor JS Template Importe os Xmls acima (ficarão aqui .WebStorm2017.1/config/templates). Import o settings.jar para React: https://github.com/minwe/jetbrains-react
Last active
April 8, 2017 20:01
-
-
Save filipenevola/f46b3354a0cda8b5cec00666853b2923 to your computer and use it in GitHub Desktop.
Live Templates for Meteor & Javascript for WebStorm
This file contains 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
<templateSet group="JavaScript"> | |
<template name="cl" value="console.log(`$VAR$=${$VAR$}`); $END$" description="console.log" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JS_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="cll" value="console.log(`$VAR$=${$VAR$}, $VAR2$=${$VAR2$}`); $END$" description="console.log 2 objects" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VAR2" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JS_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="tv" value="`$TEXT$=${$VAR$}`$END$" description="text var string" toReformat="true" toShortenFQNames="true"> | |
<variable name="TEXT" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JS_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="af" value="$VAR$ = () => { $END$ }" description="Empty arrow func" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
<option name="JSX_HTML" value="false" /> | |
</context> | |
</template> | |
<template name="ed" value="export default $END$" description="Export default" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
<option name="JSX_HTML" value="false" /> | |
</context> | |
</template> | |
</templateSet> |
This file contains 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
<templateSet group="Meteor"> | |
<template name="mpub" value="Meteor.publish('$name$', ($argument$) => { $END$ });" description="Publish a record set." toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="argument" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="msr" value="{{#if Template.subscriptionsReady}} $END$ {{else}} {{> spinner}} {{/if}}" description="Blaze Template Subscriptions Ready" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
<template name="mim" value="import {Meteor} from 'meteor/meteor'; $END$" description="Import Meteor" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mi" value="import {$VAR0$} from '/imports/$VAR1$'; $END$" description="Import something" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VAR1" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mid" value="import $VAR0$ from '/imports/$VAR1$'; $END$" description="Import something default" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="VAR1" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mimod" value="import $VAR0$ from '/imports/core/models/$VAR0$'; $END$" description="Import default Model" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="misch" value="import $VAR0$ from '/imports/core/schemas/$VAR0$'; $END$" description="Import default Schema" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mipub" value="import '/imports/api/publications/$VAR0$'; $END$" description="Import Publication file" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mimet" value="import '/imports/api/methods/$VAR0$'; $END$" description="Import Method file" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mienu" value="import $VAR0$ from '/imports/core/enums/$VAR0$'; $END$" description="Import default Enum" toReformat="true" toShortenFQNames="true"> | |
<variable name="VAR0" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mevn" value="Template.$name$.events({ '$event$'(e, t){ $END$ } });" description="Specify event handlers for this template." toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="underscoresToCamelCase(fileNameWithoutExtension())" defaultValue="underscoresToCamelCase(fileNameWithoutExtension())" alwaysStopAt="true" /> | |
<variable name="event" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="mhel" value="Template.$name$.helpers({ $helper$(){ $END$ } });" description="Specify template helpers available to this template." toReformat="false" toShortenFQNames="true"> | |
<variable name="name" expression="underscoresToCamelCase(fileNameWithoutExtension())" defaultValue="underscoresToCamelCase(fileNameWithoutExtension())" alwaysStopAt="true" /> | |
<variable name="helper" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="mcol" value="$Collection$ = new Mongo.Collection('$collection$');" description="declare a collection with new Mongo.Collection." toReformat="true" toShortenFQNames="true"> | |
<variable name="Collection" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="collection" expression="" defaultValue="decapitalize(Collection)" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="msub" value="this.subscribe('$name$');" description="Subscribe to a record set." toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="msg" value="Session.get('$key$');" description="Get the value of a session variable." toReformat="true" toShortenFQNames="true"> | |
<variable name="key" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="mss" value="Session.set('$key$', $value$);" description="Get the value of a session variable." toReformat="true" toShortenFQNames="true"> | |
<variable name="key" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="value" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="msta" value="Meteor.startup(() => { $END$ });" description="Run code when a client or a server starts." toReformat="true" toShortenFQNames="true"> | |
<context /> | |
</template> | |
<template name="merr" value="throw new Meteor.Error($number$, `$description$`);" description="throw Error" toReformat="true" toShortenFQNames="true"> | |
<variable name="number" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="description" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="mcall" value="Meteor.call('$meteorMethod$', $dataObject$, (error, result) => { if(error){ console.log("error", error); } if(result){ $END$ } });" description="Meteor call method." toReformat="true" toShortenFQNames="true"> | |
<variable name="meteorMethod" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="dataObject" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context /> | |
</template> | |
<template name="milog" value="import logger from '/imports/lib/logger'; $END$" description="Import Logger" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="micon" value="import Constants from '/imports/lib/Constants'; $END$" description="Import Constants" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="miuti" value="import Utils from '/imports/lib/Utils'; $END$" description="Import Constants" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mmet" value="Meteor.methods({ '$name$'($argument$) { $END$ } });" description="Create a method" toReformat="true" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="argument" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_SCRIPT" value="true" /> | |
</context> | |
</template> | |
<template name="mwith" value="{{#with $statement$}} $END$ {{/with}}" description="Blaze #with." toReformat="true" toShortenFQNames="true"> | |
<variable name="statement" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML" value="true" /> | |
</context> | |
</template> | |
</templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment