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

Workspace does not automatically reload when a package is added to a workspace crate

Open demosdemon opened this issue 1 year ago • 2 comments

rust-analyzer version: rust-analyzer version: 0.3.1860-standalone (5346002d0 2024-02-25)

rustc version: rustc 1.78.0-nightly (6672c16af 2024-02-17)

relevant settings:

  • A cargo workspace with a root Cargo.toml file with only a workspace table and no direct code units.
  • A workspace setting with a glob; e.g.,
[workspace]
members = ["crates/*"]
resolver = "2"
  • A blank crate in crates directory (cargo new --vcs none --bin crates/test-bin)

steps to reproduce:

  • Open VS Code with a workspace project structure and glob members as described above.
  • Add a new package to a crate (cargo new -p test-bin clap)
  • Observe RA does not reload
  • Observe RA does not provide typeahead hints for clap.
  • Manually trigger "Reload Workspace"
  • Observe RA provides typeahead hints for clap.

The bug report for #16550 made me realize #10442 is likely related. RA should always check for Cargo.tomls represented by the workspace members regardless of how deep they are in the tree.

demosdemon avatar Feb 26 '24 16:02 demosdemon

@rustbot claim

alibektas avatar Feb 26 '24 17:02 alibektas

i have the same issues, i think need something like autoDiscoverWorkspace

ashaffah avatar Mar 01 '24 01:03 ashaffah