使用以前版本的 Scala 运行 Eclipse Scala 插件

发布于 2024-09-19 01:52:24 字数 358 浏览 3 评论 0原文

scala插件似乎会自动下载Scala 2.8版本。我想尝试 Gridgain 3.0-beta,目前仅适用于 Scala 2.7 .7.由于Gridgain 3.0-beta已经提供了scala-compiler-2.7.7.jar和scala-library-2.7.7.jar,是否可以让Eclipse Scala Plugin编译到Scala 2.7.7?

我尝试从项目构建路径中删除 Scala Library 2.8 并添加两个 2.7 jar,但这似乎不起作用。

如果我改用 Netbeans 会更容易吗?

The scala plugin seems to automatically download version 2.8 of Scala. I'l like to try out the Gridgain 3.0-beta, which currently only works with Scala 2.7.7. Since Gridgain 3.0-beta already provides scala-compiler-2.7.7.jar and scala-library-2.7.7.jar, is it possible to get the Eclipse Scala Plugin to compile to Scala 2.7.7?

I tried removing the Scala Library 2.8 from the project build path and added both the 2.7 jars, but this didn't seem to work.

Would this be easier if I switched to Netbeans?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独夜无伴 2024-09-26 01:52:24

Eclipse 插件和 NetBeans 插件都使用 Scala 编译器来完成很多事情,从语法突出显示等简单的内容到类型推断、解析和隐式显示等内容,再到自动类型驱动重构和语义突出显示等更复杂的内容。

更具体地说,他们使用 2.8 编译器,因为 2.8 编译器具有完全重构的 API 和新框架(所谓的演示编译器),这是专门设计的对于 IDE,这样它们就可以从编译器中获取所需的所有信息,而且还可以将信息(如重构的情况)反馈回编译器中。

因此,简而言之:插件的版本与编译器的版本紧密耦合,而编译器又只支持该语言的一种版本。特别是,IDE插件需要2.8版本的编译器,因为它们使用新的演示编译器框架,而2.8编译器不支持2.7语言。

这种紧密耦合当然不是一件好事,将来它会被打破,但现在,你被困住了。

可以尝试 IntelliJ IDEA IDE 及其 Scala 插件。据我所知,他们纯粹根据 Scala 语言规范编写了自己的编译器(至少是语法突出显示和重构所需的部分),而没有使用任何 Scala 编译器 API 。 Scala 插件可以与社区版配合使用。

Both the Eclipse plugin and the NetBeans plugin use the Scala Compiler for a lot of things from the simple stuff like syntax highlighting to stuff like type inference, resolution and display of implicits to more involved stuff like automated type-driven refactorings and semantic highlighting.

And more specifically, they use the 2.8 compiler, because the 2.8 compiler has a completely refactored API and a new framework (the so-called presentation compiler), which is specifically designed for IDEs, so that they can get all the information they need out of the compiler, but also can feed information (like in the case of refactorings) back into the compiler.

So, in short: the version of the plugin is closely coupled to the version of the compiler, and the compiler in turn only supports one version of the language. In particular, the IDE plugins require a 2.8 version of the compiler, because they use the new presentation compiler framework, and the 2.8 compiler does not support the 2.7 language.

This tight coupling is of course not a good thing, and it will get broken up in the future, but for now, you are stuck.

You could try the IntelliJ IDEA IDE and their Scala plugin. As far as I know, they have written their own compiler (well, at least the parts they need for syntax highlighting and refactoring purposes) purely from the Scala Language Specification, without using any of the Scala Compiler APIs. The Scala Plugin does work with the Community Edition.

著墨染雨君画夕 2024-09-26 01:52:24

解决此类问题的最佳位置是 Scala IDE 用户邮件列表。但简而言之,Scala 的 Eclipse 工具不支持使用除其附带版本之外的其他版本的 Scala 编译器和库。在可预见的未来,这种情况不太可能改变。

The best place for questions like this is the Scala IDE user mailing list. But in brief, the Eclipse tooling for Scala doesn't support the use of other versions of the Scala compiler and libraries than the ones which it ships with. This is unlikely to change in the foreseeable future.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文