Eclipse:使用“开放声明” ...在Scala项目中 [英] Eclipse: Using "Open Declaration" ... in a Scala project

查看:459
本文介绍了Eclipse:使用“开放声明” ...在Scala项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试从Java转换到Scala几个月,发现最大的障碍是Scala的Eclipse插件比使用Vim更好。



我通常有自动构建功能,除了打开和保存之外,我大部分时间使用的命令是:

 开放声明(F3)
参考文献>工作区(Ctrl-Shift-G)
打开类型层次结构(F4)
打开类型(Ctrl-Shift-T)
内容辅助(Ctrl-Space)

并查看大纲。



这些都不适用于Scala IDE为图书馆。有些东西适用于我自己的代码,如大纲。但是其余的只是返回以下错误:


资源不在Java项目的构建路径上。


有没有办法让任何这些东西在Eclipse中工作?没有他们,基本上我唯一得到的是语法高亮和编译保存,我可以从vim获取语法高亮,而不需要1.5 GB的RAM ...



有了暗示和静态功能导入,找出来的东西真的很难,没有F3。我最终用Google找到什么类/特征定义了什么。



我刚刚拉过Eclipse Classic 3.6.2,而 update-1.0.0-milestones-2.8.1.final ,最后一次检查可用。它们已经修复了大纲和打开类型,就是这样。其余的仍然不起作用。

解决方案

您正在使用哪个版本的Eclipse插件?如果这个版本是从前一段时间开始的话,那么你是对的,这有点麻烦。



然而,有一个新版本,目前在beta版(截至23.04 .2011)可从 Scala IDE Eclipse下载站点获得。这很好。



另外,请确保在Scala->安装诊断窗口中选中使用JDT内容辅助复选框。



请尝试新版本,看看它是否修复了您的问题。如果没有,请提出错误,并且小组将对此进行修正。 / p>

I've been trying to convert from Java to Scala for a few months, and found that the greatest roadblock is that Eclipse plugin for Scala is hardly better then using Vim.

I normally have "Build Automatically" on, so apart from Open and Save, the commands I use most of the time are:

Open Declaration (F3)
References > Workspace (Ctrl-Shift-G)
Open Type Hierarchy (F4)
Open Type (Ctrl-Shift-T)
Content Assist (Ctrl-Space)

and looking at the Outline.

None of this works with the Scala IDE for the libraries. Some stuff works for my own code, like outline. But the rest just returns the following error:

The resource is not on the build path of a Java project.

Is there any way to get any of those things to work in Eclipse? Without them, basically the only thing I get is syntax highlight and compile-on-save, and I can get syntax highlight from vim without needing 1.5 GB of ram...

With implicits, and static function import, finding out from where something comes is really difficult without F3. I ended up using Google to find what class/trait defines what.

[EDIT] I just pulled Eclipse Classic 3.6.2, and update-1.0.0-milestones-2.8.1.final, which wasn't available the last time I checked. They have fixed the Outline, and "Open Type", that's it. The rest still doesn't work.

解决方案

Which version of the Eclipse plugin are you using? If the version is from a while ago, then you're right, it's a bit buggy.

However, there is a new version, currently in beta (as of 23.04.2011) available from Scala IDE Eclipse download site. This is a lot better.

Also, please make sure that the 'Use JDT content assists' checkboxes are checked in Scala->Setup diagnostics window.

Please try the new version, and see if it fixes your problems. If not, raise a bug, and the team will fix it.

这篇关于Eclipse:使用“开放声明” ...在Scala项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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