Scala Eclipse自动完成破碎? [英] Scala Eclipse Autocomplete Broken?
问题描述
我正在eclipse中自动完成工作,以进行scala开发。我试图从Scala类引用一个java类,并且自动完成功能永远都不会找到它。
I'm trying to get autocomplete working in eclipse for scala development. I'm trying to reference a java class from a Scala class, and the autocomplete feature never finds it.
例如拿这个scala类:
for example take this scala class:
object Main {
def main(args: Array[String]) {
val btn = new JButton
}
}
当我在键入结束时点击ctrl +空格JButton autocomplete发现Arr,asof,case,catch,def等...但
When I hit ctrl+space at the end of typing JButton autocomplete finds "Arr", "asof", "case", "catch", "def" etc... but no classes.
在Window-> Preferences-> Java-> Editor-> Content Assist-> Advanced中我选择了Default Proposal种类:
in Window->Preferences->Java->Editor->Content Assist->Advanced I have selected under "Default Proposal Kinds":
Java提案,Java类型提案,SWT模板提案和模板提案。
Java Proposals, Java Type Proposals, SWT Template Proposals and Template Proposals.
我正在使用Scala 2.8.0- Eclipse 3.5.2中的最终插件,在Windows 7中
I'm using the Scala 2.8.0-final plugin under Eclipse 3.5.2, in Windows 7
有没有人遇到这个问题?任何解决方案?
Has anyone else encountered this problem? Any solutions?
推荐答案
Scala插件尚不支持自动完成类型。您可以通过等待出现编译错误来获得类似的结果,按Ctrl-1,然后选择快速修复以自动导入类型。
That type of auto-completion is not yet supported by the Scala plug-in. You can get a similar result by waiting for the compile error to appear, pressing Ctrl-1, and selecting the quick fix to automatically import the type.
请参阅快速新的值得注意发布。
2011年9月更新:
Luc Bourlier有提出了改进,为类路径中的类型提供自动完成。它将在下一个测试版(2.0.0-beta11),或抓住每夜的构建。
Luc Bourlier has committed an improvement for this to give autocompletion for types on the classpath. It will be in the next beta (2.0.0-beta11), or grab a nightly build.
这篇关于Scala Eclipse自动完成破碎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!