IntelliJ Rust Changelog #146
New Features
-
#6992 Provide initial experimental support for custom derive procedural macros. Now the plugin can expand such procedural macro calls and take into account expanded
implitems in type inference and name resolution (other types of items are ignored for now).
Note, it’s only an initial implementation, so it may work in an unexpected way in some cases. The feature is disabled by default for now. To turn it on, you should enableUse experimental name resolution engineoption inPreferences | Languages & Frameworks | Rustsettings and enableorg.rust.cargo.evaluate.build.scriptsandorg.rust.macros.procexperimental features. Don’t forget to reload a project structure after enabling the corresponding features viaRefresh Cargo Projectsaction on Cargo tool window. See tracking issue for more details and the current status of procedural macros support
-
#7093 Now the plugin takes Cargo config into account during evaluation of
cfgconditions. Note, it works since Rust 1.52.0 (currently in beta)
-
Introduce new intention actions:
-
#6845, #7115
Enable/Disable feature stateto toggles feature state from acfgattribute (by @Kobzol)
By the way, we have a blog post about cargo features support
-
#7071
Share in Playgroundto share a selected Rust code on Rust Playground
Previously, this feature was only available as
Rust | Share in Playgroundaction inToolsand context menus -
#6960
Expand dependency specificationforCargo.toml
-
#6837
Create structto create a struct from an unresolved struct literal (by @Kobzol)
-
-
#5650 Now
Use destructuring declarationintention action replaces usages of destructured variable (by @Kobzol)
-
#6986 Allow specifying the function return type in
Create functionintention action if the inferred return type is unknown (by @Kobzol)
-
Improve code folding:
-
#7111 Support folding for multiline
whereclauses (by @Stzx)
-
#7112 Enable folding for series of use items by default (by @Stzx)
You can disable it viaImportsoption inSettings | Editor | General | Code Foldingsettings -
#7112 Support
Method bodiesoption ofSettings | Editor | General | Code Folding - Generalsettings to fold function/method bodies by default (by @Stzx)
-
-
Improve experimental crate-local index:
-
#6801 Add
Cargo.tomlinspection that checks crate dependency version requirements that do not match any known crate version (by @Kobzol) -
#6599 Use semantic versioning to improve version sorting in dependency completion
-
#7004 Don’t perform code completion and run inspections if the index is not ready
Note, the corresponding feature is disabled by default for now. To use it, enable
org.rust.crates.local.indexexperimental feature -
-
#7142 Drop support of
org.rust.cargo.fetch.out.direxperimental feature. Useorg.rust.cargo.evaluate.build.scriptsinstead if you need to evaluateenv!("OUT_DIR")in yourinclude!macro calls
Fixes
-
Name resolution fixes:
-
#7119 Correctly resolve qualified attribute procedural macro paths (like
#[foo::bar]) -
#7132 Resolve field shorthand to a local variable in the case of unresolved struct literal
-
-
Improvements of new name resolution engine:
-
Change Signaturerefactoring (Refactor | Change Signatureor Ctrl+F6) fixes: -
#7108 Insert correct
useitem by auto-import feature in the case of a renamed Cargo package -
#7101 Fix false positive in
Needless lifetimesinspection when the lifetime is used inwhereclause (by @Kobzol) -
#5491 Add line break after opening brace in struct blocks by built-in formatter (by @Kobzol)
-
#7131 Fix false-positive proofreading warnings for sentences written in several sequential Rust comments. Note, you can enable/disable proofreading in Rust files in
Preferences | Editor | Proofreading | Grammarsettings -
#7121 Reload project model automatically when workspace-root
Cargo.tomlfile is changed (and saved). Previously it was work only for packageCargo.tomlfiles -
#7079 Fix proc macro expansion if proc macro crate is added as separate cargo project in
Cargotool window -
#7072 Place
Show the result of macro expansionintention lower in the intention list -
#6013 Don’t run some inspections on Rust files outside a valid Cargo project to avoid expected false positive errors
-
#7070 Don’t show errors related to Rust edition if we don’t known the edition (by @Stzx)
-
#7150 Fix
Can't find process startererror when running DTrace profiler with CLion 2021.1 -
#6201 Avoid Cargo project duplication in the project model. This fixes some issues related to such duplications
Internal Improvements
-
#7114 Don’t show “Tip of the Day” at startup in internal IDEs (for the plugin developers)
-
#7094 Enable Gradle Build Cache for local builds (see #7094 for more details)
-
#6903 Introduce
2021edition variant in the plugin and adjust the corresponding code
Full set of changes can be found here