Skip to content

Commit

Permalink
docs(ast_tools): reformat docs for #[ast] proc macro (#7437)
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Nov 23, 2024
1 parent bc0e8bc commit 63f4d6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/oxc_ast_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ mod ast;
/// It marks where `Visit::enter_scope` and `Visit::exit_scope` events should be fired for this AST type.
///
/// ## `#[visit(args(arg = expr))]`
///
/// This attribute can only occur on `struct` fields, or `enum` variants.
/// Accepts an argument name and an expression.
/// `expr` is an expression that would evaluate to `ScopeFlags`.
/// This argument can only be used at places where the AST type is `Function`.
///
/// ## `#[span]`
///
/// This attribute can be used to hint to `ast_tools` which field should be used to obtain the span
/// of this AST type.
///
/// ## `#[generate_derive(...)]`
///
/// This attribute has the same purpose as Rust's `#[derive(...)]` macro.
/// It is used to derive traits for the types.
/// However, instead of expanding the derive at compile-time, we generate the derived code at build time
Expand All @@ -55,6 +58,7 @@ mod ast;
/// defined in.
///
/// ## `#[ts]`
///
/// Marks a struct field as only relevant for TypeScript ASTs.
///
/// # Derive Helper Attributes
Expand All @@ -63,6 +67,7 @@ mod ast;
/// via `generate_derive`.
///
/// ## `#[clone_in(default)]`
///
/// This attribute is only used by `CloneIn` derive.
/// `struct` fields marked with this attribute at cloning will use the `Default::default()` value
/// instead of `CloneIn::clone_in` to initialize.
Expand Down

0 comments on commit 63f4d6c

Please sign in to comment.