Cargo vendor and rust-analyzer

I have a project with vendored dependencies via cargo vendor. To edit it, I'd like to use rust-analyzer, but this needs to load the crates on which std depends (e.g. cfg-if 1.0.1). How can I vendor those as well?

I see this is an open issue in Rust: Support `cargo vendor` · Issue #23 · rust-lang/wg-cargo-std-aware · GitHub. Unfortunately, stable cargo vendor can't parse the Cargo.toml or Cargo.lock in std.

This is apparently also related to rust-analyzer unable to find rust-src after update to 0.3.2509 · Issue #20250 · rust-lang/rust-analyzer · GitHub.