rust-lang / rust-lang/rust-analyzer
Read global ratoml before first config query
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
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:
Originally posted by @cormacrelf in https://github.com/rust-lang/rust-analyzer/issues/17661#issuecomment-2253044846
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue points to crates/rust-analyzer/src/bin/main.rs around lines 268-273 and PR #17246. Read those startup and configuration paths first, then trace how workspace discovery depends on rust-analyzer.toml. Done means a configuration can be found before the first workspace or configuration query, including [workspace.discoverConfig] settings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100