Scripting IDE for DSL awareness
http://www.jetbrains.net/confluence/display/GRVY/Scripting+IDE+for+DSL+awareness
IntelliJ, SUGEEEEEEEEEE!!!!!
ä½ãã¹ã´ããã£ã¦è¨ãã¨ï¼GroovyDSLã¨å¼ã°ããã¹ã¯ãªãããIntelliJã«èªã¿è¾¼ã¾ãããã¨ã§ï¼ç¹å®ã®DSLããã¤ãããã¯ãªã¡ã½ãããããããã£ãï¼IntelliJã«ææ¡ããããã¨ãã§ãããã ã£ã¦ãã¤ã¾ãï¼ã³ã¼ãè£å®ããåæ¨è«ãªãããã§ããããã«ãªãã£ã¦ãã¨ããï¼ããããããã£ã¡ãåç
§ãã¦ãã
â Use GroovyDSL in IntelliJ IDEA Community Edition - Messages from mrhaki
åé ã®ãªã³ã¯å ã«ãã£ãä¾ãåãã¨ãä¸è¨ã®ãããªDayCounter.groovyã£ã¦ã¹ã¯ãªãããããã¨ããã
Integer.metaClass.getDaysFromNow = { -> Calendar today = Calendar.instance today.add(Calendar.DAY_OF_MONTH, delegate) today.time } println(5.daysFromNow)
Integeråã®daysFromNow()ã¡ã½ããã¯ï¼metaClassã§æ¡å¼µããã¡ã½ãããªã®ã§ï¼Integeråã ã¨æã£ã¦ããIntelliJã®ã³ã¼ãè£å®ã«ã¯åºã¦ããªãã
ããã§ï¼GroovyDSL scriptã¨ããã®ãä½ããä»®ã«ãã¡ã¤ã«åãï¼TestScript.gdslã¨ãããã
def ctx = context(ctype: "java.lang.Integer", scope: scriptScope(name: "DayCounter.groovy")) contributor(ctx) { property name: "daysFromNow", type: "Calendar" }
ããããã¨ï¼ããä¸æè°ãIntegeråã®åè£ã«ï¼daysFromNow()ããã¡ããã¨ï¼åãCalendaråã«ãªã£ã¨ãã
大äºãªäºã ããããä¸åº¦è¨ãã¾ãã
ãããããããããããããããããããâ§â§â© ãããããããããããããããããã ( ï¾âï¾ )/ ãããããããããããã ï¾_ï¾ãããâãã ï¾ããã ï¾_ï¾ ããããããããããã('(ï¾âï¾ â©ãã (㤠ï¾ãã â© ï¾âï¾)') ãããããã ï¾_ï¾ãããã½ãããããã (ãããããããã/ããã ãï¾_ï¾ ããããã('(ï¾âï¾â©ãããã½ã½_)ãããããããã(_ã ãããã .â© ï¾âï¾)') ãããããO,_ãããããããããããããããããããããããããããã,_O ãããããããï½ã½_)ãããããããããããããããããããããï¼_/ ´ ãã ï¾_ï¾ããããããããããIntelliJ, SUGEEEEE!!!!!!ããããããã ï¾_ï¾ â(ï¾âï¾ââï½âãããããããããããããããããããããã â´ââï¾âï¾)â
åãã¦IntelliJã«è§¦ãã人㸠â ããã¸ã§ã¯ãã®è¨å®ã¨ããã¹ãå®è¡ã®è©±
IntelliJ CEã使ã£ã¦ã¿ããã£ã¦äººã®ã»ã¨ãã©ãScala使ã£ã¦ã¿ããï¼å½ç¤¾æ¯ï¼ãããªã®ã§ï¼Scalaãä¾ã«ãããã念ã®ããï¼IntelliJ CE㯠IC-90.96ï¼Scalaãã©ã°ã¤ã³ã¯ 0.3.32 ãåæã«ãã¨ãã
ã©ãã§ããããã©ï¼Groovyã«ã¤ãã¦ã¯ï¼ããã«è¯ã解説ãããã®ã§ï¼åèã«ãã¦ãã
â Simple Groovy Project in IntelliJ IDEA Community Edition - Messages from mrhaki
ããããï¼ãé¡ã¯ãScalaããã¸ã§ã¯ãã§Specsãåããã¾ã§ãã¨ãã¨ãã¾ã
ç¶ããèªã