What’s New in IntelliJ Rust
In this post, we’ll take a look at the updates that IntelliJ Rust has received over the 2020.1 release cycle.
But before we start, we have an exciting announcement that we would like to share. It is now possible to debug your Rust code in IDEs other than CLion! Here are a few more details:
- It’s available in IntelliJ IDEA Ultimate, AppCode, and RubyMine starting with version 2020.1.
- It works with LLDB on macOS and Linux.
- It requires the nativeDebug plugin to work in IntelliJ IDEA Ultimate.
- It requires you to download the debugger binaries, which are not bundled. The IDEs will prompt you to do this.
Now, let’s get back to the plugin updates:
Improvements to LLDB support
If you are working on macOS or Linux, you have the choice to use LLDB as your Rust debugger. LLDB doesn’t natively support Rust and treats it as C code by default, so the plugin has to do its part to make your debugging experience more convenient. You can track the progress of this ongoing work in this umbrella ticket.
As a basis for improving LLDB support, we took the ‘rust-enabled lldb’ patches developed by Tom Tromey, fine-tuned them to suit the recent versions of the debugger, and applied them to CLion’s bundled LLDB.
This patched version of LLDB brings long-awaited improvements in type representation. Now the debugger can properly show enums and primitive types like
i32, which was previously displayed as a C-style
The patched version of LLDB is also capable of demangling Rust function names, which allows the plugin to show them in a human-readable format inside the call stack (notice the Frames pane in the screenshot below). Moreover, demangled names are now available for Evaluate Expression. Simple function calls like
fn foo() -> i32 can already be included in the expressions, and we are working on handling more complicated cases.
A major novelty of this release is the REPL console, an interactive read-eval-print-loop environment for prototyping and testing your code. This handy tool is a notebook, a calculator, and a Rust interpreter all in one.
Implemented on top of the evcxr_repl utility, Rust REPL provides syntax highlighting and completion for the code lines you type. It also shows a pane with the list of variables, functions, and structures currently in use.
To open the console, call Tools | Rust REPL or search for REPL in the Find Action dialog (
Ctrl+Shift+A on Windows/Linux,
Updates to language support
The first change to note here is the introduction of code insight for
impl blocks with type aliases. For performance reasons, this has been enabled only for types with fewer than a predefined number of aliases (the threshold is set to 10 at the moment).
Code insight has also received some improvements. If some of the local variables or parameters are never used, you will see them highlighted in grey:
The return type mismatch check is now equipped with a quick-fix:
A new inspection, Lift return, identifies
match expressions where
return can safely be pulled up from the branches:
And the list of refactoring intentions has been enriched, as well. You can now extract
enum variants into separate structures and edit them while simultaneously affecting all usages:
Those are the most notable changes we’ve made to IntelliJ Rust for the 2020.1 release. Please share your feedback with us, and if you encounter any issues, don’t hesitate to report them in the plugin’s tracker. Thank you!
Your Rust team
The Drive to Develop
Subscribe to Blog updates
Thanks, we've got you!
CLion 2023.3 EAP2: Support for Device Tree Files and Meson
The CLion 2023.3 Early Access Program has just started, featuring assembly view for files, enhanced C++ data flow analysis, and other updates. The CLion 2023.3 EAP2 build is ready for you to try! With it, you can finally start working on Meson projects in CLion and benefit from device tree format s…
The CLion 2023.3 Early Access Program Is Open
We recently shared our preliminary plans for v2023.3, which we plan to release at the end of November. We are now happy to announce that the CLion 2023.3 Early Access Program (EAP) starts today! Our EAP lets the community participate in discussions devoted to our products and influence the developm…
CLion 2023.2.2 Bug-Fix Update
The CLion bug-fix update 2023.2.2 is now available! The fixes included in this bug-fix update are listed below. Download build 232.9921.42 from our website, through the Toolbox App, as a snap package for Ubuntu, or via a patch from inside the IDE. DOWNLOAD CLION This update’s main highlights includ…
CLion 2023.2.1 Bug-Fix Update
The CLion bug-fix update 2023.2.1 is now available! If you haven’t yet upgraded to v2023.2, now is definitely a good time to do so! The key enhancements in the major 2023.2 update include: The Beta version of AI Assistant is now available as a plugin with limited access. Streamlined integratio…