-
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
impl_scope! { ... }
and impl_anon! { ... }
should be formatted internally just like a module. rustfmt
does not currently support this: see rust-lang/rustfmt#5538.
#53 introduced #[impl_self] mod { ... }
as a replacement for impl_scope! { ... }
. The usage of a fake module appears to have completely solved rustfmt
compatibility, but comes with a new problem: rust-analyzer
sometimes inserts use ...;
statements inside this fake module, leading to macro parse errors.
Possible solutions:
- Wait for
rustfmt
to support formatting braced-wrapped macros as a module? - Try getting
rust-analyzer
to ignore the fake module? This seems an unlikely approach; it would require r-a to either have an exception for this macro or expand macros before addinguse
statements (which may also have issues). - Propose an RFC with similar functionality to the above? There have been some related proposals in the past (example).
Metadata
Metadata
Assignees
Labels
No labels