Atom or IntelliJ for Rust?

I'm thinking of leaving my comfortable Vim world and learning a fancier editor or IDE such as Atom or IntelliJ.

Money aside (I can afford a subscription), which would you pick and why?

2 Likes

Why not give them both a try? I haven't used Atom too much, but I really love how powerful IntelliJ is its understanding of Rust code. Refactoring, autocomplete, parameter hints, quick doc are all very advanced given how young Rust is. intellij-rust downloads crate dependencies so that you can navigate into them from your project. This has been essential for learning how to use open source Rust crates.

intellij-rust is free if you use it with IntelliJ Community, PyCharm Community, or Android Studio. If you want to use the beta-quality debugger, you'll need a CLion license, though.

Full list of features here: https://intellij-rust.github.io/features/

7 Likes

I really dig the ide-rust package for Atom. There are a few other components to install as well; rls and racer, for example.

1 Like

I have tried Visual Studio Code + Rust RLS plugin and Intelij Idea / CLion + Rust plugin as these are the most maintained, more active and trying to aim for bigger. VS Code is upfront with RLS. Intelij / CLion plugin is upfront with intellisense and code assistance.

Ultimate high-bar for any IDE would be the level of Intelij Idea. However both are far from achieving it (as of today). And Rust is desperate to have a decent one to overcome it's complexity for learners (and experts too, who are reading unfamiliar code, see this or this for example ). Moreover, both even tell it is still significantly work in progress and many features are still missed. However, you will find that both are far more advanced in intellisense and code assistance and navigation (especially Intelij) when you would find in vim (I assume it still uses the analogy of ctags or etags for navigation to identifiers).

Choosing between VS Code or Intelij / CLion is matter of preference. I like Intelij/CLion because it is closer in "completeness" of intellisense and code assistance than VS Code (see this for example). However, VS Code + RLS does in-flight compilation and error marking, which is useful but I still need to compile in the terminal from time to time to get more complete error messages.

Update on 07/03/2018:
Intelij Rust does in-flight compilations via cargo check now. It needs to be enabled in settings.

5 Likes

Either use IntelliJ, Visual Studio Code or Sublime Text.

Personally I prefer Sublime Text because it is super fast compared to the others. But it lacks RLS support right now, but the Rust plugin is also continously improved.

https://github.com/rust-lang/rust-enhanced

It will finally also get RLS support I guess.

3 Likes

The IDEA does not support debugging, therefore I bought a license for commercial CLion of JetBrains, using its Rust-Plugin. I like its very good code expansion, and integrated debugger. The tooling is working out of the box. Just, if I want to create a new Rust-Project, I am using Idea.

6 Likes

I've always been disappointed with either the ergonomics (Vim, Emacs) or performance (VSCode, Atom, Jetbrain IDEs) of popular Rust editors, and your comment led me to give Sublime another try. Indeed, it does not disappoint on this front.

As in my previous trials, I find that editor's habit of throwing config files in my face instead of providing a proper configuration GUI somewhat off-putting, but it seems that this is a losing battle since most other modern code editors are going in that direction as well, so maybe I'll just need to get used to this one.

4 Likes

Yeah. Sublime Text is really fast and I like that. Myself, I use a combination of Sublime Text and Emacs. A proper configured Emacs or Vim is really useful if you need to use an editor without any windowing system. :slight_smile:

1 Like

I don't know when you last tried VS Code, but it's also gotten really quick—I can't see any difference in use between it and Sublime (Atom and JetBrains IDEs are a very different story; they feel noticeably slower/heavier to me). The main place you might run into a difference is in the memory characteristics with Code.

1 Like

Just gave it another try, and on my Linux machine, the difference is still very large. VSCode takes multiple seconds to start up and respond to user action, the top menubar exhibits lots of lag and visual artifacts when opening menus and switching between them, any button also lags perceptibly, any windows resize is ridiculously bad with visual artifacts and lag all over the place... It feels like using an X application over SSH on a remote server more than like interacting with something that is running on my desktop.

In contrast, SublimeText 3 will happily race alongside GEdit on the UI performance front, with a reasonable sub-second startup delay and no noticeable lag or visual artifacts during normal use.

3 Likes

I use VIM on linux and don't see the need for anything "fancier" as I will always put a VIM plugin on the thing xD

I tried Sublime Text with Rust-Enhanced on Windows and it's really good, Sublime Text stays my prefered "text editor" on Windows (Gvim is slowly replacing it).

I would trust anything from Jetbrains or it's community, I have a full license (perks of being a student) and all their IDEs are amazing.

I always hear good things about Visual Studio Code, it seems like a great option too.

Atom is the editor that I like the works. I wasn't able to make it work on Windows (for Rust), but I didn't try very much either.

This is a link to see: Are We Ide Yet

I will try them all on Windows and Linux when I have time and come back here.

2 Likes

After testing, here are the results: (Please consider that I only used each editor for minutes ! This was just to understand the differences for the setup and quick use)

