Description
A month ago, rust-analyzer
enabled by default a feature called experimental.procAttrMacros
. This aims to provide better support for procedural macros, however it may cause issues with some crates that are not error resilient in this sense, making entire impl blocks unable to have auto-completion unless experimental.procAttrMacros
is explicitly disabled globally. At the moment two major crates (tokio
and actix-web
) had this problem fixed in master.
Here is an example of what it looks like in practice: https://youtu.be/vhrOrfrNYlw
The correct fix, as suggested by rust-analyzer
's folks (see rust-lang/rust-analyzer#10498, rust-lang/rust-analyzer#10611 and rust-lang/rust-analyzer#10468 for more details) would be for the crate to also report the original input as well, so that IDE can correctly recover.
Here are the patches that fixed the issue:
- make runtime macros more IDE friendly actix/actix-net#391
- attributes: speculatively expand when parsing fails tokio-rs/tracing#1634
- Make tokio-macros attributes more IDE friendly tokio-rs/tokio#4162
I tried to fix the issue in my own branch (https://github.com/asdrubalini/async-trait/tree/be-friendly-to-ides) without success, as it seems that both args
and input
parsing always return Ok. I am going to debug again tomorrow, but any suggestion is appreciated.