Some documentation about how to set it up so it can compile would be nice…
The help files say
For executing CoffeeScript files, you need Node.js utility to be downloaded and installed on your machine.
Refer to usage instructions:
The usage instructions are... somewhat less then useful. I have coffee.exe compiler in path, and the latest version of coffeescript.js with it...
So... I have done everything it says to do... however... still nothing...
Idealy, I would like to be able to run .coffee files directly (and have Idea compile it in the background)
There is nothing in the Run/Debug windows around it… nothing in the compiler options in settings… just a whole world of nothing...
What you need to do to get Idea to compile / run it?
Also is there any chance of getting Node.js and compiler put in the plugin? or at least a setting somewhere where I can point Idea to the compiler, and have it work its magic from there?
As I understand you are Windows user, so you could install NodeJS for Windows (installer is here: http://nodejs.org/#download). Next step is to download CoffeeScript binaries, you could do it from here: http://github.com/jashkenas/coffee-script/tarball/master (just extract the archive and rename extracted folder to “coffeescript”). Then if you want to run .coffee file from command line you should create coffee.cmd file with content like this:
"C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\coffeescript\bin\coffee" %*
Then add it to the PATH environment variable. Now you can run CoffeeScript file by this way:
If you would like to run .coffee files from IntelliJ IDEA, you should install NodeJS plugin (go to Settings, select “Plugins” and press button “browse repositories”, select plugin “NodeJS” and press “Download and Install” menu item from context menu). Then add a new NodeJS run configuration, specify path to node.exe file, in “Node parameters” put path to CoffeeScript library (in my case it is "C:\Program Files (x86)\coffeescript\bin\coffee"), specify working directory and file to run. That’s all.
And by the way, IntelliJ IDEA can show you result of compilation of CoffeeScript file (you should open the context menu and click on the “Compile CoffeeScript File” menu item).
It now kinda works (somewhat)! Took a lot of mucking around even after getting the instructions (which I would not have been able to get there without!).
I have the compile context menu, and that compiles to coffeescript which is a good start
"Then add a new NodeJS run configuration, specify path to node.exe file, in “Node parameters” put path to CoffeeScript library (in my case it is "C:\Program Files (x86)\coffeescript\bin\coffee"), specify working directory and file to run. That’s all."
But the setup seems pretty screwy, I'm not sure how people are meant to work that out...
Path to Node: points to the node.exe - fine
Path to Node App JS File: test.coffee - This is where your .coffee file goes, even though this isn't the node App Js file?
Working Directory: your project directory - fine
Since --watch doesn't work on windows (using Node), I'll have to run the compile every time, AND I need a seperate run/debug configuration for every file which makes it sort of unusable.... (weirdly enough... coffee.exe's --watch does work... which is weird....)
I'll try installing cygwin and seeing if I can get any further running node from there.
I guess I'm just use to everything else in Idea working perfectly
in windows, I'm able to get coffee to watch by using the following command:
node C:\Program Files (86)\coffee\coffee -cw $ProjectFileDir$
(setup as an external tool...)
So it does
So others may follow, this is the setup I am now using.
Note: Node can't detect new files with watch, so if you add another coffee script file then restart the builder.
UPDATE: I've opened this question as a new post here:
I've followed the instruction here (including Blair's recommendations) and it does seem to be working but I never see any compiler errors in the run output window. Window indicates "Process finished with exit code 1" (1 means errors occurred). If I run using the coffee.cmd file in a command window I see the compiler errors. Anyway to pipe the errors to the INTELLIJ run's output window? See attached image. I'm using INTELLIJ 11.1.1.
Message was edited by: James Garza