Emacs+Ensimeç°å¢ã使ã£ã¦Play Framework2.0ã§éã¶
ã¨ããããâ¦
EmacsãVimãå¹¾ã使ãæ £ãã¦ããããã£ã¦è¨ã£ã¦ããã¢ãã«ãã£ã¦ã¯Eclipse使ã£ããIntelliJ使ã£ããããã»ããå½ç¶ä¾¿å©ãªå ´åãããããã§ãç¹ã«Javaã«é¢ãã¦ã¯Emacs+JDEEã¯æ¢ã«ãªã¯ã³ã³ãªã®ã§ãããããEmacsã§æ¸ãã®ã馬鹿ãããæããããããã§ãããããã§ãEmacsãVimã使ãã®ã¯åãªããªããã¼ã§ãããã¨ãèªèãã¦ãã人ã ããããã®é«ã¿ãæãã訳ã§ãï¼ã¯ãï¼
åã£ã¦ãã
Ensimeã¯githubã§å ¬éããã¦ãã¾ããããã§æããcloneã¨ãããããªã£ã¡ããã¾ãããEnsimeã¯å©ç¨ããScalaã®ãã¼ã¸ã§ã³ã«å¼·ãä¾åãã¦ããããã§ãéçºã®å 端ãåã£ã¦ããããã¡ããã¨Downloadç¨ã¨ãã¦ç¨æãã¦ãããã®ã使ã£ãã»ãããçµé¨ä¸ãå®å®ãã¦ãã¦ããããã§ãã
https://github.com/aemoncannon/ensime/downloads
ç¾æç¹ã§ã¯Scalaã®ææ°å®å®çã2.9.2ãªã®ã§ã2.9.2ç¨ã§æçªãææ°ã®ãã¤ãæã£ã¦ããã°åé¡ãªãã¨æãã¾ã
ããã§ã¯ensime_2.9.2-0.9.8.1.tar.gzã使ãã¾ã
scala-mode
ãã£ã¨ãã®åã«ãEnsimeã¯Scalaã«ä»å±ãã¦ããscala-modeã«ä¾åãã¾ãã®ã§ãäºãscala-modeãå ¥ã£ã¦ãããã¨ãåæã«ãªãã¾ããã¾ããå½ç¶å ¥ã£ã¦ããã¨ã¯æãããã£ã¼
ãï¼ç¡ãï¼å®ã¯stableçã®2.9.2ã®ããã±ã¼ã¸ã«ã¯å ¥ã£ã¦ãã¾ããï¼èª¬æã¯ããã«ããã¾ãã
Subsequently, we moved our repository to GitHub and changed our distribution packaging infrastructure. At this time, "tool-support" it is not by default part of the 2.9.2 distribution, but it will be made available again in the next releases. In the meantime, you can find the source repository at this address: http://www.scala-lang.org/node/91#tool_support
ã¨ãããã¨ãªã®ã§ãããããåã£ã¦ãã¦å ¥ãã¾ãã
ãããªæãã«æ¸ãã¦ããã°åãã§ããã
ããã¦ã¿ã
åã£ã¦ããensimeãé©å½ãªå ´æã«å±éããè¨å®ã§load-pathãéãã¦ããã°ã¨ããããOKã§ãã
Play! Frameworkã§éã¶çºã«
å½ç¶ã§ããPlayFrameworkãæ¢ã«Installããã¦ããã¨ãã¾ããã¾ããPlayèªä½ã¯å±éãã¦PATHéãã°ããã ããªã®ã§ãç¹ã«åé¡ãªããã¨æãã¾ããã¨ããããæ°ããããã¸ã§ã¯ããä½æãã¾ãã
$ play new testapp _ _ _ __ | | __ _ _ _| | | '_ \| |/ _' | || |_| | __/|_|\____|\__ (_) |_| |__/ play! 2.0.4, http://www.playframework.org The new application will be created in /home/misty/dev/scala/testapp What is the application name? > testapp Which template do you want to use for this new application? 1 - Create a simple Scala application 2 - Create a simple Java application 3 - Create an empty project > 1 OK, application testapp is created. Have fun! $
ã¯ããã§ãã¾ãããç¾å¨ãdefaultã®Skeletonã§ããã¸ã§ã¯ããä½æããã¨ãããªæãã§ãã次ã«ensimeã§ä½¿ãããã«Playèªä½ã解æãã¦ensimeä¸ããè£å®åºæ¥ãããã«ãã¾ãããã®çºã«ãä½æããããã¸ã§ã¯ããã£ã¬ã¯ããªå ã®project/plugins.sbtã«pluginã®è¨å®ãã¾ãã
$ cat plugins.sbt // Comment to get more information during initialization logLevel := Level.Warn // The Typesafe repository resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" // Use the Play sbt plugin for Play projects addSbtPlugin("play" % "sbt-plugin" % "2.0.4") addSbtPlugin("org.ensime" % "ensime-sbt-cmd" % "0.1.0") // <-ãã
ããã¾ã§ãããplay consoleãèµ·åãã¦ensime generateãå®è¡ãã¾ãã
[testapp] $ ensime generate [info] Gathering project information... [info] Processing project: ProjectRef(file:/home/misty/Develop/scala/testapp/,testapp)... [info] Reading setting: name... ï¼ç¥ï¼ [info] Reading setting: class-directory... [info] Reading setting: ensime-config... [info] Wrote configuration to .ensime [testapp] $
ããã§ensimeã®å©ç¨æºåå®äºã§ãã
Emacs + Ensime
ã¨ããããå ã»ã©ä½ã£ãããã¸ã§ã¯ãã§ä½æãããã½ã¼ã¹ãéããã¨ããã¨
error Not connected. M-x ensime to connect
ã¿ãããªãã¨ãè¨ãããã®ã§
M-x ensime
ãèµ·åãã¾ããç¹ã«åé¡ããªããã°ãã¾ããã¨èµ·åãã¦ä½¿ããããã«ãªãã¯ãã§ãï¼ç¶ãã¯æ°ãåãããæ¸ãã¾ãã