Vim is complicated to setup (but once you get used to it there are no issues and it gets easier as you progress). It was REALLY slow to open up the first time and then was fast enough (under 5 seconds is OK, I don't close vim usually, I have keybinds for everything that I need). You need the syntastic plugin as well as the youcompleteme for it to be usable (IMO). Then you can add vim-snippets and all of the plugins that you want to get the experience YOU want (this is what I love about VIM). Youcompleteme can be slow at times. EDIT: Correction, Youcompleteme is really fast, shellinabox is not though, and this is what I'm using most of the time right now. What is slow is Syntastic, but I found the excellent ale plugin that is async in Vim8 and Neovim (I didn't have Vim8 or Neovim on my server). I highly recommend Ale from now on for programming on Vim unless you need a language that it doesn't support.

Sublime Text 3 is fast. it only needs Rust Enhanced and RustAutoComplete to be fully usable. It's easy to setup (only RustAutoComplete needs to know where your sources are and you're ready to go). It seems like it's the fastest (using racer).

Visual Studio Code was a first for me. I tried it with racer and it's slow to update... Like a minute or two slow... But with RLS ON, oh boy, it's not the same experience at all! real time errors are great! Definitely the fastest BUT you have to have the nightly toolchain installed. Only one extension is needed, Rust and you can choose slow mode (legacy) or RLS (really, realy fast). Interface is different but I like it ! AND I'm not done! It works on Windows ! You only need to install RLS with the instructions from their git.

Atom is slow and I just don't like the interface. I don't know why. It can be useful for web devs but for rust it takes over a minute to update. Too slow. Maybe the languageserver-rust plugin would actually make it usable, but I'm biased here. I don't like this one for reasons (I don't even know myself). It still seems like a great editor. Your choice on this one, test it.

IntelliJ Rust doesn't seem to work well enough for me. The simple test of writing:

let string: String = "hello";

Didn't return an error without me having to build the thing. Not ideal. When it will be more developed it would be a no brainer for anyone that is used to the Jetbrains tools. Didn't pass for me.

Conclusion:
After a quick test, Sublime Text and Visual Studio Code seem to be the best choices. Sublime is fast, even with racer. I've also seen some discussion on RLS for Sublime and this: LSP. Maybe this is worth giving a try ?
Visual Studio Code is ONLY usable with RLS and this is why it's not my first choice. To use RLS you need to have the nightly toolchain installed and I think it is unlikely that you are using the same toolchain to compile and run your projects.
My own preference goes to VIM because I'm getting used to it and really like how it works. Plus I mostly work directly on my server right now because I am making a web server backend for my website. So VIM seemed logical for me.

Don't take this too seriously, I did it in one night. Just to try everything out. @CleanCut I think you should try Sublime Text 3 and Visual Studio Code yourself.

5 Likes

Intellij doesn't have a dedicated IDE for Rust. It does have a Rust plugin but you won't get all the language-dependent-features you normally get from Intellij products. I'm using the Rust plugin on Phpstorm and had no issues so far though sometimes I wished certain features were implemented.

2 Likes

In the settings panel for IntelliJ, there is a setting called something like "use cargo check to analyze code". It's unchecked by default, but if you enable this feature, the type of error you just gave as an example will be flagged with a few seconds. It's not as instant as IntelliJ is with java, but it's pretty good on my projects. In my experience there are 3 problems with this worth mentioning:

  • Sometimes things get "stuck", so you might fix an error, but cargo check either won't be re-run, or the highlights on the error won't clear. This seems to be fixed by just making a trivial edit (which triggers another cargo check).
  • It's possible that one type of error (like a syntax error) can cause "cargo check" to exit as soon as it sees it. The effect of this is that other errors will not be flagged until the first error is fixed.
  • The larger your project is, the slower cargo check will be.

I would be curious to hear your thoughts on the IntelliJ Rust plugin after enabling this "use cargo check" feature.

There are other useful features, so I would encourage people who think IntelliJ + Rust might work for them to give it a try. I've personally been very pleased.

4 Likes

Niether. Use Microsoft Code with Vim extension.

1 Like

Do other IDEs other than intellij-rust provide type and parameter hints inline? For me that's the killer feature as of now.

4 Likes

I have not seen others doing this (VS Code, Atom). I have also placed the request for more hints like this. See here for example. Hopefully, others will like it too.

I've used a variety of editors and IDEs for working in Rust on the side. The best options for me have been VSCode if you want to use RLS and Intellij IDEA Community with the Rust plugin. IDEA + plugin is amazing if you're looking for type and method navigation. It works on everything. It's my main editor/IDE for working on the compiler because it just works, and it's fast (Though I'm using it on a 16 core machine with 32GB of RAM, so take that with a grain of salt).

VSCode with RLS isn't as good in the intellisense lookups or working with a project that's not typical (compiler, anything with special build scripts), though those are all work in progress. It is better at working with the latest nightly though and has support for the latest nightly syntax changes since it's directly coupled to the compiler. I've run into weird errors where IDEA highlighted a bunch of code as an error because it's reimplementing the parsing and lags behind a little.

I've also used the Atom client, and just found it slower than the other two. I haven't used it in some time.

My recommendation is to just try them all and see what you like best. The Atom integration may have improved since the last time I tried using it.

3 Likes

I use JetBrain's products on my 2 core laptop with 8 gb of ram without any issues, any other editor is still faster, but none has the same features.

This is interresting, does cargo check work better for this case ?

As I have said in my post, it's still slow. Unusable even. I will try to see if I can make it work to add it to my IDE Github page (shameless plug :stuck_out_tongue:)

Yes, different needs for different people. If you're like me and only program on your server with an ssh connection, Vim is a no brainer. But if you are a begginer in Rust, VS Code seems to be the better option right now.

4 Likes

I've never actually tried to use it on the compiler. I'll try it out when I have time.

2 Likes