rust-lang / rust-lang/rust-analyzer
Show proc-macro panic backtrace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Some macros panic when expanded by rust-analyzer. For example, xshell::cmd!("echo Ok") panics with message called Option::unwrap()on aNone value. However, it is difficult to debug this panic without having a backtrace.
That's why I'd propose e.g.:
- adding a setting to
proc_macro_srvto capture panic backtraces. - adding a CLI flag to
rust-analyzer diagnosticsto enable this setting.
Or any other way to see a backtrace.
UPD: xshell issue was resolved after upgrading to latest master, but I still think macro panic backtraces are useful for debugging both rust-analyzer and procmacros.
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 reading the proc_macro_srv setting mentioned in the issue and the rust-analyzer diagnostics CLI entry point. Define a supported way to enable proc-macro panic backtraces and verify that a panic during macro expansion exposes a usable backtrace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100