Skip to content

fix: load rust-analyzer.toml for virtual workspaces#21704

Open
Madoshakalaka wants to merge 1 commit intorust-lang:masterfrom
Madoshakalaka:fix/ratoml-virtual-workspace-loading
Open

fix: load rust-analyzer.toml for virtual workspaces#21704
Madoshakalaka wants to merge 1 commit intorust-lang:masterfrom
Madoshakalaka:fix/ratoml-virtual-workspace-loading

Conversation

@Madoshakalaka
Copy link

@Madoshakalaka Madoshakalaka commented Feb 25, 2026

Summary

Fixes the most common case of broken rust-analyzer.toml loading: virtual workspaces

For virtual workspaces, ProjectWorkspace::to_roots() only creates PackageRoots for member crate packages. The workspace root directory itself gets none.

Any rust-analyzer.toml placed at the workspace root then falls into the default (library) source root and is silently ignored by process_changes().

The fix ensures every workspace root is included as a local source root in ProjectFolders::new(), even when no package lives there.

Relates to #13529, fixes #18943.

Virtual workspaces (with no root package) had no local source root for
the workspace root directory, causing rust-analyzer.toml placed there
to fall into a library source root and be silently ignored.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 25, 2026
@Madoshakalaka
Copy link
Author

Madoshakalaka commented Feb 26, 2026

Note: Veykril mentioned in #18943 that fixing ratoml loading was blocked on reworking the file system infrastructure (#18948). This PR doesn't attempt that. it's a targeted fix to a broken case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust-analyzer.toml

2 participants