简体   繁体   English

Scala IDE支持自动完成和语法突出显示

[英]Scala IDE supporting autocompletion and syntax highlighting

I'm looking for a good Scala IDE. 我正在寻找一个好的Scala IDE。

I tried the Eclipse (Some time ago) and IntelliJ Idea (In these days) plugins but I am somehow dissatisfied by both of them. 我尝试了Eclipse(前一段时间)和IntelliJ Idea(在这些日子里)插件,但我对他们两个都不满意。 The first it was pretty slow and unstable, while I don't like too much IntelliJ Idea's interface. 第一个是非常缓慢和不稳定,而我不喜欢IntelliJ Idea的界面太多。

Is there any alternative available? 有没有其他选择?

I will work with a SBT project and what I am looking for is mainly syntax highlighting, autocompletion. 我将使用SBT项目,我正在寻找的主要是语法高亮,自动完成。 It would be nice to have partial compilation of the source code as I am not used to Scala syntax and it would help me find errors as soon as I write them. 对源代码进行部分编译会很好,因为我不习惯使用Scala语法,它会帮助我在编写错误时立即找到错误。

IMHO InteliJ is the best IDE for Scala at the moment. 恕我直言InteliJ是目前最好的Scala IDE。 First I had also some problems with the different interface compared with Eclipse. 首先,与Eclipse相比,我在使用不同的界面时遇到了一些问题。 But in the end you profite from the whole package included with IntelliJ. 但最终你从IntelliJ附带的整个软件包中获利。 There is also an active scala plugin development. 还有一个活跃的scala插件开发。

What I like to do is split my terminal once horizontally, and then split the bottom pane once vertically. 我喜欢做的是水平分割我的终端,然后垂直分割底部窗格。

In the top pane I have vim ( emacs works too if you're an emacs person) with the NERDTree plugin (acts like the project folder/file browser in text editors). 在顶部窗格中我有vimemacs工作太多,如果你是一个emacs人)与NERDTree插件(行为,如在文本编辑器中的项目文件夹/文件浏览器)。 On the bottom left I have SBT continuous compilation ( sbt ~compile ). 在左下角我有SBT连续编译( sbt ~compile )。 I use the bottom right pane to actually run code (tests, etc.). 我使用右下方窗格实际运行代码(测试等)。

Regarding auto-completion, you can try something like the Snipmate plugin for vim . 关于自动完成,你可以试试像vim的Snipmate插件。

Also, as stated by Ivan, if you end up using emacs ENSIME seems to be widely liked - unfortunately there doesn't seem to be an ENSIME port for vim yet, at least to my knowledge. 另外,正如Ivan所说,如果你最终使用emacs ENSIME似乎广受欢迎 - 不幸的是,似乎还没有vim的ENSIME端口,至少据我所知。

With this setup, I edit in the top pane, and once I save a file, I get near immediate feedback by just glancing on the bottom left and know when I typo'ed something, or maybe my code is just plain wrong, stuff like that. 通过这个设置,我在顶部窗格中进行编辑,一旦我保存文件,我就可以通过左下角看到即时反馈并知道我什么时候输入错误,或者我的代码可能是完全错误的,像那。

On a slightly related note, I used to use IDE's but they got too messy for my taste (back then I was writing C and C++) so I moved to just a text editor (eg Chocolat, Sublime Text 2) and used a terminal, and that was fine for me for about a year. 在一个稍微相关的说明中,我曾经使用过IDE,但是根据我的口味它们太乱了(当时我正在写C和C ++)所以我转到了一个文本编辑器(例如Chocolat,Sublime Text 2)并使用了一个终端,这对我来说好一年了。 Then this summer I really sat down and tried going vim only and I can honestly say I'm much more productive in my all terminal setup than what I was before. 然后在今年夏天,我真的坐下来尝试只去vim ,我可以诚实地说,我的终端设置比以前更有效率。 Just my 2 cents. 只需2美分。

This all also has the added benefit of working on remote servers as well. 这一切还具有在远程服务器上工作的额外好处。

Scala IDE for Eclipse is under active development and evolving rapidly. Scala IDE for Eclipse正在积极开发和快速发展。 You should give it a try now (I don't know what 'some time ago' means, but if it's more than 6 months you might be pleasantly surprised). 你现在应该尝试一下(我不知道'前段时间'意味着什么,但如果超过6个月你可能会感到惊喜)。 Granted, I am biased since I am a committer. 当然,因为我是一名提交人,所以我有偏见。

You could try ENSIME for emacs. 您可以尝试使用ENSIME进行emacs。 You can also use it with jEdit, Sublime Text 2, and probably more. 你也可以使用它与jEdit,Sublime Text 2,甚至更多。

Personally I use Scala IDE 2.1 (for eclipse). 我个人使用Scala IDE 2.1(用于eclipse)。 It is a lot faster now, and it has gotten to the point where I actually want to use it, after being in a similar situation to you. 它现在快得多,并且在遇到类似情况之后,它已经达到了我真正想要使用它的程度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM