rust-lang / rust-lang/rust-analyzer
Support to force #[cfg(foo)]
Open
Nobody has claimed this yet.
A-config
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
In my program I have many conditionally compiled blocks of code using #[cfg(foo)]. Important note, these are not features. They do not look like #[cfg(feature="foo")]. As it stands there is no way to force rust analyzer to set this cfg.
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
Start by tracing how rust-analyzer obtains and applies cfg settings, comparing support for #[cfg(feature="foo")] with bare #[cfg(foo)]. Done means users can configure arbitrary cfg names and rust-analyzer correctly analyzes the corresponding conditional blocks.
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
- 42/100