将CoffeeScript与Eclipse集成? [英] Integrating CoffeeScript with Eclipse?

查看:119
本文介绍了将CoffeeScript与Eclipse集成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来集成CoffeeScript和Eclipse,所以当我在一个窗口中编写CoffeeScript时,另一个将显示编译的代码为Javascript?

Is there a way to integrate CoffeeScript and Eclipse, so that when I write CoffeeScript in one window the other will show the compiled code as Javascript?

等待答案。谢谢。

推荐答案

我在项目中使用了一个构建器和一个小shell脚本。每次我保存一个.coffee文件,它编译所有我的脚本。

I've done it with a builder and a small shell script in my project. Every time I save a .coffee file, it compiles all my scripts. Works great.

右键单击您的项目。


  • 建筑

  • 新建...

  • 位置:$ {workspace_loc:/ProjectName/coffee-compile.sh}

  • 工作目录:$ {workspace_loc:/ ProjectName}

  • 刷新:指定生成的.js文件所在的文件夹。

  • 创建选项:指定.coffee文件所在的文件夹。
  • li>
  • Builders
  • New...
  • Location: ${workspace_loc:/ProjectName/coffee-compile.sh}
  • Working Directory: ${workspace_loc:/ProjectName}
  • Refresh: Specify the folder where your generated .js files live. This allows you to keep the .js file open as well and it'll auto update when things re-compile.
  • Build Options: Specify the folder where your .coffee files live.

ProjectName / coffee-compile.sh:

ProjectName/coffee-compile.sh:

#!/bin/bash

if [ ! -d ./target/coffee ]; then
    mkdir -p ./target/coffee
fi

echo "Compiling coffee script files..."
/usr/bin/coffee --output ./target/coffee --compile ./coffee

echo "Done..."


$ b b

构建器定义保存为项目的一部分。它在.settings文件夹中。

The builder definition is saved as part of your project. It is in the .settings folder. That way, other developers can check out your project as well and have everything already set up.

更新:对于代码格式和着色,我最后安装了最新的beta版本Aptana into Eclipse。

Update: For code formatting and coloring, I ended up installing the latest beta of Aptana into Eclipse.

Update2 :我已经停止使用Eclipse来支持Intellij。编辑器和内置支持编译代码是非常好的。我强烈建议你尝试一下。

Update2: I've stopped using Eclipse in favor of Intellij. The editors and built in support for compiling code are wonderful. I highly suggest you try it out.

这篇关于将CoffeeScript与Eclipse集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