Skip to content

dx fmt eats comments #5249

@mcmah309

Description

@mcmah309

Problem

dx fmt is eating comments

Steps To Reproduce

Steps to reproduce the behavior:

fn x() {
    rsx! {
        button { class: "control-button", onclick: move |_| async move {
            // comment
             () }, "print content" }
    };
}

Run dx fmt

fn x() {
    rsx! {
        button { class: "control-button", onclick: // comment
            move |_| async move { () }, "print content" }
    };
}

Comment moved out of closure

Run dx fmt again

fn x() {
    rsx! {
        button { class: "control-button", onclick: move |_| async move { () }, "print content" }
    };
}

Comment is now gone.

Expected behavior

dx fmt never moves comments out of scope or removes them.

Environment:

  • Dioxus version: v0.7.3
  • Rust version: 1.93.0
  • OS info: linux
  • App platform: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions