rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

Missing .rmeta for local dependency #949

Open Barugon opened 2 years ago

Barugon commented 2 years ago

Here are the steps to reproduce:

  1. Clone gdal
  2. Create a new Rust project next to the gdal folder
  3. Edit the new project's Cargo.toml file to include this dependency: gdal = {path = "../gdal"}
  4. Add an import for gdal in main.rs. Example: use gdal::*;

Here's the error that I see in VSCode: Screenshot from 2022-04-11 17-05-49

If I look in the target/rls/debug/deps folder then, sure enough, the .rmeta (and .rlib) files are missing for gdal. The project does build normally and those files are present in the target/debug/deps folder.

lnicola commented 2 years ago

Would you mind giving the https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer extension a try?

image

Barugon commented 2 years ago

Would you mind giving the https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer extension a try?

Thanks, I'll give it a go.

lnicola commented 2 years ago

See https://blog.rust-lang.org/2022/02/21/rust-analyzer-joins-rust-org.html for context. IIRC, RA has some problems with the gdal-sys types, but I haven't looked into those. They might be related to the build script.

Also, hello from GeoRust :smile:.

Barugon commented 2 years ago

Hmm... bummer that rust-analyzer seems to ignore my tab size setting.

lnicola commented 2 years ago

https://github.com/rust-analyzer/rust-analyzer/issues/1191, but you should enable format on save, make a rustfmt.toml and configure it there.

EDIT: well, I can see how that could be quite annoying.