intellij-rust icon indicating copy to clipboard operation
intellij-rust copied to clipboard

Macro expansion does not work for proto-generated files with `Prost`

Open xiaoyawei opened this issue 3 years ago • 2 comments

Environment

  • IntelliJ Rust plugin version: 0.4.164.4409-212
  • Rust toolchain version: 1.58.0-nightly (8b09ba6a5 2021-11-09) x86_64-apple-darwin
  • IDE name and version: CLion 2021.2.3 (CL-212.5457.51)
  • Operating system: macOS 11.4
  • Macro expansion engine: new
  • Name resolution engine: new
  • Additional experimental features: org.rust.cargo.features.settings.gutter, org.rust.cargo.evaluate.build.scripts, org.rust.macros.proc

Problem description

With the latest version of rust plugin, I cannot expand proc macros in the protobuf files generated via Prost

Steps to reproduce

  1. Clone the prost repo at https://github.com/tokio-rs/prost
  2. Checkout to commit 780d80fb261ebb5f6dc485fddae99b6b48a40aa6
  3. Open the project with Clion which has the latest rust plugin.
  4. Cargo build the project, this step will generated .rs files out of protobuf definitions.
  5. Randomly look at a protobuf generated struct. (I hold my cmd button and click proto3::presence::A in line https://github.com/tokio-rs/prost/blob/780d80fb261ebb5f6dc485fddae99b6b48a40aa6/tests/src/lib.rs#L618-L618)
  6. Try to expand the macro protst::Message, and see the error.

Screen Shot 2022-02-07 at 1 45 09 PM

xiaoyawei avatar Feb 07 '22 05:02 xiaoyawei

Any update for this problem?

caibirdme avatar Jun 25 '22 02:06 caibirdme

Works well on my idea today with the newest version.

Renkai avatar Jul 26 '22 08:07 Renkai