Plugin for CoffeeScript language support for IntelliJ IDEA 10.5 (Ultimate Edition). The plugin is bundled in RubyMine 3.2 and later will be bundled in other JetBrains IDEs.
I want to share my configuration steps - as I spent some time to understand how to do this. I use win 7. 1. Download and install Node.js. 2. Use npm coffee-script without -g param. It will install coffee-script to the same directory as Node. 3. Create new "Run/Debug" configuration of "Node JS". 4. Set "Path to Node" to the directory where the node.exe file arranged(C:\Program Files\nodejs). 5. Set "Working Directory" to the path where your coffee script files arranged. 6. Set "Path to Node App JS file" to the "entry point" file of your project or any file which you want to run. 7. Check "Run with CoffeeScript plugin" checkbox. 8. Set "Path to cofee executable" to the cofee-script module( In my case C:\Program Files (x86)\nodejs\node_modules\coffee-script\bin\coffee). This file will contain next code
How about seeing what went wrong? I have a coffee file run with node.js and all I can see is some stack trace (but it can't find the fs.js file so no sources). No error message, no error in the console (as I used to have on linux terminal), nothing. How figure it out? ;)
I'm on OSX and generating previews of compiled coffeescript is incredibly CPU-intensive - is there possibly a bug here? It doesn't seem to be handing the file off to coffee -c, which is what I would expect.
Finally figured out how to use it. I'm pretty sure that there must be an easier way, but this worked for us:
1. install the NodeJS plugin, and npm coffee-script. 2. of the Run/Debug configurator. 3. set 'Path to Node' to the location of node (e.g. on OSX: /usr/local/bin/node). 4. set 'Path to Node App JS File' to the location of coffee (eg /usr/local/bin/coffee). 5. set "application parameters" to your .coffee file (eg test.coffee)
The key thing is to run coffee from node. If you look in the coffee file, you'll see that it's a nodejs file with the node shebang.
Note to Jetbrains: provide a coffeescript run/debug configurator ASAP !!!
Comments:
I use win 7.
1. Download and install Node.js.
2. Use npm coffee-script without -g param. It will install coffee-script to the same directory as Node.
3. Create new "Run/Debug" configuration of "Node JS".
4. Set "Path to Node" to the directory where the node.exe file arranged(C:\Program Files\nodejs).
5. Set "Working Directory" to the path where your coffee script files arranged.
6. Set "Path to Node App JS file" to the "entry point" file of your project or any file which you want to run.
7. Check "Run with CoffeeScript plugin" checkbox.
8. Set "Path to cofee executable" to the cofee-script module( In my case C:\Program Files (x86)\nodejs\node_modules\coffee-script\bin\coffee). This file will contain next code
I'm pretty sure that there must be an easier way, but this worked for us:
1. install the NodeJS plugin, and npm coffee-script.
2. of the Run/Debug configurator.
3. set 'Path to Node' to the location of node (e.g. on OSX: /usr/local/bin/node).
4. set 'Path to Node App JS File' to the location of coffee (eg /usr/local/bin/coffee).
5. set "application parameters" to your .coffee file (eg test.coffee)
The key thing is to run coffee from node. If you look in the coffee file, you'll see that it's a nodejs file with the node shebang.
Note to Jetbrains: provide a coffeescript run/debug configurator ASAP !!!