New Features

  • Support Find Usages action (Edit | Find Usages or Alt+F7) for Cargo features. Note, in order to make this feature work, you need to update your TOML plugin to the latest version as well

  • cfg attribute support improvements:
    • Provide completion for feature argument of cfg attribute as well as completion for values of Cargo feature themselves

    • Gray out cfg-disabled items in structure view
    • Provide name resolution for Cargo features in doc(cfg()) attributes
    • Handle function arguments under cfg attribute during type inference and analyses
  • Support cfg_attr attribute in some cases during name resolution and completion. In general, the plugin now knows that cfg_attr can be expanded to other attributes, and the following stuff was adapted to use this knowledge:
    • Resolve and complete paths of path attribute and traits in derive attributes under cfg_attr
    • Take into account cfg_attr attribute during attribute and lint attribute completion
    • Resolve procedural macro attributes under cfg_attr
    • Add completion for conditional compilation options and operators inside cfg_attr() and doc(cfg()) attributes
    • Provide name resolution for Cargo features in conditional attributes like cfg_attr(docsrs, doc(cfg(feature = "macros")))
    • Extend Attribute without parentheses inspection scope to highlight attributes under cfg_attr

    Note, the plugin can’t evaluate predicates of cfg_attr attribute yet

  • Provide a way to fetch actual info about stdlib packages like dependencies, edition, Cargo features. It should help the plugin understand stdlib structure better. For example, the feature allows providing proper completion and navigation for items defined in std::os module. Note, the corresponding feature works since Rust 1.41 and is disabled by default for now. You can enable it via org.rust.cargo.fetch.actual.stdlib.metadata option in Experimental Feature dialog (Help | Find Action and type Experimental features to open the dialog)
  • Add Redirect input option for Cargo run configuration to provide stdin from the desired file
  • Remove empty use groups by Optimize Imports action (Code | Optimize Imports or Alt+Cmd+O)
  • Provide completion for type_length_limit, windows_subsystem, panic_handler, must_use ignore, used, global_allocator attributes
  • Show Build tool window for wasm-pack run configurations if org.rust.cargo.build.tool.window experimental feature is enabled

Performance Improvements

  • Reduce memory consumption with new name resolution engine. Note, you can enable the new engine via Use experimental name resolution engine option in Preferences | Languages & Frameworks | Rust settings

Fixes

  • Fix cfg attributes support in E0023 detection and the corresponding quick-fix.
  • Create method intention is no longer offered for types from external or stdlib crates (by @Kobzol)
  • Take into account inner attributes like #![allow(deprecated)] in trait items during cfg attribute evaluation, lint suppression, etc.
  • Fix wrong name resolution of Cargo features in cfg_attr
  • Use unqualified paths for references to target mod by Move (Refactor | Move or F6) refactoring
  • Properly validate DTrace settings before running CPU profiler on macOS
  • Make Item is private error highlighting range more precise

Full set of changes can be found here