

For example, it improves resolve for the code where a macro expands into another macro’s definition. It will also allow the plugin to properly expand the upcoming macros 2.0.Īt the same time, the new algorithm addresses some of the existing macro-related issues. Our new algorithm uses the fixed-point iteration approach and aims to provide better support for complex glob imports ( use foo::*) and re-exports ( use foo as bar). If you are ready to give it a try, enable the Use experimental name resolution engine checkbox in Settings / Preferences | Languages & Frameworks | Rust: The newer version of the algorithm (aka name resolution 2.0) is in the experimental state. We’ve started to redesign a part of the name resolve engine. New experimental engine for name resolution You can now use Move to place a file into another crate or even move multiple files and directories.Īlso, Move is now capable of detecting visibility conflicts (and making a moved item public if required), as well as other compilation errors which may occur during a move, like E0116: An inherent implementation was defined for a type outside the current crate or E0117: Only traits defined in the current crate can be implemented for arbitrary types.Īside from Move, we also added a new Inline ( Ctrl+Alt+N on Linux/Windows, ⌥⌘N on macOS) refactoring for local variables: Related impl-s are now moved together with the items, and the items with related impl– s are grouped together for easier navigation in the refactoring dialog: If you select a piece of code in the editor and then call Move, the refactoring will take your selection into account when suggesting the items to be moved. The Move ( F6) refactoring now supports re-exports when moving a file: If you select a region and call Reformat Code ( Ctrl+Alt+L on Linux/Windows, ⌥⌘L on macOS), the IDE’s formatter will be used instead. If you would prefer Rustfmt to be the default formatter for your code, tick the Use rustfmt instead of built-in formatter checkbox in Settings / Preferences | Languages & Frameworks | Rust | Rustfmt.Ĭurrently, this option doesn’t apply when reformatting a selection. You can also jump to a feature declaration from a cfg or cfg_attr attribute in your Rust code: IntelliJ Rust now gives completion suggestions and provides navigation across features in Cargo.toml. Now let’s take a look at the improvements that have been made to this functionality already, along with other updates the plugin has received over the last few months: In brief, you can now toggle workspace features right in the Cargo.toml file, and code insight across the whole of your project will be adjusted accordingly.
#Intellij rust update
In the previous blog post on IntelliJ Rust, we described the plugin’s major update of the 2020.3 release cycle – more support and a new UI for Cargo features. New experimental engine for name resolution.
