Skip to main content

editor_config

Macro editor_config 

Source
macro_rules! editor_config {
    (
        impl $ty:ty {
            $(
                $field:ident => {
                    label: $label:literal,
                    kind: $kind:ident
                    $(, values: [$($value:literal),* $(,)?])?
                    $(, optional: $optional:literal)?
                    $(, nested: $nested:ty)?
                    $(, default: $default:ty)?
                    $(,)?
                }
            ),* $(,)?
        }
    ) => { ... };
    (@kind Boolean) => { ... };
    (@kind String) => { ... };
    (@kind Integer) => { ... };
    (@kind Enum) => { ... };
    (@kind StringMap) => { ... };
    (@kind Json) => { ... };
    (@kind Section) => { ... };
    (@values) => { ... };
    (@values $($value:literal),*) => { ... };
    (@optional) => { ... };
    (@optional $optional:literal) => { ... };
    (@nested) => { ... };
    (@nested $nested:ty) => { ... };
    (@default) => { ... };
    (@default $default:ty) => { ... };
}
Expand description

Implements EditorConfig for a configuration type.

This macro intentionally keeps editor metadata next to the Rust config type while avoiding proc-macro reflection. Field order is declaration order inside the macro invocation.