Found two editors with built-in rust support

Since I am new to Rust, I don't know if there are as yet any usable IDEs for rust, but I do find two editors with built-in rust support. They are Notepad++ and Vim. Here are two screenshots I just took:

I hope someone could tell me that there is a better solution, I mean, usable IDEs including automatic invocation of compiler and debugger.

The IntelliJ IDEA IDE has a Rust plugin that works really well and integrates nicely with Cargo. It can highlight incorrect syntax and also provides code completion and all the other good things an IDE should have. It also has a plugin for Cargo's TOML files: it can even install the package automatically when you make a change to it.

6 Likes

Rust support is good in most editors these days
Personally I use Rust Enhanced which is a plug-in for Sublime Text

Syntax highlighting
Code completion (with RLS on)
Build within the editor
Syntax checking (automatically on save)
TOML highlighting

Have a look at the readme.

It lacks a debugger though, so if you want that you could loook at the Rust plugin for visual studio code

3 Likes

Builder, the best IDE for Rust Apps/Builder - GNOME Wiki!

1 Like

I use VS Code for editing, along with the Rust (rls) plugin. It provides highlighting, code completion, syntax checking and all that. I prefer compiling and running tests from the command line though.

Rust is better off than C/C++ in that building, running tests, or generating docs is stupidly easy, you just need to run cargo build, cargo test, or cargo doc respectively.

3 Likes

I too use VS Code for Rust which is surprisingly a darn good editor.

Does the profiler work well with Rust out of the box?

You might find https://areweideyet.com useful. It gives an overview of the state of Rust support in a number of editors and IDEs.

9 Likes

Thank you! This is the most valuable info!

Based on the information, I have chosen sublime text. It is so much more elegant than both notepad++ and vim, and also with built-in syntax highlighting. However its dark theme needs some getting used to.

1 Like

I personally found it worthwhile to look around a bit for sublime themes around the web. There is a nice light theme inspired by Github's color scheme, and the dark version of Ayu is pretty slick too!

Don’t just choose based on the information. Try them. It doesn’t take long, and you might be surprised at what else you find. I never thought I’d ever use a Microsoft produced editor as my main tool, but I do. There are tons of plugins. IntelliJ, I thought would be a no-brainer, as I used their GoLand IDE and loved it, but found it a bit too heavyweight.

I recommend IntelliJ IDEA + The IntelliJ Rust plugin - I personally think it is better than the other options.
The setup is painless.

2 Likes

No one talks about GNU Emacs?
Rust-mode is built-in, and with racer and yasnippets is great and very productive!

3 Likes

Yup. Emacs with rust-mode for editing, magit for git for version control, rustfmt called via shortcut for formating/pretty printing, compiling via simple Makefile calling cargo, and jumping from resulting error/warning messages directly into the Rust code. All without ever leaving Emacs ... :heart_eyes:

2 Likes

It really depends on what priorities you have. As much as I hate electron, VS Code is decent for what it is (definitely when compared with the trainwreck that is Atom). It probably has the biggest community as well.

I personally use Sublime with rust-enhanced + the RLS server since it's much kinder on memory usage. My other recommendation is Vim (specifically nvim), however it can be tricky to set up autocompletion and RLS in general.

I might check out @wahn's recommendation too with emacs, despite me being a vim supremacist :wink:

Try it with evil-mode, feels like vim with all the emacs goodies. Setting up emacs for rust was way simpler than vim, eventhough I've never used emacs before.

1 Like

For me, it's VS Code with the Rust extension using the Rust Language Server. It still has some annoyances like no support for showing popup function signatures while typing the parameters, but otherwise it's pretty great.