Integrating CoffeeScript with Eclipse?(将 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.
右键单击您的项目.选择菜单底部附近的属性.
Right click on your project. Select properties near the bottom of the menu.
- 建设者
- 新...
- 位置:${workspace_loc:/ProjectName/coffee-compile.sh}
- 工作目录:${workspace_loc:/ProjectName}
- 刷新:指定生成的 .js 文件所在的文件夹.这使您也可以保持 .js 文件处于打开状态,并且在重新编译时它会自动更新.
- 构建选项:指定 .coffee 文件所在的文件夹.
项目名称/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..."
构建器定义保存为项目的一部分.它位于 .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.
更新:对于代码格式化和着色,我最终将最新的 Aptana 测试版安装到 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 集成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 CoffeeScript 与 Eclipse 集成?


基础教程推荐
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 大摇大摆的枚举 2022-01-01