Given https://github.com/rust-lang/rust-analyzer/pull/17246, it's still not being read early enough -- there is a pretty big chicken/egg problem with configs like this:
[workspace.discoverConfig]
...
We don't read rust-analyzer.toml until workspaces have already been discovered (to find the root), and we can't discover a workspace because haven't read it. I think we need to search upwards from the current working directory to find a rust-analyzer.toml to use on startup.
For rust-analyzer.toml users, these configs will never be populated in src/bin/main.rs:
|
if config.discover_workspace_config().is_none() |
|
&& !config.has_linked_projects() |
|
&& config.detached_files().is_empty() |
|
{ |
|
config.rediscover_workspaces(); |
|
} |
Originally posted by @cormacrelf in #17661 (comment)
We don't read rust-analyzer.toml until workspaces have already been discovered (to find the root), and we can't discover a workspace because haven't read it. I think we need to search upwards from the current working directory to find a rust-analyzer.toml to use on startup.
For rust-analyzer.toml users, these configs will never be populated in src/bin/main.rs:
rust-analyzer/crates/rust-analyzer/src/bin/main.rs
Lines 268 to 273 in f46af90
Originally posted by @cormacrelf in #17661 (comment)