Skip to content

Provide an option to exclude particular proc macros expansion #11052

@Veetaha

Description

@Veetaha

As for now, the expansion of proc macros works good enough, however, not always. For example, if we are modifying the code that is fed to a proc macro the user experience is very poor. The main use case is writing code under #[async_trait]. The default behavior where #[async_trait] isn't expanded and analyzed is much smoother: we don't see the code highlighting broken. So the general IDE experience is way better when #[async_trait] isn't expanded by rust-analyzer's logic.

I propose to add configuration knobs to rust-analyzer that specify the list of macros that the user explicitly doesn't want for the IDE to ever expand.

Another potential use case that we can imagine is excluding special macros that do some expensive I/O or CPU-intensive work and they are not important for the general IDE experience, so we would like rust-analyzer to ignore them.

Metadata

Metadata

Assignees

Labels

A-configconfigurationA-macromacro expansionBroken WindowBugs / technical debt to be addressed immediatelyS-actionableSomeone could pick this issue up and work on it right now

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions