Skip to content

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

Open
@demosdemon

Description

@demosdemon

rust-analyzer version: rust-analyzer version: 0.3.1860-standalone (5346002 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions