将 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?
I'll wait for answers. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(3)
我已经在我的项目中使用构建器和小型 shell 脚本完成了此操作。每次我保存 .coffee 文件时,它都会编译我的所有脚本。效果很好。。
右键单击您的项目。选择菜单底部附近的属性。
ProjectName/coffee-compile.sh:
构建器定义保存为项目的一部分。它位于 .settings 文件夹中。这样,其他开发人员也可以检查您的项目并完成所有设置。
更新:为了代码格式化和着色,我最终将最新的 Aptana 测试版安装到 Eclipse 中。
更新2:我已停止使用 Eclipse,转而使用 Intellij。编辑器和内置的代码编译支持非常棒。我强烈建议你尝试一下。
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.
ProjectName/coffee-compile.sh:
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.
Update: For code formatting and coloring, I ended up installing the latest beta of Aptana into Eclipse.
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.
我为此使用了
coffee
的-w
选项。打开终端,cd
到您的项目目录,然后运行 coffee -w ./coffee -c ./js
。假设您的coffee
文件存储在名为coffee
的文件夹中,并且您将文件编译到名为js
的文件夹中。在编码期间保持终端打开。每次重新保存文件时,
coffee
都会编译您的脚本。I'm using
coffee
s-w
option for this. Open a terminal,cd
to your project directory and then runcoffee -w ./coffee -c ./js
. Assuming that yourcoffee
files are stored in a folder namedcoffee
and you are compiling your files to a folder namedjs
.Keep the terminal open while your coding session.
coffee
will compile your script every time you resave the file.我编写了一个插件来自动转译 CoffeeScript 文件(以及其他文件)。
-> https://github.com/gossi/eclipse-transpiler-plugin
基本上,它确实与 Jon Stevens Shell 脚本相同,但有一个漂亮的配置 UI。
I wrote a plugin to automatically transpile CoffeeScript files (amongst others) automatically.
-> https://github.com/gossi/eclipse-transpiler-plugin
Basically, it does the same as Jon Stevens Shell script, but has a nice UI for the configuration.