rune-rs / rune

An embeddable dynamic programming language for Rust.
https://rune-rs.github.io
Apache License 2.0
1.7k stars 85 forks source link

Broken auto-formatting for consecutive single line comments #746

Closed VorpalBlade closed 1 month ago

VorpalBlade commented 1 month ago

This rune code:

fn test(cmds) {
    cmds.add_pkg("pacman", "openssh")?; // SSH protocol implementation for remote login, command execution and file transfer
    // TODO: OpenSSH Systemd
    // TODO: SSH config
}

gets formatted to:

fn test(cmds) {
    cmds.add_pkg("pacman", "openssh")?; // SSH protocol implementation for remote login, command execution and file transfer // TODO: OpenSSH Systemd // TODO: SSH config
}
VorpalBlade commented 1 month ago

Another variant of this:

            cmds.add_pkg("pacman", "git-cliff")?; // A highly customizable changelog generator     
            // TODO: Remove cproto?
            cmds.add_pkg("pacman", "cproto")?; // A program that generates function prototypes and variable declarations from C source code.

becomes:

            cmds.add_pkg("pacman", "git-cliff")?; // A highly customizable changelog generator // TODO: Remove cproto?
            cmds.add_pkg("pacman", "cproto")?; // A program that generates function prototypes and variable declarations from C source code.
udoprog commented 1 month ago

Fixed in #790