What's your preferred Atom setup for developing Rust?


#1

Hey all!

First off, just want to say as a newcomer to this community from Javascript, that I’m really enjoying the language and a big part of why is because of the amazing community around it. So thanks for that!

Anyways, I’ve checked out https://areweideyet.com/ and I’ve been using Atom to write rust, which is convenient since I was already using Atom because of its excellent vim bindings. However, I can’t seem to get my rust setup right on it.

I’ve tried using [Tokamak](https://vertexclique.github.io/tokamak/ but it tends to take over the whole IDE (even for non-rust files) and I don’t seem to get a lot out of it, since I like to run things from the terminal rather than inside of Atom. I’ve tried using Racer + linter-rust + … and I think there may be a bunch of stuff clobbering one another, because a lot of the times they don’t even function properly.

So I was wondering what kind of Atom setup works for you? Ideally it would be nice if mine had things like:

  • Autocompletion
  • Compilation/Linting Errors inline
  • Beautification on save

Thanks so much for your help!


#2

I am using language-rust, linter-rust, racer (autocomplete) and atom-beautify on a rustup installation. Setting up the paths took a while but it works pretty well. I did also try to switch to Tokamak a while ago, but that didn’t work for me.

I’m running my rust code in a separate zsh window which is tiled the side by some Gnome addon and always visible (I don’t feel ready to go i3). With a file tree, a code view, a minimap and a terminal window there are four columns in total and it feels a bit cramped at times. When I don’t have a big monitor attached to my laptop I run atom in fullscreen.


#3

I was using Atom for Rust for about 9 months, having previously used Atom for all my Python development. I did much the same as @roSievers above, but I found recurring problems on macOS (especially with environment variables not being passed through without fuss). I was never able to get Tokamak running properly. I then decided to try Intellij IDEA with the intellij-rust plugin, and haven’t looked back. I’m tempted to try Emacs in evil mode at some point in the future - there are well documented Rust configuration guides [examples here and here].


#4

Thanks for the kind words, @pwrdwnsys !

Have you tried the vim plugin for IDEA? It worked well for me until I’ve switch to something like home row computing.


#5

I use the same setup (except the formatter), but after the last update linter-rust stopped working :’(

The ticket is here https://github.com/AtomLinter/linter-rust/issues/103


#6

I was using Atom with Tokamak.

Then I switched over to VSCode using the Rust and LLDB plugin… personally, I definitely prefer this one.


#7

Thanks so much for all the responses everyone!

So I tried both VSCode and Intellij-Rust and I have to say intellij rust works best for me. Combined with idea-vim, I’m able to be completely productive. Thanks for all of your help and thanks @matklad for the excellent plugin.


#8

Haven’t tried that one in a while, does it allow you to step through the code and debug it? That’s the one feature I love about VSCode’s LLDB debugger.


#9

Not really yet :frowning: I’ve working on debugger support right now, support for CLion should be ready pretty soon (initial version is already in nightly version of the plugin, but it does not work properly yet), no ETA for other IDEs.


#10

I did try it at some point and it was indeed nice and CLion support sounds awesome!

If you let me know or post to the forum when the debugger is working, I’ll give it a try and just might switch over. Thanks.

Just a thought, one other future feature to consider adding in is a performance profiler. Was using one recently in C# and managed to get a program that was taking 9 minutes down to less than 10 seconds to run.

There already is one out there for Linux:
https://www.suchin.co/2016/05/11/Introducing-Cargo-Profiler/


#11

If you let me know or post to the forum when the debugger is working

There’s an issue at the IntelliJ issue tracker, I am posting updates there. I can’t give you a link because GitHub don’t work here for some reason today :frowning:

Yep, a profiler would be nice :slight_smile: At the moment I just use linux perf on the command line, it did help me to get 6x per improvement on one thing as well (https://matklad.github.io/2017/03/12/min-of-three.html) :slight_smile: