rust-lang / rust-lang/rust-analyzer
The formatcp! macro does not work when the project root does not have Cargo.toml.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: 7d6fcbc0b 2021-12-06 stable
rustc version: rustc 1.58.0-nightly (b426445c6 2021-11-24)
It looks like the formatcp! macro from the const-format crate combined with another macro cannot work if the project root is not a rust project in VSCode. But it works fine if I open the rust project as project root. It also works fine when it is used outside of our component! macro. So there are multiple things needed for the bug.
Our project structure:
web-frontend (has Cargo.toml)
...
frontend-svg-react (does not have Cargo.toml)
...
relate_wasm (has Cargo.toml)
component_macro (has Cargo.toml)
...

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
Reproduce the reported formatcp! and component! macro combination using the nested web-frontend, frontend-svg-react, relate_wasm, and component_macro project layout. Compare behavior when web-frontend versus relate_wasm is opened as the project root; done means the macro works correctly in both layouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100