Skip to main content

wslplugins_macro/
lib.rs

1#![allow(missing_docs)]
2#![allow(clippy::missing_inline_in_public_items, reason = "Macros")]
3//! Provides procedural macros for WSL plugin development.
4use proc_macro::TokenStream;
5/// Attribute macro for WSL plugin V1.
6/// This macro should be used on impl block of `WSLPluginV1` in order to register the plugin that implement this interface
7/// # Example
8/// ``` rust, ignore
9/// #[wsl_plugin_v1]
10/// impl WSLPluginV1 for MyPlugin {
11///     // Implementation details
12/// }
13/// ```
14#[proc_macro_attribute]
15pub fn wsl_plugin_v1(attr: TokenStream, item: TokenStream) -> TokenStream {
16    wslplugins_macro_core::wsl_plugin_v1(attr.into(), &item.into())
17        .unwrap_or_else(|err| err.to_compile_error())
18        .into()
19}