IntelliJ Rust

Open-source Rust plugin for IntelliJ-based IDEs

Install

Stable builds

IntelliJ Rust is in active development, and we regularly publish new stable builds to the JetBrains plugin repository. You can download and install them directly from Settings / Preferences | Plugins | Marketplace in your IDE.

Nightly builds

In addition to stable releases, we also ship nightly snapshots of the intellij-rust development branch. To use the nightly channel, add a custom plugin repository and set the following URL:

https://plugins.jetbrains.com/plugins/nightly/8182

Compatible IDEs

The plugin is compatible with all Intellij-based IDEs like IDEA, CLion, or PyCharm. The latest plugin version supports the latest released platform version (for example, 2019.2).

Bug reports and feature requests

Please use our tracker. You can get there quickly right from the IDE: call Create New Issue on a selected piece of code, and you’ll jump to a pre-filled issue creating form.

Also feel free to ping us on Gitter.

×

Source

Intelligent Rust

editor features

IntelliJ Rust brings JetBrains-quality language support and full IDE experience to your Rust workflow.

Rust becomes native to IDEA, CLion, and other IntelliJ IDEs with smart coding assistance, seamless Cargo support, and built-in test runner.

In CLion, you get even more: fully-fledged debugger, CPU profiler, and Valgrind memcheck.

What's new

IntelliJ Rust Changelog #116

New Features

  • Improve the new macro expansion engine in order to support nested modules declared with macros. Now the plugin provides code completion and other code insight features for crates like tokio and async-std in proper way. Note that you should enable the new macro expansion engine via Preferences | Languages & Frameworks | Rust | Expand declarative macros option.
  • Support custom test attributes like #[tokio::test] (by @Kobzol)
  • Add liveness analysis. Now unused local variables are highlighted as unused.

  • Support impls for trait objects. Now the plugin provides name resolution and completion for items declared in impl dyn Trait {} (by @rrevenantt)
  • Experimentally support items generated by build scripts. Recently, we did a first attempt to support build scripts. In this release we’re trying to use compiler output to get info about generated items. The output contains all environment variables generated by a build script, so now we support not only env!("OUT_DIR"), but any env!("FOO_BAR"). Also, it brings support of cfg options set by a build scripts, e.g. #[cfg(foobar)]. To turn it on just enable org.rust.cargo.evaluate.build.scripts option in Experimental Features dialog. Note that under the hood it uses cargo check, so this can significantly slow down project import.
  • Support referring to enum variants through type aliases from Rust 1.37
  • Comments generated by Comment with / action (Ctrl+//Cmd+/) now follow Rustfmt style. You can change this behavior in File | Settings | Editor | Code Style | Rust | Code Generation. (by @SeekingMeaning)

  • Implement members quick fix improvements:

    • Do not expand type aliases (by @Kobzol)
    • Select content of the first item after generation of missing items (by @Kobzol)
    • Generate Fn-family traits in the correct way (by @rrevenantt)

Performance Improvements

  • Function bodies are now skipped by the parser during indexation. This speeds up the indexation process by about 20% and improves macro expansion speed (if you use the experimental expansion engine).
  • Function bodies are now parsed incrementally. This means that when you’re typing in a function body, only the body will be re-parsed. This can speed up code completion in large documents.
  • Slightly optimized parser

Fixes

  • Correctly parse crate-qualified paths in tuple struct fields (struct Foo(crate::foo::Bar))
  • Fix “Run with coverage” on 2020.1
  • Take into account type aliases in Type Info action (ctrl+P) (by @Kobzol)
  • Show Cargo tool window after attaching a first cargo project
  • Fix type checking for async blocks
  • Highlighting improvements:
    • Fix highlighting blinking on the dark theme
    • Don’t incorrectly highlight a variable as primitive type if it has primitive type name like let i32 = 1;
    • Fix highlighting of string literals inside attributes like #[foo("bar")]
  • Display ?Sized trait bound properly for impl blocks in structure view (by @rrevenantt)

  • REPL integration improvements:

    • Rust REPL now is not experimental. You can find it in Tools | Rust REPL (by @dima74)
    • Don’t add commands with errors to completion context (by @dima74)

Internal Improvements

  • New parser benchmark

Full set of changes can be found here