Skip to content

async-trait is not IDE friendly with the latest rust-analyzer version #178

Closed
@asdrubalinea

Description

@asdrubalinea

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions