slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.94k stars 568 forks source link

Slint format will add an empty line right after two way binding #4797

Closed panda-z closed 6 months ago

panda-z commented 6 months ago
import { LineEdit } from "std-widgets.slint";

export component AppWindow inherits Window {

    in-out property <string> data;

    LineEdit {
        text <=> root.data;
    }
}

The above code snippets will be formated as

import { LineEdit } from "std-widgets.slint";

export component AppWindow inherits Window {

    in-out property <string> data;

    LineEdit {
        text <=> root.data;

    }
}

If there are other lines after the two way binding, the formatter will work correctly. E.g.:

import { LineEdit } from "std-widgets.slint";

export component AppWindow inherits Window {

    in-out property <string> data;

    LineEdit {
        text <=> root.data;
        width: 100%;
    }
}

Reproduced in vscode with the Slint (nightly) extension v2024.3.719.

ogoffart commented 6 months ago

Thanks for the bug report! Fixing in https://github.com/slint-ui/slint/pull/4804